Today, a core pipeline of artificial intelligence systems is pretraining on a broad range of text corpora and then fine-tuning on specific tasks or desired behaviors. Yet we still have limited understanding of how fine-tuning on a restricted data distribution modifies representations acquired during pretraining. In particular, it remains unclear whether surface behavioral suppression happens together with the erasure of latent representations that support it. In this work, we study supervised fine-tuning (SFT) by pretraining transformers on a controlled context-free grammar with hierarchical latent structure, the Random Hierarchy Model (RHM), and fine-tuning with a restricted subset of its generative rules. While during pretraining the model's ability to generate with the correct grammar rules coincides with building the internal representations of the corresponding latent, we find that SFT exhibits a very different dynamics: (i) the generation of deleted rules changes on a fast timescale inversely proportional to the magnitude of the token-latent correlation; meanwhile, their corresponding representations stay intact; (ii) the hidden representations of the deleted rules become forgotten on a much longer timescale, associated with a slow drift of the network parameters. Finally, we observe analogous results in a realistic setup with natural language, suggesting that this timescale separation in forgetting is a more general phenomenon of fine-tuning language models.
Figures & tables
Figure 1: The Random Hierarchy Model and our setup. (a) The rule books, one per level, prescribe how each symbol can be expanded in m lower-level synonymic representations. They define the pretraining grammar Gpre . (b) The restriction that defines the grammar used in fine-tuning, Gft : for every symbol on every level, only mkeep rules stay valid while the others get deleted. (c) An example of a sequence with its latent tree structure generated by an RHM with depth L=4 and branching factor s=2 . (d) to (f) The schematic diagram of the generation probe, the representation probe, and how the sequences in the three test families are generated to measure prediction loss. The gray nodes use the kept rules to generate their children, while the red nodes use the deleted rules.
Figure 2: The two timescales of forgetting in the restriction at m=6 ( mkeep=3 ); mean ± std over 4 seeds. We reproduce the same results for m=8 and m=10 ( Figure 7 ). (a) The deleted-rule rate at levels ℓ=1 to 4 , against the fine-tuning step t , falls from the reference value 1/2 (dotted), with the curves ordered from the bottom level to the root. Inset: the curves of the four levels, without error bars, collapse against the rescaled step tmkeep−ℓ/2 of Equation 3 (full size in Figure 8 ). (b) The representation probe qR at μ−21 , μ−22 and μ−23 stays close to 1 long after generation is suppressed, and starts decreasing toward each node’s symbol reference (dotted) only orders of magnitude of steps later. (c) Llast on the three test families; dashed line: the Bayes-optimal loss of Gft , seed mean. The deleted-grammar loss rises during the suppression, while the deleted-grammar-in-context loss stays close to the Bayes-optimal loss until qR decreases.
Figure 3: Restriction fine-tuning at m=6 , mkeep=3 with learning rates η=3×10−4 , η0=10−4 (the learning rate of all other experiments) and 3×10−5 ; mean ± std over 3 seeds. The insets show the curves averaged over seeds vs the fine-tuning step t . (a) Deleted-rule rate at level ℓ=1 : the curves decrease from the starting value 1/2 (dotted line) at different times depending on η (inset), and they collapse when plotted vs tη/η0 . This is consistent with a suppression of generation driven by the mean weight updates. (b) Probe qR at μ−21 : also the time-scale of representational forgetting depends on the learning rate η (inset), but curves collapse when plotted vs t(η/η0)2 , differently from panel (a). This is consistent with representational forgetting being driven by accumulated noise in the weight updates. (c) Distance from the pretrained parameters relative to their norm, ∥θt−θ0∥/∥θ0∥ : consistently with panel (b), the late time displacement depends on η (inset) and the curves collapse when plotted vs t(η/η0)2 , converging to an asymptotic displacement ∝t1/2 (dashed line).
Figure 4: Bilingual pretraining followed by EN-only fine-tuning. (a) FR generation rate drops rapidly before the 102 fine-tuning steps, both for the first sentence and all sentences in the context window. (b) Cosine similarity between representations of coherent and token-shuffled sentences in FR and EN; higher similarity indicates loss of latent linguistic capability. Rapid rise of FR happens after 102 steps. (c) Reproducing the three test families ( Figure 1 (f)). Prediction losses for EN targets with EN context (gray), FR targets with FR context (red), and EN targets with FR context (blue) show a similar trend, characterized by a further drop of the loss for gray (kept rules), a faster rise of the loss in red (deleted rules) and a slower timescale of blue (deleted rules in context). (d) Parameter distance relative to the pretrained norm; the vertical line marks 102 steps, approximately coinciding with the transition in the behavioral and representational forgetting.
Appendix figures & tables24 assets
Supplementary material from the paper’s appendix.
Appendix
blocks
4 , with layer normalization before each attention and feed-forward operation
hidden width d , heads
512 , 16
feed-forward layers
hidden width 4d , Gaussian-error linear unit (GELU)
positional embedding
learned, absolute
readout
linear, tied to the token embedding, after a final layer normalization
biases, dropout
none
parameters nθ
12.6×106
Appendix
Table 1: Network, training and evaluation settings supplementing Section 3.1 for the L=4 restriction experiments.
Figure 5: Pretraining at m=6 . (a) Llast for networks with 1 to 5 blocks, and a two-block network with hidden width 720 (dashed, labeled d=720 in the legend), approximately matching the parameter count of the four-block network; mean ± std over 4 seeds. Horizontal dashed lines: the seed-averaged plateau losses L0,…,L4 . Vertical dashed lines: the sample scales P1,…,P4 of equation 6 . Their common prefactor is fixed by the geometric mean, over the five network depths, of the sample count where the mean loss crosses L1 . (b) qS for the four-block network at μ−21 , μ−22 and μ−23 ; mean ± std over 8 seeds, with the same vertical lines.
Figure 6: Last-token learning curves of the four-block network at m=6,…,10 ; mean ± std over 8 seeds. Panels (a) to (d) correspond to the transitions ℓ=1,…,4 . Each plots Llast/Lℓ−1 , using the seed’s own plateau reference, against P divided by the m -dependent factor of Pℓ in equation 6 . Dotted horizontal line: 1 . Dashed vertical line: the common prefactor fixed in Figure 5 , expressed on the rescaled axis.
Figure 7: Restriction fine-tuning at m=8 , mkeep=4 (top row), and m=10 , mkeep=5 (bottom row); mean ± std over 4 seeds. (a), (d) Deleted-rule generation rates at levels ℓ=1,…,4 against fine-tuning step t ; dotted line: 1/2 . The same curves against tmkeep−ℓ/2 are shown in Figure 8 (b), (c). (b), (e) qR at μ−21 , μ−22 and μ−23 , with each node’s symbol reference (dotted). (c), (f) Llast on the three test families; gray dashed line: the seed-averaged Bayes-optimal loss of Gft . Colors follow Figure 2 .
Figure 8: Deleted-rule rate at levels ℓ=1 to 4 against the rescaled step tmkeep−ℓ/2 in the restriction fine-tuning at (a) m=6 , mkeep=3 , (b) m=8 , mkeep=4 and (c) m=10 , mkeep=5 ; mean ± std over 4 seeds; dotted line: 1/2 . Under this rescaling, the curves of the four levels, which start to fall at different steps in Figures 2 (a) and 7 (a), (d), collapse, consistent with equation 3 .
Figure 9: Restriction fine-tuning for RHM grammar with L=3 , v=16 , m=8 and mkeep=2 ( (a) , (d) ), mkeep=4 ( (b) , (e) ), mkeep=6 ( (c) , (f) ); mean ± std over 4 seeds. (a) to (c) Deleted-rule generation rates at levels ℓ=1,2,3 against fine-tuning step t ; dotted line: 1−mkeep/m . (d) to (f) The same curves against tmkeep−ℓ/2 , with the same axes in the three panels. The probability of generating deleted rules starts decreasing at different timescales depending on mkeep and rule level ℓ . Rescaling the fine-tuning time step by mkeepℓ/2 collapses the point where the curves start decreasing ((d) to (f)).
Figure 10: Deleted-rule rate at levels ℓ=1 to 4 (columns) in the restriction fine-tuning at m=6 , mkeep=3 with learning rates η=3×10−4 , 10−4 and 3×10−5 , against the fine-tuning step t (top row), tη/η0 (middle row) and t(η/η0)2 (bottom row), η0=10−4 ; dotted line: 1/2 ; mean ± std over 3 seeds. The middle row shows that the curves collapse on each other when plotted against tη/η0 , consistently with the hypothesis of Section 4.4 that fine-tuning generation behavior is controlled by the average loss gradient.
Figure 11: Linear probe accuracy (Appendix A.4 ) at μ−21 , μ−22 and μ−23 (columns) for the learning rates of Figure 10 , against the fine-tuning step t (top row), t(η/η0)2 (middle row) and tη/η0 (bottom row); dotted line: chance 1/v ; mean ± std over 3 seeds. The middle row shows that the curves collapse on each other when plotted against t(η/η0)2 , consistently with the hypothesis of Section 4.4 that representational forgetting is controlled by the variance of the loss gradients.
Figure 12: Representation probe qR at μ−21 ( (a) to (c) ) and distance from the pretrained parameters relative to their norm, ∥θt−θ0∥/∥θ0∥ ( (d) to (f) ), against the fine-tuning step t , for the learning rates η of Figure 10 . Curves represent the mean ± std over 3 seeds. Panels (a) and (d) show that larger η corresponds to faster weight displacement, which in turn results in faster representational forgetting. Panels (b) and (e) show that rescaling the x-axis as t(η/η0)2 collapses both the representational forgetting and the weight displacements, which align to a single curve proportional to t1/2 (dotted line). This is consistent with the discussion in Section 4.4 that representational forgetting is driven by accumulated noise in the gradient updates. Panels (c) and (f) show that tη/η0 is not the variable controlling this stage of dynamics (cf. Figure 10 ).
Figure 13: Restriction fine-tuning at m=6 , mkeep=3 for the baseline and for bounded suppression (Section 4.4 ), against the fine-tuning step t ; mean ± std over 4 seeds. (a) to (d) Deleted-rule rate at levels ℓ=1 to 4 ; dotted line: 1/2 . (e) qR at μ−21 . (f) Linear probe accuracy at μ−21 (Appendix A.4 ); dotted line: chance 1/v . With bounded suppression the deleted-rule rate stops decreasing at a small value, while qR and the linear probe accuracy follow the baseline: the slow change in representations is not caused by the continued suppression of deleted rules.
Figure 14: Restriction fine-tuning at m=6 , mkeep=3 with decoupled weight decay of coefficient λ (top row) or an L2 regularization of coefficient λ toward the pretrained parameters θ0 (bottom row), both applied separately from the Adam update; legend in (a); λ=0 is the same baseline in both rows. (a), (d) Distance from the pretrained parameters relative to their norm, ∥θt−θ0∥/∥θ0∥ ; dotted line: ∝t1/2 . (b), (e) Deleted-rule rate at ℓ=1 ; dotted line: 1/2 . (c), (f) Linear probe accuracy at μ−21 (Appendix A.4 ); dotted line: chance 1/v . Mean ± std over 4 seeds. Both regularizations leave the time-scale for the decrease of the deleted-rule rate unchanged ((b), (e)). Weight decay moves the parameters away from θ0 over a time of order 1/(ηλ) , and the linear probe accuracy falls earlier for larger λ ((a), (c)). The regularization toward θ0 stops the increase of the distance and, when strong enough, keeps the accuracy close to 1 ((d), (f)).
Figure 15: Retraining on Gpre from the restriction fine-tuning at step t ( m=6 , mkeep=3 ): steps until the deleted-rule rate of level ℓ is back above 0.45 ( 1/2 under Gpre ), against t ; dashed lines: the same network trained on Gpre from random initialization, same color per level. Seed 0 .
Figure 16: Free continuation of the second half after a first half drawn from Gpre , in which each node uses a deleted rule with probability 1/2 ( m=6 , mkeep=3 ). Rate of deleted rules (a) , of kept rules (b) and of invalid nodes (c) at each level of the parsed continuation: ℓ=1,2,3 inside the second half, ℓ=4 the rule at the root, which joins the two halves. A node is invalid when its children are not a rule of Gpre or a node below it is invalid. Dotted lines: 1/2 , the value under Gpre in (a) and (b). Rates pooled over five consecutive checkpoints; mean ± std over 4 seeds.
Figure 17: Fine-tuning after resampling one rule book at m=6 ; columns run from the root book (level 4 ) to the bottom book (level 1 ). Curves and uncertainties show mean ± std over 4 seeds. (a) to (d) Llast on sequences from the resampled grammar Gft ; gray dashed lines: lnv and the seed-averaged plateau losses L1,…,L4 of Gft . (e) to (h) qS at μ−21 , μ−22 and μ−23 , using Gft . All panels share the fine-tuning-step axis.
Figure 18: Comparison of behavioral forgetting during fine-tuning for non-linear vs linearized model. The linearized model flin(x;Δθ)=fθ0(x)+Jθ0(x)Δθ corresponds to a first order linearization around the pretrained weights θ0 . Panels (a), (b), (c) show that only the adaptation timescale to forbidden rules at the bottom level is effectively described by the linearized model (i.e., the blue curves start to decay at the same time), while for higher hierarchical levels the linearized model is slower w.r.t. the non-linear one. Panels (d), (e), (f) show that the scaling tℓ(ft)∼mkeepℓ/2 works across all levels only for the non-linear model (solid lines), while it captures some of the linear behavior only for increasing values of m and mkeep (panel (f)).
Figure 19: The measurements of Figure 4 for French-only fine-tuning. (a) English generation rate. (b) Coherent–shuffled representation similarity for English (red) and French (gray). (c) Prediction loss for French targets with French context (gray), English targets with English context (red), and French targets with English context (blue). (d) Relative parameter distance, as in Figure 4 (d).
Figure 20: Bilingual pretraining and English-only fine-tuning without weight decay. Panels (a) to (d), colors and reference line as in Figure 4 : French generation, coherent–shuffled representation similarity, prediction loss and relative parameter distance.
Figure 21: Bilingual pretraining and French-only fine-tuning without weight decay. Panels (a) to (d), colors and reference line as in Figure 19 : English generation, coherent–shuffled representation similarity, prediction loss and relative parameter distance.
Figure 22: EN-TR bilingual pretraining and English-only fine-tuning. Panels (a) to (d), colors and reference line as in Figure 4 : Turkish generation, coherent–shuffled representation similarity, prediction loss and relative parameter distance.
Figure 23: EN-TR bilingual pretraining and Turkish-only fine-tuning. Panels (a) to (d), colors and reference line as in Figure 19 : English generation, coherent–shuffled representation similarity, prediction loss and relative parameter distance.
Figure 24: Bilingual pretraining and English-only fine-tuning additional control experiments. (a) The same three test families from Figure 4 (c) to recap the generation and representation forgetting timescales. (b) Context ablation experiment. At the onset of representational forgetting, removed language (FR) does not benefit from coherent, informative context. Before that, it benefits as much as the kept language (EN), and at the end of the fine-tuning it almost reaches the baseline level similar to the model which was never trained with French. (c) Recoverability experiment shows how much training is required to relearn the removed language after each fine-tuning. Before the onset of representational forgetting ( 102 ), the model almost immediately recovers to the level of the bilingual pretrained model (gray line). Relearning takes significantly more after the onset of representational forgetting ( 103∼ ), almost similar to the model that was never trained with FR but only EN (black solid line). EN knowledge requires less relearning data than training from scratch indicating EN provides structural similarity to FR and enables the faster learning (black dashed line).
Figure 25: Bilingual pretraining and French-only fine-tuning additional control experiments. Panels (a)-(c) are equivalent to Figure 24 , only switching kept language (FR) and removed language (EN).
Figure 26: Targeted syntax fine-tuning on Qwen2.5-Coder-0.5B. Panels (a)-(d) are equivalent metrics to those of bilingual transformer experiments. The text on each panel indicates removed syntax.
Figure 27: Targeted syntax fine-tuning on Qwen2.5-Coder-1.5B. Panels (a)-(d) are equivalent metrics to those of bilingual transformer experiments. The text on each panel indicates removed syntax.
Catastrophic forgetting, the drastic loss of previously acquired capabilities when learning new ones, is a central challenge in language model fine-tuning. Supervised fine-tuning (SFT) is widely believed to be prone to such forgetting. Recent works have attributed this to the off-policy nature of SFT, arguing that on-policy learning is key to continual learning. In this paper, we challenge this premise. We show that while maximizing new-task performance can induce catastrophic forgetting, alternative hyperparameter choices (lower learning rate and batch size) can yield similar gains with little to no forgetting. With hyperparameters selected jointly for gain and retention, vanilla SFT retains prior capabilities far better than previously suggested and can be competitive with Self-Distillation Fine-Tuning (SDFT), an on-policy approach designed to mitigate forgetting. While SDFT can be more robust to hyperparameter choices, it also requires a retention-aware criterion to identify hyperparameter configurations that avoid catastrophic forgetting. Our results challenge the view that on-policy training is what enables learning with retention and raise broader questions about what drives catastrophic forgetting during fine-tuning.
Nirmit Joshi, Nathan Srebro, Eran Malach
Toyota Technological Institute at Chicago. · Apple.
Knowledge that a language model appears to forget during finetuning often remains stored and can be recovered, a phenomenon called spurious forgetting. Finetuning on new facts can even produce forgetting that undoes itself: recall of the old facts collapses, recovers as training continues on new facts alone, and only then erodes for good. We seek to understand when such forgetting is not catastrophic. A minimal associative memory reproduces these dynamics with three ingredients: keys with shared structure, concentrated new values, and normalization in the network. Finetuning moves all old representations along a common direction, hiding the old facts while preserving their relative geometry; normalization withdraws this shift once the new facts are learned, whereas fact-specific changes accumulate and cause the erosion. Moreover, subtracting the common shift eliminates the collapse in a Transformer trained on synthetic data, and removing a single direction from each weight update restores old facts in a pretrained language model. Forgetting thus combines a shared, reversible loss of access with a slow erosion of individual facts, and only the second is catastrophic. Which one dominates depends on whether the new data move old memories together or apart.
Vedant Palit, Florent Draye, Nicolas Zucchet +2
MPI for Intelligent Systems, Tübingen · Jinesis Lab, University of Toronto & Vector Institute · EuroSafeAI +3
Models trained on a new task typically degrade on prior tasks, a phenomenon known as forgetting. Traditionally, mitigating forgetting has required replaying stored exemplars from prior tasks, which is often impractical. By contrast, language models can sample from their own training distribution, and we show that these self-generated samples serve as effective replay data, nearly eliminating forgetting. We find that forgetting nonetheless persists when the model has little remaining capacity: models pretrained close to saturation cannot absorb new information without overwriting prior knowledge. When capacity is not the limiting factor, low learning rates reduce forgetting but require substantially more training steps. Replay breaks this tradeoff, enabling fast, high-learning-rate finetuning without forgetting.