Retaining by Doing: The Role of On-Policy Data in Mitigating Forgetting

Paper · arXiv 2510.18874 · Published October 21, 2025
Reinforcement Learning

Adapting language models (LMs) to new tasks via post-training carries the risk of degrading existing capabilities—a phenomenon classically known as catastrophic forgetting. In this paper, toward identifying guidelines for mitigating this phenomenon, we systematically compare the forgetting patterns of two widely adopted post-training methods: supervised fine-tuning (SFT) and reinforcement learning (RL). Our experiments reveal a consistent trend across LM families (Llama, Qwen) and tasks (instruction following, general knowledge, and arithmetic reasoning): RL leads to less forgetting than SFT while achieving comparable or higher target task performance. To investigate the cause for this difference, we consider a simplified setting in which the LM is modeled as a mixture of two distributions, one corresponding to prior knowledge and the other to the target task. We identify that the mode-seeking nature of RL, which stems from its use of on-policy data, enables keeping prior knowledge intact when learning the target task. We then verify this insight by demonstrating that the use on-policy data underlies the robustness of RL to forgetting in practical settings, as opposed to other algorithmic choices such as the KL regularization or advantage estimation. Lastly, as a practical implication, our results highlight the potential of mitigating forgetting using approximately on-policy data, which can be substantially more efficient to obtain than fully on-policy data.

Introduction. Adapting language models (LMs) to new target tasks during post-training carries the risk of eroding previously acquired capabilities—a phenomenon known as catastrophic forgetting (McCloskey & Cohen, 1989; Kirkpatrick et al., 2017). Such forgetting has been reported to occur when training LMs to follow instructions via supervised fine-tuning (SFT) (Luo et al., 2023; Shi et al., 2024; Wu et al., 2024) or aligning them with human preferences via reinforcement learning (RL) (Bai et al., 2022; Ouyang et al., 2022).

However, the understanding of how SFT and RL compare in terms of their susceptibility to forgetting remains limited. In this work, we systematically compare the forgetting patterns of SFT and RL in order to identify principled guidelines for mitigating forgetting in LM post-training. We conduct a comprehensive study across instruction following, general knowledge, and arithmetic reasoning tasks, using Qwen 2.5 (Yang et al., 2024) and Llama 3 (Grattafiori et al., 2024) models of up to 8B scale. Our experiments reveal a consistent trend: SFT suffers from severe forgetting, whereas RL can achieve high target task performance without substantial forgetting (Figure 2).

We then investigate the cause for the relative robustness of RL to forgetting. At first glance, it may seem at odds with conventional wisdom. Namely, minimizing the crossentropy loss via SFT is equivalent to minimizing the forward KL divergence with respect to the optimal policy, while maximizing the RL objective corresponds to minimizing the reverse KL (Korbak et al., 2022). Conventional wisdom presumes that the mode-seeking nature of reverse KL enables faster learning of target distributions (Chan et al., 2022; Tajwar et al., 2024b) at the cost of losing coverage of old modes, while the mode-covering forward KL should maintain probability mass across modes. We reconcile this discrepancy by considering a simplified setting, where the target distribution is modeled as a mixture of two distributions: one representing the policy’s prior knowledge and the other representing the target task. We show that, if the initial policy is uni-modal (i.e., has a single mode), then SFT can in fact be more robust than RL to forgetting. However, if the initial policy is multi-modal (i.e., has multiple modes), which is arguably the case for practical LMs, then modeseeking RL leads to less forgetting than mode-covering SFT; see Figure 1 for an illustration.

Related work. Catastrophic forgetting. Catastrophic forgetting has been studied since early research on connectionist models (Mc- Closkey & Cohen, 1989). Initial efforts to mitigate forgetting focused on preventing parameters from drastically changing (Kirkpatrick et al., 2017; Li & Hoiem, 2018; Lopez-Paz & Ranzato, 2017). In the context of LM posttraining, patterns of catastrophic forgetting differ due to the massive data used during pre-training (Luo et al., 2023; Shi et al., 2024; Wu et al., 2024). While LMs typically do not drastically forget all pre-trained knowledge, post-training LMs often leads to degradation in performance, which has been called “alignment tax” (Bai et al., 2022; Ouyang et al., 2022). Prior work found more severe forgetting when considering contrasting domains such as instruction following and safety (Qi et al., 2023; He et al., 2024). Though, Lee et al. (2024); Chen et al. (2024) suggest that forgotten behaviors or abilities can be revived with little re-training. (Kotha et al., 2024) posited that forgetting happens when the LM infers a wrong mode from the mixture of distributions to perform the task, and a carefully selected prompt can recover forgetting. Our work draws inspiration from the mixture-of-distributions perspective to establish intuition.

LM post-training. Post-training methods such as SFT and RL are widely used for endowing pre-trained LMs with desired behaviors or enhancing performance on target tasks. SFT relies on the ground truth demonstrations. By contrast, RL generates responses from the model and only provides a reward signal, be it from a parameterized reward model (Schulman et al., 2017) or verifiable rewards (Shao et al., 2024; Lambert et al., 2024). Recent studies have shown that SFT and RL exhibit distinct characteristics. (Razin et al., 2024; 2025) identified that the optimization speed of RL strongly depends on reward variance. (Chu et al., 2025) showed that RL is able to generalize to unseen distributions while SFT can be prone to memorization. (Wang et al., 2025) observed that RL can benefit from even training on a single example without severe overfitting. Lastly, (Mukherjee et al., 2025) reported that RL fine-tunes a smaller network compared to SFT. A common thread connecting these results is that the parameter update during RL training is more local and targeted. Other methods such as RAFT (Dong et al., 2023) and STaR (Zelikman et al., 2022) perform SFT in several rounds and can be viewed as approximately on-policy RL. This paper complements these studies and provides a forgetting-centric view on the difference between SFT and RL.

Method. To summarize, our main contributions are:

• We provide a systematic empirical comparison of forgetting between SFT and RL across tasks, model families, and scales, establishing that RL forgets significantly less than SFT.

• We identify on-policy data as the core factor behind RL’s robustness to forgetting—ruling out alternative explanations such as KL regularization or advantage estimation—and provide intuition for why modeseeking updates can counterintuitively preserve prior knowledge.

• We show that approximately on-policy data, generated at each epoch instead of each step, can still benefit from substantial forgetting mitigation with a lower computational cost, offering practical guidance for efficient post-training.

We begin by introducing notation and the metrics used to measure forgetting. Then, we empirically compare the forgetting patterns of supervised fine-tuning (SFT) and reinforcement learning (RL).

A language model (LM) is modeled by a policy πθ(y | x), where the response y is generated conditioned on the prompt x. For a target task T , we denote the optimal policy by π∗(· | x). In SFT, the cross-entropy loss is minimized with respect to ground truth responses y∗sampled from the optimal policy: LSFT(θ; x) := P y −π∗(y | x) log πθ(y | x). By contrast, in RL, the goal is to maximize the KL-regularized reward with respect to responses generated by the LM and a reward function r(x, y) ∈{0, 1}1 i.e.: JRL(θ; x) := Ey∼πθ(· | x)[r(x, y)] − β · KL[πθ(· | x) || πθ0(· | x)], where β > 0 and πθ0 is the initial policy.

Forgetting and evaluation metrics. The initial policy πθ0 is trained on a target task T for T optimization steps, resulting in the trained policy πθT . This policy is evaluated using accuracy, which measures the fraction of correct outputs generated by πθT for prompts associated with Target tasks and evaluation. We consider three tasks, covering different capabilities: IFEval (Zhou et al., 2023; Lambert et al., 2024) for instruction following, MMLU (Hendrycks et al., 2021a) for general knowledge, and Countdown (Pan et al., 2025) for arithmetic reasoning. These target task datasets are split into training set and evaluation set as described in Appendix A.3. After training on one target task, we evaluate the model’s performance on all the other tasks. We additionally include the following non-target tasks: MATH (Hendrycks et al., 2021b); two safety datasets, WildJailbreak (Jiang et al., 2024) and Wild- GuardTest (Han et al., 2024), since safety capabilities are often eroded through fine-tuning (Qi et al., 2024), making them highly suitable for measuring forgetting. In our RL experiments, correct generations are assigned a reward of 1 and incorrect generations are assigned a reward of 0.

Models and baselines. We use instruct models from the Llama 3 (Grattafiori et al., 2024) and Qwen 2.5 (Yang et al., 2024) families as the initial policies: Llama-3.2-1B-Instruct, Llama-3.1-8B-Instruct, Qwen-2.5-1.5B-Instruct, and Qwen- 2.5-7B-Instruct. We compare two SFT variants and one RL method: 1) SFT, which uses responses generated by Llama- 3.3-70B-Instruct as ground truth responses; 2) Self-SFT, which uses responses generated by the initial model (we keep only the correct responses based on the reward function (Zelikman et al., 2022)); and 3) RL—we use GRPO (Shao et al., 2024), a common algorithm for tasks with verifiable outputs. For both SFT variants, the generated data was filtered using the reward function to include only examples with correct responses. We use Self-SFT as a baseline to represent the typical first step in the post-training pipeline when The experiments of §2 demonstrated that RL causes less forgetting than SFT. By considering a simplified setting in §3, we identified that the mode-seeking behavior of RL, which stems from its usage of on-policy data, may underlie its robustness to forgetting. We now verify this prospect by demonstrating in practical settings that the robustness of RL to forgetting indeed arises from its use of on-policy data, as opposed to other algorithmic choices such as KL regularization or an advantage estimator (§4.1).

Discussion. The mode-seeking behavior of RL (i.e., its accordance with reverse KL minimization) stems from the usage of on-policy data. Through extensive ablations, we empirically verify that this property underlies the robustness of RL to forgetting, as opposed to other algorithmic choices such as the advantage estimation or the application of KL regularization. Moreover, we explore what degree of on-policy data allows mitigating forgetting. We find that for SFT, while generating data only from the initial policy is not enough, approximately on-policy data generated at the start of each epoch can suffice for substantially reducing forgetting. This suggests a practical guideline for LM post-training: leveraging on-policy data, potentially sampled asynchronously or at the start of each epoch for improved efficiency, can reduce unintended disruption of the model’s existing capabilities.

KL regularization does not explain robustness to forgetting. KL regularization is commonly applied during RL to prevent the policy from drifting too far from its initialization (Ouyang et al., 2022; Shao et al., 2024). We examine whether this regularization accounts for the lesser forgetting of RL. As Figure 6 shows, non-regularized GRPO achieves a similar target task gain and non-target tasks drop tradeoff as KL-regularized GRPO across all considered models and Retaining by Doing: The Role of On-Policy Data in Mitigating Forgetting datasets, except for Llama models trained on IFEval. These results suggest that the use of KL regularization does not underlie the robustness of RL to forgetting.

We identified the usage of on-policy data as the main contributor for the robustness of RL to forgetting. However, generating on-policy data at each step entails a non-negligible compute overhead. We therefore explore the degree of “onpolicyness” required to enjoy the benefit of reduced forgetting. Figure 2 showed that Self-SFT, which generates data only from the initial policy, suffers from severe forgetting. On the other hand, RL, which generates data at every step and thus represents the most on-policy end of the spectrum, is robust to forgetting. We now test whether Iterative-SFT, an approximately on-policy approach that iteratively trains on data generated at the start of each epoch (Zelikman et al., 2022; Dong et al., 2023; Xiong et al., 2025), can suffice for mitigating forgetting.

Figure 7 compares the target task accuracy and the drop in non-target tasks relative to GRPO of Iterative-SFT, Self- SFT, and SFT. We find that Iterative-SFT is able to reach a target accuracy that is higher than or comparable to that of SFT, while only exhibiting mild to no forgetting. We also test an additional approximately on-policy approach that applies SFT on data generated during an RL run, and observe reduced forgetting as well (see Appendix A.4.1). Overall, these results highlight that while RL remains most effective in forgetting mitigation, making SFT more onpolicy or directly applying SFT on RL data can suffice for reducing forgetting.

Conclusion. We systematically compared catastrophic forgetting in SFT and RL for LM post-training. Across tasks, scales, and model families, we found that RL consistently achieves strong target performance with substantially less forgetting than SFT. Our experiments in both simplified and real-world settings establish that the robustness of RL to forgetting primarily stems from its use of on-policy data, rather than other algorithmic choices such as the advantage estimate or KL regularization. Furthermore, they highlight the potential of efficiently mitigating forgetting by incorporating approximately on-policy data, sampled asynchronously or at the start of each epoch.

Limitations. and future directions. Our work provides evidence that RL is more robust than SFT to forgetting across several tasks, model families, and scales. However, investigating how forgetting patterns vary as the model and dataset sizes are further scaled, beyond our compute budget, remains a valuable direction for future work. Moreover, while we provide intuition for why RL forgets less than SFT based on a simplified mixture-of-Gaussians setting (§3) and empirically identify the use of on-policy data as a main cause for this difference in forgetting (§4), additional research is necessary to theoretically establish the role of on-policy data in mitigating forgetting. Going forward, the issue of forgetting becomes central as the community moves toward building agents that continually learn from experience (Silver & Sutton, 2025). Deciding what data to consume is consequential to the stability of the agent. Our results indicate that data generated on-policy will better preserve existing capabilities, and is therefore safer to learn from, than off-policy data such as content on the internet or experience from other agents. In a similar vein, our insights lays groundwork for understanding forgetting in the emerging paradigm of test-time training (Sun et al., 2020; Hardt & Sun, 2024).

Lines of inquiry this paper opens 24

Research framings built by reading the notes related to this paper — the questions it feeds into.

How important is reward engineering relative to pretraining for reasoning? How do training data, curriculum, and scale affect capability development? Can RL enable genuinely new reasoning or just optimize existing capabilities? How do supervised fine-tuning and reinforcement learning compare in preserving reasoning quality? What persistent memory architectures best support learning across sessions? How do parameter-efficient methods maintain performance while reducing training cost? How should reinforcement learning training be optimized for language models? Can agents learn from feedback and experience to improve behavior? How do inference costs and infrastructure economics shape AI adoption?