Manuscript Offprint

arXiv:2610.02437

Learning Style, Forgetting Semantics: A Case Study of SFT and RFT on Classification Tasks

Haodong Liang, Yanhao Jin, Krishnakumar Balasubramanian, Lifeng Lai

ABSTRACT

Why does supervised fine-tuning (SFT) lead to more forgetting than reinforcement fine-tuning (RFT), even when all teacher demonstrations are semantically correct? We study this question on classification tasks where tokens within each semantic class express the same semantic answer in different styles. The tasks share an underlying semantic rule but differ in their prompt distributions and teachers' stylistic preferences. Using a tractable linear-softmax policy, we derive an exact decomposition of the updates into semantic and style components. We show that, at a common policy and prompt, SFT and RFT have parallel semantic updates but differ in their style dynamics. Starting from a policy with no within-class style preference, RFT with exact policy gradients preserves this symmetry, whereas SFT with a nonuniform teacher develops off-axis style drift along a nonzero task mean under population updates. We use this drift to establish a separation under explicit conditions: for population updates from a common perfectly fitted checkpoint, SFT forgetting admits a strictly positive lower bound over a finite training interval, while RFT retains zero semantic error. Simulations over task sequences support these theoretical predictions.

1 Introduction

Fine-tuning plays a central role in adapting pretrained foundation models to downstream tasks and enhancing their task-specific capabilities (Howard & Ruder, 2018; Devlin et al., 2019; Raffel et al., 2020). For example, instruction tuning on diverse demonstrations improves language models' ability to follow instructions and generalize to unseen tasks (Ouyang et al., 2022; Chung et al., 2024); reward-based fine-tuning improves mathematical and coding performance by optimizing model-generated responses against verifiable outcomes (Shao et al., 2024; Guo et al., 2025). However, as models learn new tasks, they may lose previously acquired capabilities, a phenomenon known as forgetting (Wang et al., 2024; Luo et al., 2025; Chen et al., 2026). Preserving existing capabilities while adapting to new tasks is therefore an important consideration, highlighting the need to understand when and why fine-tuning can degrade them.

Two widely used fine-tuning methods are supervised fine-tuning (SFT), which fits teacher demonstrations, and reinforcement fine-tuning (RFT), which updates the model using rewards for its own sampled responses. Empirical studies find that RFT often preserves existing capabilities better than SFT (Chen et al., 2026; Lai et al., 2026). This gap can arise even with correct supervision:

Chu et al. (2025) observe that SFT on correct expert demonstrations degrades existing performance under input distribution shifts that preserve the task rules, whereas RFT from the same checkpoint improves it. Existing theories offer distributional explanations for such differences. Shenfeld et al. (2026b) identify an implicit bias of online RL toward the solution closest to the initial policy in KL divergence among those that solve the new task. Balasubramanian & Kasiviswanathan (2026) quantify how forward- and reverse-KL objectives affect the preservation of the old-task component in a two-component Gaussian mixture. These accounts, however, leave a specific mechanistic question unanswered: how does fitting a distribution of correct responses induce errors on previously mastered tasks?

The ParityMNIST experiments of Shenfeld et al. (2026b) make this issue concrete: the two SFT baselines, trained on different distributions over equally correct labels, exhibit different retention trade-offs, but both preserve prior-task performance less effectively than RFT. Related language-model studies show that SFT can teach response formats (Zhou et al., 2023), but that imitation can accompany declines in factual accuracy (Gudibande et al., 2024). To understand this phenomenon, we isolate the role of these preferences in a classification case study, separating an answer's semantic content from its particular expression, which we call its style. For example, “4,” “four,” and “The answer is 4” are all correct responses to 2+22 + 2, but a teacher may prefer one expression over the others. In our setting, SFT fits this preference, whereas RFT rewards semantic correctness regardless of style. This distinction motivates our central question:

Can fitting the teacher’s style preference alone cause semantic forgetting, even when every demonstration is correct?

We study this question in a tractable classification model with a linear-softmax policy, where tasks share the same semantic rule but differ in their input distributions and teachers' stylistic preferences. For this policy class, we derive an exact decomposition of the updates into semantic and style components, allowing us to trace how style fitting induces errors on a previously mastered task. Under explicit conditions and population updates, we prove that SFT causes strictly positive semantic forgetting even when every demonstration is correct, whereas RFT preserves zero error.

Our main contributions are:

• An exact decomposition of the update. We split the policy parameters into a semantic channel and a style channel and characterize the update direction in each channel under SFT and RFT. The semantic updates are parallel, whereas the style updates differ: from a policy with no style preference, RFT keeps the style channel exactly zero throughout training, while SFT drifts along the task mean (Theorems 1 and 2).

• A provable population retention gap between SFT and RFT. Starting from a checkpoint that perfectly fits the previous task and has no style preference, we prove a positive lower bound on SFT forgetting under population updates when the next task has a nonzero prompt mean and the teacher's style preference is stronger in one semantic class than in the other, whereas RFT retains perfect semantic accuracy (Theorem 3).

• A finite-sample bound on off-axis energy. On top of the population-level analysis, we account for the additional effects of finite-sample fluctuations on the off-axis parameter energy of SFT and RFT. Our bounds cover both semantic and style components and show that RFT admits a smaller upper bound on the expected off-axis energy than SFT (Theorem 4), and the resulting bounds are consistent with our population-level analysis in the large-sample limit.

Together, these results suggest that fitting a teacher’s style preference is by itself sufficient to cause semantic forgetting under SFT, even when the teacher is always correct, whereas RFT avoids it because learning from its own on-policy samples induces no style drift. In Section 4, we provide empirical evidence for this mechanism by simulating the model over multi-task sequences under population and finite-sample updates; the results illustrate the mechanisms in Theorems 2 and 3 and the finite-sample effects studied in Theorem 4. We also report ablation studies in Appendix E to examine the model's behavior when some of the theoretical conditions are not satisfied.

Additional related work: We provide a detailed discussion of more related work in Appendix A.

References (82)

  • On the theory of policy gradient methods: Optimality, approximation, and distribution shift
  • A quantitative characterization of forgetting in post-training (opens arXiv in a new tab)
  • Riemannian walk for incremental learning: Understanding forgetting and intransigence
  • Efficient lifelong learning with A-GEM
  • Retaining by doing: The role of on-policy data in mitigating forgetting (opens arXiv in a new tab)
  • SFT memorizes, RL generalizes: A comparative study of foundation model post-training
  • Journal of Machine Learning Research, 25(70):1–53, 2024
  • BERT: Pre-training of deep bidirectional transformers for language understanding (opens the publisher in a new tab)
  • Understanding forgetting in continual learning with linear regression
  • Continual learning in linear classification on separable data
  • The false promise of imitating proprietary language models
  • Nature, 645:633–638, 2025 (opens the publisher in a new tab)
  • Universal language model fine-tuning for text classification (opens the publisher in a new tab)
  • Overcoming catastrophic forgetting in neural networks
  • Reinforcement fine-tuning naturally mitigates forgetting in continual post-training (opens arXiv in a new tab)
  • Theory on mixture-of-experts in continual learning
  • Theory on forgetting and generalization of continual learning
  • An empirical study of catastrophic forgetting in large language models during continual fine-tuning (opens arXiv in a new tab)
  • PackNet: Adding multiple tasks to a single network by iterative pruning
  • Improving language understanding by generative pre-training
  • Exploring the limits of transfer learning with a unified text-to-text transformer
  • Experience replay for continual learning
  • DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models
  • Self-distillation enables continual learning (opens arXiv in a new tab)
  • RL's razor: Why online reinforcement learning forgets less
  • Policy gradient methods for reinforcement learning with function approximation
  • A comprehensive survey of continual learning: Theory, method and application (opens arXiv in a new tab)
  • Ronald J. Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine Learning, 8(3–4):229–256, 1992. URL https://doi.org/10.1007/BF00992696. (opens the publisher in a new tab)
  • Continual learning through synaptic intelligence
  • Why reinforcement fine-tuning preserves prior knowledge better: A data perspective
  • LIMA: Less is more for alignment
  • Chu et al. (2025) find better generalization under RL to changes in reasoning rules and visual conditions, while Lai et al. (2026) report less forgetting of earlier tasks and general capabilities under RFT across sequential multimodal tasks
  • Fix a prompt x
  • Decompose $\mathbf{v}$ as
  • Moreover, since $\mathbf{Q}$ is orthogonal and $\mathbf{Q}\mathbf{u} = \mathbf{u}$, we also have $\mathbf{Q}^\top \mathbf{u} = \mathbf{u}$
  • Let $\Phi(\mathbf{W}, \omega)$ denote the updated parameter matrix $\mathbf{W}^{+}$obtained by applying the SFT or RFT update in (6), and let $\Phi_{a}$ denote its ath row
  • Together with the policy invariance, this also gives
  • Together with (B.7) and (B.8), we have
  • Therefore (C.3) becomes the SFT line of (13)
  • Hence (10) implies that $P_1(\mathbf{W}, \mathbf{x}) = (1 + e^{-cz})^{-1}$ and $P_0(\mathbf{W}, \mathbf{x}) = 1 - P_1(\mathbf{W}, \mathbf{x})$
  • Substituting into (C.10) gives the SFT line of (14)
  • Therefore if $a, a'$ lie in the same class
  • Subtracting (C.2) at $b = \sigma(a)$ from (C.1) gives
  • Since $\mathbf{W}$ has identical rows within each class, all rows in the same semantic class have the same logit at every prompt
  • By the teacher model (2), if $b^\star(\mathbf{x}) \neq b$ then the teacher places no mass on token $a \in \mathcal{A}_b$, and both terms inside the brackets have conditional mean zero
  • The event $b^\star = b$ depends only on $z$: it is $\{z > 0\}$ for $b = 1$ and $\{z < 0\}$ for $b = 0$
  • The term proportional to u is removed, while $\mu_t$ is unchanged because $\mu_t \perp u$
  • Since $\beta(\mathbf{W}_1) = \mathbf{0}$, the class-score difference is $D_{\mathbf{W}_1}(\mathbf{x}) = \langle \Delta \boldsymbol{\alpha}(\mathbf{W}_1), \mathbf{x} \rangle$
  • We therefore use these centered weights throughout the proof, so that
  • Both tasks share the semantic rule $b^\star(\mathbf{x}) = \mathbf{1}\{z > 0\}$
  • Thus every RFT iterate $\mathbf{W}$ satisfies
  • We will show that every parameter row remains in $V$ throughout task-2 training
  • Meanwhile, the teacher definition (2) gives
  • Consequently, $q_{2}(a \mid \mathbf{x}) - \pi_{a}$ is a function of $(z, y)$ alone
  • Each updated row therefore remains in $V$
  • For $\mathbf{r} := (z, y)^\top$, each entry of $\Theta_j \mathbf{r}$ is the corresponding token's logit:
  • The left-hand side is zero, so
  • since $\beta(\mathbf{W}_1) = \mathbf{0}$, (16) with $t = 2$ gives, for $a \in \mathcal{A}_b$
  • Using that the initial rows are parallel to $\mathbf{u}$
  • For $a' \in \mathcal{A}_0$, assumption (b) gives $\rho_{2,1}(a^\circ) - \rho_{2,0}(a') \geq \Delta_\rho$
  • By the triangle inequality and (C.24) with $j = k_2$
  • This pointwise conclusion holds under either task distribution, so $\mathcal{L}_r(\mathbf{W}_2) \geq \mathbb{P}_r(E)$ for $r \in \{1, 2\}$
  • For either method, let $\mathcal{F}_s$ denote its training history strictly before step $s$, including the previous teacher draws for SFT. For the trajectory under consideration, write $\mathbf{W}_s := \mathbf{W}(s)$ and $\mathbf{m}_s := \boldsymbol{\mu}_{t(s)}$
  • Consequently, for each class
  • We first prove part (ii)
  • The fresh teacher draw therefore satisfies
  • Since $P_0 = 1 - P_1$, either value of the correct class satisfies
  • Using (C.53) then gives
  • Expanding the second line of (C.52), taking conditional expectations, and using $\varepsilon_{s}^{2}=1$ gives
  • Taking expectations and summing (C.56) from $s = 0$ to $N - 1$, with $\mathbf{v}_0 = \mathbf{0}$, yields
  • Both parts include N = 0, with empty sums and zero initial energy
  • Since $\mathbb{E}_A[R(A, \mathbf{x})\mathbf{1}\{a = A\}] = \pi_{\mathbf{W}}(a \mid \mathbf{x})R(a, \mathbf{x})$, we have
  • Since the conditional mean increment is zero when $\beta = \mathbf{0}$, (D.4) is also the total conditional variance
  • If each update averages $K$ independent action-gradient estimates computed at the same $\mathbf{W}, \mathbf{x}$, its conditional mean is the RFT update in (6), while the variance in (D.4) is divided by $K$
  • For $a \in \mathcal{A}_b$, write $\pi_{\mathbf{W}}(a \mid \mathbf{x}, b) := \pi_{\mathbf{W}}(a \mid \mathbf{x}) / P_b(\mathbf{W}, \mathbf{x})$
  • We claim that $f_{2,*} = S_{2,*}$
  • Dominated convergence yields $C_2(\mathbf{W}^{[s]}) \to 0$, hence $f_{2,*} \leq S_2(\boldsymbol{\beta})$ for every finite style channel
  • Writing $\delta = \mu_1 - \mu_2$, the density ratio of their prompt distributions is
  • Equations (D.9) and (D.10) now imply (D.6)
  • Unless specified below, all settings follow Section 4
  • Unless specified otherwise, we follow the setup of Section 4
  • Across the tested noise levels, MC RFT exhibits little forgetting, while token flips induce more forgetting than class flips in finite-sample runs (Figure E.4(a,c))