Finetuning with Sampling: Make SFT Generalize, Not Forget

Aayush Karan, Sitan Chen, Yilun DuNeurIPS 2026

TL;DR

In LLM post-training, conventional wisdom says Supervised Finetuning (SFT) memorizes and forgets, while Reinforcement Learning (RL) generalizes and retains prior skills. This paper flips that script by showing the problem isn't SFT itself, but the alienness of the expert training data. By using a clever sampling algorithm to translate external expert solutions into a model's own natural "voice" before training, plain old SFT can actually outperform modern RL—generalizing better and forgetting less.

What Problem Does This Paper Address?

Teaching a pretrained LLM a brand-new skill without lobotomizing its existing knowledge is a delicate balancing act. Today, we rely on two main paradigms:

  1. Reinforcement Learning (RL): Because RL is on-policy (the model learns from its own trial-and-error generations), updates stay close to the model’s original distribution. It generalizes well and avoids "catastrophic forgetting." The catch? If a task is so hard that the model never stumbles upon a right answer on its own, there is zero reward signal and zero learning.
  2. Supervised Finetuning (SFT): SFT is off-policy, forcing the model to imitate external expert demonstrations (like human or GPT-5 traces). It provides rich learning signals on impossible tasks, but forcing a model to mimic an unnatural distribution triggers drastic weight updates, leading to brittle memorization and severe forgetting.

Rather than inventing a complex new hybrid training loss, the authors ask a refreshingly simple question: What if we keep standard SFT, and instead reshape the expert data so it looks like something the base model would have written itself?

Methods

The authors formalize their goal via information projection: finding a data distribution that preserves the factual or logical correctness of the expert trace while minimizing the distributional distance (KL divergence) to the base model.

To sample from this idealized distribution, they introduce Projection Sampling, an offline data-preparation step powered by the classic Metropolis-Hastings (MH) Markov Chain Monte Carlo (MCMC) algorithm:

  • Information-Preserving Proposals: Starting with an off-policy expert trace, the algorithm picks a random point to truncate the text. It feeds the question, the full expert solution, and the truncated partial trace into the base model, prompting it to continue the thought in its own words while staying logically faithful to the expert answer.
  • Accept/Reject: The newly generated candidate is scored based on how natural (high-likelihood) it looks to the unprompted base model. Higher-likelihood, correct rewrites are accepted; unnatural ones are rejected.
  • Block-wise Scaling: Because resampling thousand-token sequences from scratch mixes way too slowly, the authors run this MH loop sequentially in small chunks (blocks of 32 tokens) to progressively build out a high-likelihood trace.

Once the dataset is "boosted" via this one-time compute cost, the model is trained using completely standard cross-entropy SFT.

Datasets

The authors evaluate both new task acquisition and prior capability retention across three domains (using existing benchmarks paired with dataset-inherent or GPT-5-generated expert traces; no new benchmarks are introduced):

  • Training / New Task Domains: Chemistry reasoning, Math (MATH levels 3–5), and Medical question-answering.
  • Evaluation & Retention Benchmarks: MMLU, GPQA, AMC, MATH500, and GSM8K.

Key Insights and Ideas

  • SFT isn't broken; off-policy data is: Standard zero-shot "rewriting" of data helps a little, but iteratively nudging token likelihoods via MCMC makes a massive difference. Furthermore, this data shaping is strictly model-specific—training Qwen on data boosted for Olmo tanks performance.
  • Learning beyond "sharpening": A common critique of on-policy methods is that they merely amplify answers the base model already knew deep down. By looking at pass@k accuracy (giving the model up to 64 tries), the authors show their SFT model solves hard chemistry problems where the base model gets 0/64—jumping from a 0% pass rate up to 67.2%. It genuinely learns new skills.

Key Results

Across Qwen2.5 (3B, 7B-Instruct) and Olmo-3 (7B-Instruct), Projection Sampling transforms SFT into a powerhouse that rivals or beats strong on-policy RL (GRPO, UFT) and self-distillation (OPSD) baselines.

Performance on Chemistry and Prior Capabilities for Qwen2.5-7B-Instruct
  • Chemistry (Qwen2.5-7B-Instruct): Base accuracy jumps from 34.3% to 66.0%, beating both vanilla SFT (61.8%) and on-policy distillation OPSD (61.8%). Meanwhile, average prior task performance barely budges (dropping just 1.1% from 59.7% to 58.6%, compared to vanilla SFT's drop to 52.0%).
Performance on Math Reasoning and Prior Capabilities for Qwen2.5-3B
  • Math Reasoning (Qwen2.5-3B): While vanilla SFT actually degrades math performance across the board, Sampling SFT boosts MATH(3,4,5) to 48.3% (beating GRPO at 45.7%) and skyrockets out-of-distribution MATH500 accuracy from 24.5% to 56.3%—surpassing GRPO (31.3%) by 25 percentage points.
  • Medical QA (Qwen2.5-7B-Instruct): Achieves competitive task accuracy (45.8%) while recovering a massive 16.3% loss in prior capabilities suffered by vanilla SFT (retaining 51.6% vs. vanilla SFT's 35.3%).

Limitations and Future Work

  • Limitations: While Projection Sampling avoids inference-time latency, it introduces an upfront, offline token generation cost that scales quadratically with sequence length ($O(T^2/B)$). Additionally, the proposal step relies on the base model already possessing decent in-context instruction-following abilities so it doesn't corrupt the expert answer during rewriting.
  • Future Work: The authors envision MCMC sampling as a universal post-training primitive beyond SFT—such as smoothing out teacher distributions in self-distillation so students can learn more stably, or simulating high-likelihood rollouts to kickstart RL on impossibly hard tasks where reward signals are otherwise dead flat.

Summary updated

Abstract

Introducing new capabilities to frontier models has long been the goal for posttraining, which relies predominantly on supervised finetuning (SFT) and reinforcement learning (RL) to achieve this. Prevailing wisdom dictates that on-policy RL enables strong generalization on new tasks without losing existing capabilities, while SFT is prone to weak generalization and forgetting. At the same time, SFT enables learning from inherently off-policy expert data, whereas RL must rely on a model's ability to generate positive signal on a new task. In our work, we seek to bridge the strength of on-policy learning with the information signal of off-policy expert traces. To this end, we introduce a Markov chain Monte Carlo (MCMC) sampling algorithm that transforms off-policy traces into more on-policy ones given a reference model for finetuning. Across tasks like scientific skill acquisition, mathematical reasoning, and fact learning, we demonstrate that simple SFT on these boosted off-policy traces can generalize better and forget less than on-policy counterparts. More generally, our approach outlines a principled methodology for model-specific data refinement, suggesting broader utility as a plug-and-play component throughout the post-training pipeline.
BibTeX
@inproceedings{karan2026finetuning,
  author = {Aayush Karan and Sitan Chen and Yilun Du},
  title = {{Finetuning with Sampling: Make SFT Generalize, Not Forget}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=kXgdaUrvBN},
}
Figure