Paper walkthrough
SDFT uses a demonstration-conditioned version of itself as teacher, turning expert demonstrations into on-policy signals. It learns new tasks while forgetting much less than SFT.
Idan Shenfeld, Mehul Damani, Jonas Hübotter, Pulkit Agrawal · MIT, Improbable AI Lab, ETH Zurich
arXiv 2601.19897v2 (2026-08-07) · Code: github.com/Continual-Intelligence/Self-Distillation
With demonstrations alone, the default is SFT, an off-policy method.
Question: How can we learn on-policy from demonstrations alone?
Left: SDFT pipeline. Right: demonstration conditioning stays closer to the base distribution at the same new-task accuracy.
Sees only query $x$ and samples $y\sim\pi_\theta(\cdot\mid x)$. All training trajectories come from this mode: on-policy.
The same model (EMA weights) also sees demonstration $c$, producing $\pi(\cdot\mid y_{\lt t},x,c)$ at each student-generated position.
KL to base: teacher 0.68 nats, SFT 1.26 nats, at the same new-task accuracy.
The teacher also sees the demonstration; the student sees only the query and generates training trajectories.
The authors find this prompt prevents copying $c$ verbatim: the teacher generates its own response, reflecting its understanding of the demonstration's intent.
Sample $y$ from the student and minimize student-to-teacher KL:
Step 1: differentiate (1). $\theta$ appears in both the sampling distribution and the log ratio. The score-function identity $\nabla\pi_\theta=\pi_\theta\nabla\log\pi_\theta$ handles the former; the latter contributes $\mathbb{E}_{y\sim\pi_\theta}[\nabla_\theta\log\pi_\theta(y\mid x)]=0$:
Step 2: approximate per token. $\log\pi(y\mid x)=\sum_t\log\pi(y_t\mid y_{\lt t},x)$. At each position the paper keeps only that position's KL, summed exactly over the vocabulary $\mathcal{V}$ (the analytic per-token estimator):
(2) is not (2a): it drops how $y_t$ changes the ratios of later tokens, which amounts to minimizing $\sum_t D_{\mathrm{KL}}$ on fixed student prefixes. This is the sequence-level bias noted in Appendix A.1.
Each choice is either ablated in the appendix or used by default in the main experiments.
Students may learn teacher phrases such as "Based on the text…". Masking loss on the first few tokens removes these without harming accuracy.
Under an assumption, self-distillation is equivalent to on-policy RL with rewards supplied by the model's own ICL.
This equivalence concerns reverse KL. Experiments use forward KL, so the IRL argument motivates the method rather than exactly describing the implemented loss.
The paper gives no forgetting bound. Its argument has three links; only the first is rigorous mathematics.
"High reward, but not far from $\pi_k$" can be written two ways. Equation (3) puts a price $\beta$ on change. Alternatively, set a passing mark $v$ for reward and pick the passing policy that changes least:
With $v=\mathbb{E}_{\pi^*_{k+1}}[r]$, the reward of Equation (3)'s optimum $\pi^*_{k+1}=\pi_k\,e^{r/\beta}/Z$ (normalizer $Z=\sum_y\pi_k(y\mid x)\,e^{r(y,x)/\beta}$), both give the same answer. Taking logs gives $\log\frac{\pi^*_{k+1}}{\pi_k}=\frac{r}{\beta}-\log Z$. For any $\pi$:
At $\pi=\pi^*_{k+1}$ the first term is 0, so $D_{\mathrm{KL}}(\pi^*_{k+1}\,\|\,\pi_k)=v/\beta-\log Z$. A passing $\pi$ has $\mathbb{E}_\pi[r]\ge v$, so $D_{\mathrm{KL}}(\pi\,\|\,\pi_k)\ge 0+v/\beta-\log Z=D_{\mathrm{KL}}(\pi^*_{k+1}\,\|\,\pi_k)$, with equality only at $\pi=\pi^*_{k+1}$: among policies reaching the same reward, $\pi^*_{k+1}$ is closest to $\pi_k$ (the standard I-projection result).
Qwen2.5-7B-Instruct on ToolAlpaca: produce a correct tool call from an API description and user request.
Axis: 0–1.5 nats.
The third link relies on prior empirical findings; the derivation also differs from actual training.
Prior work (Shenfeld et al. 2025; Chen et al. 2025) finds forgetting increases with KL between the fine-tuned and base policies on new-task inputs,
and on-policy training tends to select smaller-KL solutions, whereas SFT does not.
This is a correlation, not a theorem; the paper cites it without re-deriving it.
SFT increases expert-token probability on expert prefixes:
When $\pi_\theta(y^\star_t\mid\cdot)$ is small, the gradient moves substantial probability mass; parameter changes can affect unrelated inputs too.
SDFT matches $\pi(\cdot\mid y_{\lt t},x,c)$ on student prefixes $y\sim\pi_\theta$: the target is already near the model's distribution, requiring less change.
Two kinds of post-training adaptation: acquiring skills and absorbing new facts.
Tasks the model was not specifically tuned for (unlike math and code).
Average over HellaSwag, TruthfulQA, MMLU, IFEval, Winogrande, and HumanEval (lm-eval-harness), measuring forgetting.
Full fine-tuning with TRL on one H200. Tune learning rate, batch size, and epochs separately for each method; select the best validation checkpoint. Greedy decoding, 3 seeds. SDFT max generation length 2048 (skills) or 1024 (knowledge).
On all three tasks, only SDFT improves the new task without a substantial decline in prior capabilities.
Prior benchmark scores after each training task. Red = a drop of more than 5 points from base.
| Training task → method | New task | HellaSwag | HumanEval | IFEval | MMLU | TruthfulQA | Winogrande | Average |
|---|---|---|---|---|---|---|---|---|
| Base (Qwen2.5-7B-Instruct) | — | 62.0 | 65.8 | 74.3 | 71.7 | 47.9 | 71.1 | 65.5 |
| Science Q&A (base 32.1) | ||||||||
| SFT | 66.2 | 55.0 | 54.8 | 35.3 | 64.6 | 36.8 | 73.7 | 53.4 |
| SFT + re-invoke | 66.0 | 61.6 | 63.4 | 52.9 | 68.7 | 45.2 | 70.0 | 60.2 |
| DFT | 54.8 | 57.6 | 67.0 | 60.4 | 69.4 | 38.8 | 68.2 | 60.2 |
| SDFT | 70.2 | 60.9 | 68.9 | 66.8 | 70.7 | 46.5 | 73.1 | 64.5 |
| Tool Use (base 42.9) | ||||||||
| SFT | 63.2 | 57.3 | 50.0 | 49.8 | 70.2 | 37.5 | 73.1 | 56.0 |
| SFT + re-invoke | 63.1 | 61.7 | 68.9 | 59.1 | 71.5 | 49.1 | 71.6 | 63.7 |
| DFT | 64.2 | 59.7 | 61.4 | 60.2 | 71.6 | 40.2 | 71.5 | 60.8 |
| SDFT | 70.6 | 61.6 | 68.3 | 71.9 | 71.5 | 47.3 | 71.7 | 65.4 |
| Medical (base 30.1) | ||||||||
| SFT | 35.5 | 59.5 | 62.1 | 56.6 | 70.5 | 39.8 | 72.9 | 60.2 |
| SFT + re-invoke | 35.6 | 61.5 | 63.1 | 67.6 | 70.0 | 42.3 | 71.4 | 62.6 |
| DFT | 36.2 | 61.9 | 64.6 | 74.6 | 71.6 | 40.1 | 71.3 | 64.0 |
| SDFT | 40.2 | 61.4 | 67.7 | 72.3 | 71.5 | 47.3 | 71.9 | 65.4 |
Train one model on Tool Use → Science Q&A → Medical. Normalize each task: 0 = base, 1 = best accuracy achieved by either method.
Only curves are given, without stage-end tables; shading shows variation across seeds. Normalization sets 1 to the best score across both methods, so heights are comparable only within each task.
Scaling on Science Q&A; pass@k on Tool Use (temperature 1.0, top-p 0.95).
Axis: −14 to +14; vertical line = 0. The text reports only differences.
The base lacks these 2025 facts; SDFT absorbs them in a way that transfers to indirect questions.
| Method | Strict | Lenient | OOD |
|---|---|---|---|
| Base | 0 | 0 | 0 |
| Continual pretraining (CPT) on articles | 9 | 37 | 7 |
| SFT on question-answer pairs | 80 | 95 | 80 |
| SDFT | 89 | 100 | 98 |
| Oracle RAG (upper-bound reference) | 91 | 100 | 100 |
SFT on short answers suppresses long CoT. SDFT's teacher is the same reasoning model, preserving its reasoning style in the target distribution.
Axis: 0–100.
Axis: 0–5000 tokens.
In §5 the authors say converting a non-reasoning model to explicit CoT is difficult. SDFT can preserve a generation style, but cannot create a new one.
Figure 6 compares three uses of the same conditioned teacher; Figure 8 compares teacher weights. Both use Tool Use.
| Factor | Finding |
|---|---|
| Training distribution | on-policy > two offline variants > SFT |
| Teacher weights | EMA > frozen base; current student diverges |
| Teacher context | articles + answers 89 > articles 75 > answers 37 |
| KL estimator | analytic per-token best; no Rao-Blackwellized gain |
| Rollouts per query | 1 is enough |
| KL direction | forward KL best (used for all results) |
| Model scale | 3B −3.3;7B +4.0;14B +6.9 |
| Epochs | SDFT 2 (skills) / 4 (knowledge); SFT no gain beyond 1 |
Figures 6 and 8 contain curves only (accuracy axis 35–70), without final numeric values.
SDFT complements on-policy RL when demonstrations are available but rewards are not.
These final two slides are our assessment, rather than the paper's statements.
SDFT enables on-policy learning from demonstrations without rewards: on its own rollouts, the student distills from the same model (EMA weights) conditioned on demonstrations. On Qwen2.5-7B skill and knowledge tasks, it outperforms SFT on new tasks while largely retaining prior capabilities.
Each point cites a specific section of the paper.
Left: the argument's core limitations. Right: directions worth testing.