On the Generalization of SFT: A Reinforcement Learning Perspective with Reward Rectification

Yongliang Wu, Yizhou Zhou, Zhou Ziheng, Yingzhe Peng, Xinyu Ye, Xinting Hu, Wenbo Zhu, Lu Qi, Ming-Hsuan Yang, Xu Yang

TL;DR

Supervised Fine-Tuning (SFT) often suffers from limited generalization and a tendency to memorize training data compared to Reinforcement Learning (RL). This paper reveals that standard SFT gradients implicitly encode a problematic, exploding reward structure for low-probability tokens. By introducing Dynamic Fine-Tuning (DFT)—a simple, one-line code change that rescales the loss function by the model's own token probabilities—the authors stabilize training and dramatically improve generalization across math, code, and multimodal tasks.

What Problem Does This Paper Address?

While SFT is the standard paradigm for adapting Large Language Models (LLMs) to expert demonstrations, it famously "memorizes" while RL "generalizes." RL achieves better generalization by using explicit reward signals to explore diverse strategies, but it is computationally expensive, hyperparameter-sensitive, and requires negative samples or reward models that aren't always available.

The authors tackle a fundamental question: Can we fix SFT's generalization problem directly within its native, positive-only data setting?

By analyzing SFT through an RL lens, they discover that SFT's gradient update behaves like an on-policy gradient method with an implicit reward. Crucially, this implicit reward is inversely proportional to the model's probability of expert actions ($1/\pi_\theta$). When the model assigns a low probability to a token, the gradient becomes excessively large. This creates an unstable, ill-posed reward landscape that forces the model to overfit to rare exact-match tokens rather than learning broader underlying patterns.

Methods

The authors propose Dynamic Fine-Tuning (DFT) to neutralize this gradient distortion.

Instead of treating every token's cross-entropy loss equally, DFT dynamically reweights the loss at each token by multiplying it by that token's current probability:

$$\mathcal{L}_{\text{DFT}}(\theta) = \mathbb{E}_{(x,y^\star)\sim\mathcal{D}}\left[ -\sum_{t=1}^{|y^\star|} \text{sg}\left(\pi_\theta(y^\star_t \mid y^\star_{<t}, x)\right) \log \pi_\theta(y^\star_t \mid y^\star_{<t}, x) \right]$$

where $\text{sg}(\cdot)$ is the stop-gradient operator.

This simple multiplication cancels out the problematic $1/\pi_\theta$ term in the gradient. From an RL perspective, this transforms the objective into a verification-style framework where every correct expert trajectory receives a uniform reward of 1. Optimization becomes significantly more stable because the model no longer aggressively over-corrects on unlikely tokens.

Interestingly, this approach inverts the philosophy of the popular Focal Loss used in traditional deep learning. While Focal Loss purposely upweights hard, poorly classified examples to combat underfitting, DFT downweights poorly classified tokens to combat overfitting and memorization—reflecting a paradigm shift necessary for modern LLMs.

Datasets

The method was validated across several diverse training sets and evaluated on standard hard benchmarks:

  • Mathematical Reasoning: Trained on subsets of NuminaMath-CoT and OpenR1-Math-220k. Evaluated on Math500, Minerva Math, OlympiadBench, AIME 2024, and AMC 2023.
  • Code Generation: Trained on UltraFeedback. Evaluated on HumanEval, HumanEval+, and MultiPL-E across multiple programming languages.
  • Multimodal Reasoning: Trained on WeThink. Evaluated on MathVerse, MathVision, and WeMath.
  • Factual Knowledge: Evaluated using the Natural Questions dataset to probe limitations.

Key Insights and Ideas

  • The Bimodal Polarizing Effect: Analysis of token probabilities reveals that standard SFT uniformly pushes all token probabilities higher. In contrast, DFT exhibits a polarizing effect, creating a bimodal distribution where some tokens are boosted and others are actively suppressed (see Figure 2).
  • Deprioritizing Filler Words: When looking closely at the suppressed low-probability bins under DFT, the authors found they primarily contained grammatical and connective tokens (e.g., "the", "let", commas, periods). DFT essentially tells the model to stop stressing over filler words and focus its capacity on primary semantic concepts, mimicking effective human pedagogy.
  • Implicit RL without the Overhead: DFT acts as a streamlined alternative to offline RL pipelines. It achieves the stability and generalization benefits of uniform-reward RL without needing a reference model, a reward model, or massive batch sizes.
Token probability distribution showing DFT's polarizing bimodal effect compared to SFT and other RL methods.

Key Results

  • Massive Math Gains & Faster Convergence: For the Qwen2.5-Math-1.5B model, DFT achieved an average accuracy gain of +15.66 points over the base model, vastly outperforming standard SFT's modest +2.09 improvement. Furthermore, DFT typically beat SFT's final accuracy within the first 10–20 training steps (see Figure 1).
  • Resilience on Ultra-Hard Tasks: On the punishing OlympiadBench, standard SFT actually degraded the base Qwen model's performance (dropping from 15.88 to 12.63). DFT reversed this trend, boosting accuracy to 27.08.
  • Outperforming Offline and Online RL: In exploratory offline RL settings, DFT achieved an average score of 35.43, handily beating offline baselines like DPO (23.20) and RFT (23.97), and even outperforming the popular online algorithm GRPO (32.00).
Accuracy progression across mathematical benchmarks, illustrating faster convergence and superior performance achieved by DFT relative to SFT.

Limitations and Future Work

Despite its strengths in reasoning tasks, DFT has a notable blind spot: factual knowledge acquisition.

When tested on the Natural Questions dataset, standard SFT improved accuracy from 31.24% to 36.62%, while DFT actually reduced it to 30.14%. Because DFT weights updates based on the model's current confidence, it inherently reinforces existing beliefs. If a model completely lacks a piece of factual knowledge, DFT effectively suppresses the training signal required to learn it.

Consequently, the authors note that DFT is best suited for tasks aligning with a model's prior competence (like logical reasoning or code structure) rather than memorizing raw new facts. Future work includes exploring quality-aware or non-uniform reward assignments to better handle underrepresented or highly complex training samples.

Summary updated

Abstract

In this work, we present a simple yet theoretically motivated improvement to Supervised Fine-Tuning (SFT) for the Large Language Model (LLM), addressing its limited generalization compared to reinforcement learning (RL). Through mathematical analysis, we reveal that standard SFT gradients implicitly encode a problematic reward structure that may severely restrict the generalization capabilities of model compared to RL. To rectify this, we propose Dynamic Fine-Tuning (\model), stabilizing gradient updates for each token by dynamically rescaling the objective function with the probability of this token. With just a single-line change, the method outperforms standard SFT on multiple difficult benchmarks and base models, from math reasoning to code generation and multi-modal tasks, demonstrating improved generalization. Additionally, \model~achieves competitive results in offline RL settings, providing an effective yet streamlined alternative. By bridging theoretical insights with practical solutions, this work advances the state of SFT. The source code will be available at https://github.com/yongliang-wu/DFT.
BibTeX
@inproceedings{wu2026generalization,
  author = {Yongliang Wu and Yizhou Zhou and Zhou Ziheng and Yingzhe Peng and Xinyu Ye and Xinting Hu and Wenbo Zhu and Lu Qi and Ming-Hsuan Yang and Xu Yang},
  title = {{On the Generalization of SFT: A Reinforcement Learning Perspective with Reward Rectification}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=Lv7PjbcaMi},
}
Figure