Skip to content

Self-Distillation Enables Continual Learning (SDFT)

optionalextendedfrontierpaperrubric 8/122026 · ~20 min

Idan Shenfeld, Mehul Damani, Jonas Hübotter, Pulkit Agrawal

Status

TL;DR. Fine-tuning on demonstrations (SFT) teaches a new skill but erodes old ones. SDFT replaces the SFT target with the model itself conditioned on the demonstration: the teacher is π(⋅∣x,c)\pi(\cdot\mid x, c) and the student is πθ(⋅∣x)\pi_\theta(\cdot\mid x). The student is trained on its own samples to match that teacher. New tasks are learned about as well as with SFT, and much less is forgotten.

Teacher prompt (paraphrased): the question, then a demonstration framed as “an example for a response”, then an instruction to answer with a response of its own. The student samples y∼πθ(⋅∣x)y \sim \pi_\theta(\cdot\mid x) and is updated to reduce the divergence to the teacher on those tokens. The theory points to reverse KL; in practice the authors found forward KL worked best and used an EMA of the student weights as the teacher.

Inverse-RL view (§3.1). The trust-region RL update has optimum πk+1∗(y∣x)∝πk(y∣x)exp⁡(r/β)\pi^\ast_{k+1}(y\mid x) \propto \pi_k(y\mid x)\exp(r/\beta). Assume the in-context model approximates that optimum, πk+1∗(y∣x)≈π(y∣x,c)\pi^\ast_{k+1}(y\mid x)\approx\pi(y\mid x,c). The implicit reward is then

r(y,x,c)=log⁡π(y∣x,c)−log⁡πk(y∣x),r(y,x,c) = \log\pi(y\mid x,c) - \log\pi_k(y\mid x),

and on-policy policy gradient on it is reverse-KL distillation toward the teacher. In words: SDFT is RL, with a reward defined by how much a demonstration changes the model’s own beliefs.

The main model is Qwen2.5-7B-Instruct on three skill tasks: science Q&A (SciKnowEval Chemistry L-3), ToolAlpaca tool use, and medical QA. SDFT is Pareto-better than SFT, DFT and the SFT + “re-invoke” recovery baseline on the new-task vs prior-task trade-off. In a sequential setting it accumulates several skills without regression, and its pass@k gains persist up to k = 128.

For knowledge injection, the model learns 2025 natural-disaster articles (~200K tokens). Strict / lenient / out-of-distribution accuracy: SDFT 89 / 100 / 98, SFT 80 / 95 / 80, CPT 9 / 37 / 7, with Oracle RAG at 91 / 100 / 100.

On Olmo-3-7B-Think trained on answer-only medical data, SDFT reaches 43.7% vs 23.5% for SFT and 31.2% for the base model, keeping long reasoning (4,180 vs 3,273 tokens for SFT). Costs are about 2.5× FLOPs and 4× wall-clock vs SFT, with one generation per prompt.

  • Same trick, different context: OPSD conditions on a reference solution for reasoning, and π-Distill on agent tool traces (and trains the teacher).
  • Before: On-Policy Distillation, whose personalisation section restores chat behaviour after domain mid-training with a teacher that is the model’s earlier self. DPO uses the same tilted-distribution algebra to turn a policy ratio into a reward.
  • Contrast: SEAL also targets continual adaptation, but by RL-training the model to write its own fine-tuning data. It inherits SFT’s forgetting.

Questions to think through

These questions have no single right answer. Write or say your answer before you open the hints. Mark a question once you could defend your answer in a reading group.

  1. Derive / compute

    Starting from the trust-region RL update π_(k+1) = argmax over π of E_(y~π)[r(y,x)] − β·KL(π(·|x) ‖ π_k(·|x)), derive the implicit reward SDFT optimises, state the in-context assumption that makes it computable, and show why a policy-gradient step on that reward matches the gradient of the reverse KL to the demonstration-conditioned teacher.

    What a strong answer covers
    • The optimum is the tilted distribution π*_(k+1)(y|x) ∝ π_k(y|x)·exp(r(y,x)/β). Rearranged: r(y,x) = β[log π*_(k+1)(y|x) − log π_k(y|x)] + C.
    • In-context assumption: the model conditioned on a demonstration c approximates the next optimal policy, π*_(k+1)(y|x) ≈ π(y|x,c). Dropping β and C gives r(y,x,c) = log π(y|x,c) − log π_k(y|x).
    • On-policy samples y ~ π_θ(·|x) with π_k = π_θ (current policy) give E[r] = −KL(π_θ(·|x) ‖ π(·|x,c)) up to the stop-gradient on the teacher, so maximising the implicit reward is minimising reverse KL to the teacher.
    • The per-token rewards log π(y_t|…,c) − log π_θ(y_t|…) sum to the sequence reward, giving dense credit assignment. This is the same form as the on-policy distillation advantage.
  2. Mechanism

    Why does SDFT forget less than SFT on the same demonstrations? Use the paper's §3.2 diagnostics (the demonstration-conditioned teacher scores 100% on ToolAlpaca vs 42% for the base model; KL to the base model is 0.68 nats for the teacher vs 1.26 for an SFT model) in your answer.

    What a strong answer covers
    • SFT fits an off-policy target, the expert's exact tokens, which may be far from the model's own distribution. Large updates on unfamiliar text move shared weights and overwrite other skills.
    • SDFT's target is the model's own distribution shifted by a demonstration in context. It is closer to the base model (0.68 vs 1.26 nats), so each update is a smaller move.
    • The teacher is still competent (100% on ToolAlpaca where the base gets 42%), so staying close does not mean learning nothing.
    • Training is on the student's own samples, so updates focus on states the model actually visits. That is the on-policy argument from GKD and on-policy distillation applied to continual learning.
  3. Critique

    SDFT relies on the base model's in-context learning to produce a good teacher. Using the paper's own scale and Olmo results plus its stated limitations, describe when SDFT should not be expected to work, and one failure mode that leaks from the teacher into the student.

    What a strong answer covers
    • Scale: at 3B, SDFT trails SFT. The margin over SFT is +4 at 7B and +7 at 14B, so small models with weak in-context learning give poor teachers.
    • Large behaviour shifts are hard: the authors found that turning a non-reasoning model into a CoT reasoner was difficult, because the teacher is only a small shift of the student.
    • Artifact leakage: the teacher sees the demonstration and may begin "Based on the text…", and the student copies these markers. Masking the loss on the first few tokens is a heuristic fix.
    • Cost: about 2.5× FLOPs and 4× wall-clock vs SFT, which the authors argue is offset when compared with multi-stage SFT + recovery pipelines.

Done with this page?

Status