Sam Babichenko

Reading notes / Superposition

Memorization at the flat end of the loss curvature

Merullo et al., 2025

Weights and curvature
WWone MLP weight matrix, dout×dind_{\rm out}\times d_{\rm in}; the paper writes p×qp\times q
a,a, gginput to WW at one token; gradient of the loss with respect to the output WaWa
θ,\theta, pθ,p_\theta, y^\hat yall weights; the model's predictive distribution; a label sampled from it
F,F, FWF_WFisher information matrix; its block for WW
A,A, GGE[aa⊤]\mathbb E[aa^\top] and E[gg⊤]\mathbb E[gg^\top], uncentered second moments
⊗\otimesKronecker product; with rows of WW stacked, FW≈G⊗AF_W\approx G\otimes A, and stacking columns gives A⊗GA\otimes G
λi,\lambda_i, uiu_ieigenvalues of GG in decreasing order, and its eigenvectors; the paper counts from 0
μj,\mu_j, vjv_jeigenvalues of AA in decreasing order, and its eigenvectors
CijC_{ij}ui⊤Wvju_i^\top Wv_j, the coefficient of WW on the component uivj⊤u_iv_j^\top
λiμj\lambda_i\mu_japproximate curvature along uivj⊤u_iv_j^\top; the paper writes Πij\Pi_{ij}
S,S, WeditW_{\rm edit}the kept pairs (i,j)(i,j); the edited matrix, which the paper writes WpairsW_{\rm pairs}
Averaging toy (computed here)
NNnumber of memorized examples
mn,m_n, wwexample nn's own sharp direction; the direction all examples share
s2,s^2, c2c^2curvature of one example along its own direction; along the shared one
Hˉ\bar Hthe curvature matrix averaged over the NN examples
dddimension of the space the toy's directions live in
Constants
ρ\rhoshare of total curvature the edit keeps: 0.6 in OLMo-2 7B, 0.75 in the ViT; the paper calls it energy

Context. Large language models reproduce some of their training text word for word, raising copyright and privacy concerns. Studies of single training points find sharp loss curvature around a memorized point. A small change to the input or weights along some direction raises that point's loss steeply. Methods that remove memorized text usually start from a a list of the specific training sequences to be removed, used as a training signal, for example by raising the model's loss on them while keeping it low on other text, so they target only what someone has listed. Merullo et al. (2025) average curvature over the training distribution instead, asking whether that average locates memorization well enough to remove it without a list.

They find that memorization sits at the flat end of that average, so deleting the flattest components of a few MLP weight matrices removes most verbatim recitation without a forget set. The authors argue, without measuring it, that each memorized example curves sharply along its own direction. If different examples point in different directions, averaging dilutes each one to a tiny share, while shared directions add up and stay sharp. To estimate the average for each MLP weight matrix, they use Kronecker-factored approximate curvature: an approximation of one layer's block of the Fisher information matrix by the Kronecker product of two small matrices, the second moments of the gradients at the layer's output and of the activations at its input (Martens and Grosse, 2015). Its eigenbasis splits the matrix into rank-one components ordered from high to low curvature. Zeroing the low-curvature components in three late MLP layers of OLMo-2 7B cuts exact recitation of held-out memorized text from 99.9% to 3.4%. On famous quotes that no part of the method saw, exact recitation drops to 16.1%. Arithmetic and closed-book fact recall fall to 66% to 86% of their original accuracy, while logic and open-book question answering keep 93% or more. The authors read that split as a sign that arithmetic and fact recall also rely on narrowly used directions. On OLMo-2 7B, however, a data-free truncation of small singular values performs just as well. The curvature edit beats it only on quotes in OLMo-2 1B and in a vision transformer.

Setting. The language models are a family of open language models whose pretraining data are public (OLMo et al., 2024), so memorized training sequences can be found by direct search 7B and 1B. A training sequence counts as memorized when greedy decoding from its first 64 tokens reproduces the next 48 exactly. For the 7B model, the authors mine memorized sequences from the Dolma pretraining corpus and remove near-duplicates, leaving 1,000 sequences. They use 500 to train the supervised baseline and tune the edit, and hold out the remaining 500. A separate set of 512 famous quotes serves only for evaluation. A quote counts as memorized when the model completes its last 8 tokens exactly. The vision model is a a vision transformer of 86M parameters that reads a 224 by 224 image as patches of 16 by 16 pixels (Dosovitskiy et al., 2020) trained on ImageNet with 10% of its training labels replaced at random, following Zhang et al. (2017). The network can fit those mislabeled images only by memorization.

Every edit acts on MLP weight matrices. Write W∈Rdout×dinW\in\mathbb R^{d_{\rm out}\times d_{\rm in}} for one such matrix, aa for its input at one token, and gg for the gradient of the loss with respect to its output WaWa. The F=E[∇θlog⁡pθ(y^∣x) ∇θlog⁡pθ(y^∣x)⊤]F=\mathbb E\big[\nabla_\theta\log p_\theta(\hat y\mid x)\,\nabla_\theta\log p_\theta(\hat y\mid x)^\top\big], with θ\theta the weights and the label y^\hat y drawn from the model's own prediction pθ(⋅∣x)p_\theta(\cdot\mid x); it equals the expected Hessian of −log⁡pθ(y^∣x)-\log p_\theta(\hat y\mid x) in θ\theta FF measures loss curvature, and FWF_W denotes its block for WW. Estimating FF uses labels y^\hat y sampled from the model's own predictive distribution pθ(⋅∣x)p_\theta(\cdot\mid x). That sampling makes FF equal the expected Hessian of the negative log-likelihood and removes any need for labeled data.

Diagonalizing FWF_W directly is intractable for a full weight matrix, so K-FAC factors it into ordered rank-one components. At one token, the loss gradient with respect to WW is the outer product ga⊤ga^\top. Stacking the rows of WW into one vector turns ga⊤ga^\top into the for vectors, g⊗ag\otimes a lists all products gkalg_ka_l in the order (k,l)=(1,1),(1,2),…(k,l)=(1,1),(1,2),\dots; for matrices, G⊗AG\otimes A is the block matrix whose (k,l)(k,l) block is GklAG_{kl}A g⊗ag\otimes a, givingFW=E[(g⊗a)(g⊗a)⊤]=E[gg⊤⊗aa⊤]≈E[gg⊤]⊗E[aa⊤]=G⊗A.\begin{aligned}F_W&=\mathbb E\big[(g\otimes a)(g\otimes a)^\top\big]\\&=\mathbb E\big[gg^\top\otimes aa^\top\big]\\&\approx\mathbb E[gg^\top]\otimes\mathbb E[aa^\top]\\&=G\otimes A.\end{aligned}The third line treats gg and aa as independent, which is K-FAC's main approximation. Write G=∑iλiuiui⊤G=\sum_i\lambda_iu_iu_i^\top and A=∑jμjvjvj⊤A=\sum_j\mu_jv_jv_j^\top for the eigendecompositions of these second-moment matrices, with eigenvalues in decreasing order. The eigenvectors of G⊗AG\otimes A are ui⊗vju_i\otimes v_j, with eigenvalues λiμj\lambda_i\mu_j; reshaped back into matrices, they are the unit-norm rank-one components uivj⊤u_iv_j^\top. That splits WW into doutdind_{\rm out}d_{\rm in} components,W=∑i,jCij uivj⊤,Cij=ui⊤Wvj,W=\sum_{i,j}C_{ij}\,u_iv_j^\top,\qquad C_{ij}=u_i^\top Wv_j,each with approximate loss curvature λiμj\lambda_i\mu_j. Finding all of them takes two small eigendecompositions rather than one of size doutdind_{\rm out}d_{\rm in}. For OLMo-2, the authors estimate AA and GG for the the three weight matrices of OLMo-2's MLP block, which maps its input aa to Wdown(SiLU(Wgatea)⊙Wupa)W_{\rm down}\big(\mathrm{SiLU}(W_{\rm gate}a)\odot W_{\rm up}a\big), with ⊙\odot the entrywise product of every MLP from about 20M tokens of its training mixtures. For the ViT, they use 10,000 ImageNet training images at the the extra token a vision transformer adds to the image patches; its final state feeds the classifier only.

In the authors' argument, averaging over many examples pushes memorization to the flat end of this spectrum. Each memorized sequence curves sharply along a direction of its own, while a general mechanism curves along one direction shared across many inputs. An exact toy shows the arithmetic (computed here). Suppose each of NN examples has curvature s2s^2 along its own unit direction mnm_n and curvature c2c^2 along a shared unit direction ww, with all N+1N+1 directions mutually orthogonal. Their average curvature matrix isHˉ=c2 ww⊤+s2N∑n=1Nmnmn⊤.\bar H=c^2\,ww^\top+\frac{s^2}{N}\sum_{n=1}^{N}m_nm_n^\top.The shared direction keeps curvature c2c^2, while each example's own direction drops to s2/Ns^2/N. Once N>s2/c2N\gt s^2/c^2, each example's own direction is flatter than the shared one in the average, even when s2>c2s^2\gt c^2 on every single example. Dilution also needs enough ambient dimension dd for the directions to stay nearly orthogonal. Two random unit vectors in dd dimensions have average squared overlap 1/d1/d, so NN random directions yield averaged curvature about s2(1/N+1/d)s^2(1/N+1/d) along each (computed here). Both NN and dd must therefore be large compared with s2/c2s^2/c^2. In a plane (d=2d=2), many sharp directions average to a round bowl of curvature s2/2s^2/2 and never flatten. The paper never measures single-example curvature or the angles between examples' sharp directions. Its evidence for the flat end comes from the activation bands and weight edits below.

Before editing any weights, the authors test whether the K-FAC input basis separates memorized inputs from clean ones. Memorized inputs do load on the low-curvature end. Using the input factor AA alone, they group its eigenvectors vjv_j into four bands: top 10%, 10 to 25%, 25 to 50%, and bottom 50%. In layer 22 of OLMo-2 7B, the MLP input's bottom-50% band is 23.1% stronger on memorized inputs than on clean ones. The top-10% band is 26% stronger on clean inputs, with the middle bands ordered in between. Bands built from WW's right singular vectors show no ordering. In the ViT's last layer, the top-10% band is more than twice as strong on clean images as on memorized ones. Singular-vector bands again show no pattern.

The edit keeps the highest-curvature components and zeros the rest. It ranks pairs (i,j)(i,j) by λiμj\lambda_i\mu_j and keeps them in descending order until their summed curvature reaches a target share ρ\rho of the total:∑(i,j)∈Sλiμj≥ρ∑i,jλiμj=ρ(∑iλi)(∑jμj).\begin{aligned}\sum_{(i,j)\in S}\lambda_i\mu_j&\ge\rho\sum_{i,j}\lambda_i\mu_j\\&=\rho\Big(\sum_i\lambda_i\Big)\Big(\sum_j\mu_j\Big).\end{aligned}The edited matrix keeps only the components indexed by SS:Wedit=∑(i,j)∈SCij uivj⊤.W_{\rm edit}=\sum_{(i,j)\in S}C_{ij}\,u_iv_j^\top.No forget set enters this construction, since AA, GG, and the ranking all come from ordinary text. In OLMo-2 7B, the authors edit the gate and up projections of layers 23, 24, and 25 out of 32 at ρ=0.6\rho=0.6. In the ViT, they edit both MLP matrices of blocks 0 and 11 out of 12 at ρ=0.75\rho=0.75. The paper compares against two baselines. A data-free SVD edit deletes the smallest singular values of WW (in one layer on OLMo-2 7B, and in the same two blocks on the ViT). BSN (Sakarvadia et al., 2025): a learned binary mask over individual MLP weights, trained to raise the loss on a forget set of memorized sequences while keeping it low on a retain set of other text (BSN) learns a supervised weight mask on the Dolma tuning half.

The curvature edit removes far more recitation of unlisted memorized text than the supervised mask. Yet on OLMo-2 7B, the data-free SVD edit matches it. The unedited 7B model reproduces 99.9% of both held-out Dolma sequences and famous quotes exactly (strict accuracy). The curvature edit cuts strict accuracy to 3.4% on Dolma and 16.1% on quotes, while the exponential of the average next-token loss in nats; lower is better, and its rise after an edit measures how much ordinary prediction suffered on held-out Pile text rises from 19.04 to 22.84. BSN is trained on the Dolma forget set and tuned to a comparable perplexity of 23.59. It cuts Dolma recitation to 6.0% but leaves 60.0% of the quotes intact. The SVD edit reaches 3.0% on Dolma and 17.5% on quotes at perplexity 22.49, using the best settings the paper found for it. In OLMo-2 1B, the curvature edit beats SVD on quotes, 27.7% versus 39.6%, at perplexity 26.53 versus 26.94. On 7B held-out text, BSN preserves the unedited model's top next-token predictions slightly better than either edit, scoring 0.97 versus 0.91 on normalized discounted cumulative gain at 10: the share of the edited model's top 10 next-token predictions that are also in the unedited model's top 10, weighted toward the edited model's highest ranks; 1 when the two top-10 sets agree. On memorized 7B prefixes, however, BSN outputs nonsense ("measure measure") in seven of ten sample generations. In those same ten samples, the curvature edit mostly produces fluent text that diverges from the memorized continuation.

For a practitioner, this edit cuts verbatim recitation of unlisted text at a cost of a few points of perplexity. Computing it takes statistics from about 20M tokens of ordinary text, plus two eigendecompositions and a mask per matrix. Choosing which layers to edit and what fraction ρ\rho to keep still relied on memorization labels from the Dolma tuning split. The authors do not claim permanent erasure. They expect memorized text could resurface after further fine-tuning, a check they do not run.

On standard benchmarks in the a standard evaluation suite for language models with fixed prompts and scoring (Gu et al., 2025) suite, the 7B curvature edit hurts arithmetic and closed-book fact recall while sparing logic and open-book answering. Logic tasks keep 95% to 106% of their original accuracy, and open-book question answering keeps 93% to 99%. Closed-book question answering drops to 74% to 86%, and arithmetic-heavy math falls to 66% to 74%. The table pairs facts recalled from weights against facts given in the prompt, and sets math beside a neighboring subject and a logic task. TriviaQA-Open puts the relevant Wikipedia page in the prompt, and BBH Boolean is the Boolean-expressions task of BBH: 23 tasks from the BIG-Bench benchmark on which earlier language models fell short of the average human rater, 27 subtasks in all (Suzgun et al., 2022).
Accuracy, %, OLMo-2 7B
BenchmarkUneditedEdited
Facts recalled from the weights
TriviaQA78.064.8
PopQA80.759.8
Facts given in the prompt
TriviaQA-Open76.072.0
OpenBookQA+fact88.889.4
Math and its neighbors
GSM8K67.544.7
MMLU-Pro math23.415.8
MMLU-Pro CS26.126.3
BBH Boolean76.481.2
In one GSM8K answer, the edited model matches the unedited reasoning step for step and then adds 20 + 80 + 160 to get 220.Across 26 factual relations, frequent ones such as a country's largest city move by only a few points, while a rare one, a company's CEO, loses 78% of its accuracy. Here frequency is a statistic computed for OLMo-1, which was trained on different data.

Across four tasks, accuracy drops most on benchmarks whose inputs load on the low-curvature activation bands like memorized text. On the three edited layers, OpenBookQA with the fact supplied projects like clean data. Memorized inputs project onto the bottom-50% band about 1.6 times as strongly as OpenBookQA. SimpleMath (generated two-digit additions and subtractions) and TriviaQA both lean toward that bottom band and lose the most accuracy of the four tasks. For arithmetic, the authors leave two explanations open. Either the model memorizes the problems at this scale, or precise calculation relies on narrowly used directions.

The curvature basis clearly beats SVD in the vision transformer trained with 10% random labels. Unedited, the ViT predicts the corrupted label on 81.6% of noised training images and the true label on 10.5%, with 67.0% validation accuracy. Both the curvature edit and an SVD truncation of the same two blocks cut random-label predictions to 3.5%. At that same 3.5% rate, the curvature edit recovers the true label on 66.5% of those images versus 58.9% for SVD. It also lifts validation accuracy to 71.7% versus 67.8%. Editing the first or last block works best in a single-block sweep, matching the blocks with the widest activation-band separation.

The quote set gives a fair test of generalization beyond a forget set. No step of the method saw the quotes, scoring checks exact reproduction, and BSN was tuned to a comparable perplexity. The 16.1% versus 60.0% gap therefore reflects removal of unlisted text. The ViT adds a test where memorized examples are known by construction. There, the curvature edit recovers more true labels than SVD on the same blocks. A NeurIPS paper by Bernstein et al. (2026) tests top-eigenspace projection with the exact per-layer Fisher in ResNet-20 models on CIFAR-10. Those models are trained to memorize random images or corrupted labels. Keeping top eigenvectors hurts memorized samples more than clean ones in some layers, but not in others. Under corrupted labels, the separation is clear when the Fisher is computed on clean data and weakens once the noisy training set enters it.

For the language models, the experiments do not establish that curvature ordering itself does the work. No control deletes random or high-curvature components at matched perplexity, and the data-free SVD edit matches the curvature edit on OLMo-2 7B. Because the Dolma tuning split chose the edited layers and kept fraction, the quotes remain the only clean test. Every number comes from a single run, with no repeated seeds and no error bars on the main tables. The tests cover only one language-model family (OLMo-2) and one ViT-Base trained by the authors. Both activation-band comparisons, on memorized text and on downstream tasks, come from single figures with no summary statistics. Recitation also partly returns under the prompt perturbations of Huang et al. (2024). Average exact continuation length climbs from 6.6 to 13.3 tokens for the curvature edit, versus 4.6 to 10 for BSN. No outside replication of the language-model edits was found.

Terms

Curvature basis
the rank-one components uivj⊤u_iv_j^\top of a weight matrix, ordered by their K-FAC curvature λiμj\lambda_i\mu_j
K-FAC
FW≈G⊗AF_W\approx G\otimes A: one layer's Fisher block as gradient second moments times input second moments
Population flatness
each memorized example is sharp in its own direction, so the average gives each such direction a small share
Curvature edit
keep pairs in decreasing λiμj\lambda_i\mu_j until a share ρ\rho of the total is kept, and zero the rest of WW
SVD edit
delete the smallest singular values of WW; uses no data
BalancedSubnet (BSN)
supervised baseline: a weight mask trained to raise the loss on a forget set
Strict accuracy
share of memorized sequences still reproduced exactly; lower is better here
Activation band
a range of eigenvectors of AA (top 10% to bottom 50%) on which an input's projection is measured
Closed-book vs open-book
answering from the weights alone, or with the source text in the prompt

Sources

Connected notes

Threads