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

Yong-Liang Wu, Yi-Zhou Zhou, Zi-Heng Zhou, Yingzhe Peng, Xinyu Ye, Xinting Hu, Wen-Bo Zhu, Lu Qi, Ming-Hsuan Yang, Xu Yang

arXiv:2508.05629 · 2026-11-08 공개 · arXiv · PDF

reinforcement-learning large-language-models code-generation supervised-fine-tuning generalization math-reasoning offline-rl gradient-stabilization

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.

한국어 요약

한 줄 요약

Dynamic Fine-Tuning(DFT)은 SFT의 일반화 문제를 RL 관점에서 분석하고, 단일 라인 코드 변경으로 성능을 크게 향상시킨다.

핵심 기여도

핵심 아이디어

SFT는 전문가 데이터셋에 기반한 모델 학습 방식이지만, 기울기 업데이트가 **정책 기울기**(policy gradient)의 특수한 형태로, **역확률**(inverse probability)에 비례하는 **불안정한 보상 구조**를 내재적으로 포함한다는 점이 핵심 문제였다. 이는 특히 전문가 행동에 낮은 확률을 부여할 때 **무한 분산**(unbounded variance)을 유발하여 일반화 능력을 저하시킨다. 이를 해결하기 위해 DFT는 **토큰 확률로 손실을 재가중치**(rescaling)함으로써, **역확률 가중치를 제거**하고 **안정적, 균일한 업데이트**를 가능하게 한다. 이는 수학적으로 **정책 기울기 추정기**(gradient estimator)를 안정화하고, 훈련 후 **토큰 분포가 훈련셋에서 일부 멀어지는 현상**을 유도하며, 이는 과적합을 줄이고 일반화를 향상시킨다.

기술적 접근법

주요 결과

의의 및 한계

이 연구는 SFT가 **정책 기울기의 특수한 형태**로, **역확률 가중치**를 내재적으로 포함한다는 새로운 이론적 통찰을 제시하며, 이를 기반으로 **단일 라인 코드 변경**으로 **강력한 일반화 능력을 달성**하는 DFT를 제안함으로써 SFT의 한계를 극복했다. 특히, DFT는 **RL과 동일한 성능을 제공하면서도 복잡한 보상 모델링이나 환경 상호작용 없이도 학습 가능**하다는 점에서 실용적 가치가 높다. 그러나 DFT는 **온라인 RL 환경**에서는 **완전한 대체**가 되지 못하며, **복잡한 보상 구조**가 필요한 경우 여전히 RL이 필요할 수 있다.

실용적 활용

DFT는 **수학적 추론**, **코드 생성**, **멀티모달 작업** 등 다양한 LLM 작업에서 적용 가능하며, **오프라인 RL 환경**에서도 기존 RL 알고리즘 대비 **낮은 계산 비용**으로 **유사한 성능**을 제공하므로, **보상 모델링이 어려운 실제 산업 환경**에서 유용하게 활용될 수 있다.