Retrieved article excerpt
Open article · Retrieved 2026-11-12T20:22:53.240719+00:00
Language models are routinely asked about things they never saw during pretraining: the internal documents of a company, events that happened after the training cutoff, or the vocabulary of a specialized field. The standard answer is to put the relevant text in the prompt. This works, but the document has to be processed again on every query, it competes for limited context, and models do not always make good use of evidence that is in their context.
[Lost in the Middle: How Language Models Use Long Contexts](https://arxiv.org/abs/2307.03172) (Liu et al., 2024) When the same knowledge is needed repeatedly, it is more economical to train it into the weights once.
Self-distillation does this without labels or a larger model. The model is given the document and acts as a teacher; the same model without the document is the student, and it is trained to reproduce the teacher's next-token distributions.
[Learning by Distilling Context](https://arxiv.org/abs/2209.15189) (Snell, Klein and Zhong, 2022) Existing methods differ mainly in who generates the text the student is trained on. Off-policy methods train on text written by the teacher,
[Efficient Knowledge Injection in LLMs via Self-Distillation](https://arxiv.org/abs/2412.14964) (Kujanpää, Marttinen, Valpola and Ilin, 2025) while on-policy methods such as SDFT let the student write and use the teacher only to score each token.
[Self-Distillation Enables Continual Learning](https://arxiv.org/abs/2601.19897) (Shenfeld, Damani, Hübotter and Agrawal, 2026) In standard teacher–student distillation, Speculative Knowledge Distillation (SKD) mixes the two inside a single sequence, letting the teacher replace student tokens that it considers unlikely.
[Speculative Knowledge Distillation: Bridging the Teacher-Student Gap Through Interleaved Sampling](https://arxiv.org/abs/2410.11325) (Xu et al., 2025) We bring this per-token view to self-distillation. In **Speculative Self-Distillation (SSD)** the student writes by default and the teacher takes over only at tokens where the document changes the prediction. On three knowledge-acquisition tasks, SSD nearly matches the accuracy of on-policy self-distillation with 38–69% fewer supervised tokens, and it forgets less of the model's general ability.
Off-policy · τ → 0SSD · τ = 0.3On-policy · τ → ∞
CTeacherπT( · | x, C)reads the documentStudentπθ( · | x)same model, closed-book“Tell me about the marketing team of the company.”xxdivergence per positionδₜτ → 0Accordingtothememo,LinaOkaforleadsateamof12.Teacher next-tokenAccordingLinaTheStudent next-tokenTheMarketingOurTeacher next-tokentothewithStudent next-tokentoourtheTeacher next-tokentheourcompanyStudent next-tokentheourrecentTeacher next-tokenmemo,document,records,Student next-tokenwebsite,report,data,Teacher next-tokenLinatheMs.Student next-tokentheourJohnTeacher next-tokenOkaforOseiOrtizStudent next-tokenSmithChenParkTeacher next-tokenleadsheadsmanagesStudent next-tokenleadsismanagesTeacher next-tokenatheourStudent next-tokentheaourTeacher next-tokenteamgroupstaffStudent next-tokenteamgroupdepartmentTeacher next-tokenof,thatStudent next-tokenofthat,Teacher next-token12.twelve.12,Student next-tokenfive.10.experts.All 11 tokens from the teacher: strong signal, but on text the student would not generate.τMarketingteamisledbyLinaOkaforwith12peopleTeacher next-tokenMarketingTheStatusStudent next-tokenMarketingTheLeadingTeacher next-tokenteamdepartmentatStudent next-tokenteamisdepartmentTeacher next-tokenisatconsistsStudent next-tokenisatplaysTeacher next-tokenledheadedmadeStudent next-tokenmainlyresponsibleaTeacher next-tokenbyjointlyfromStudent next-tokenbyfromandTeacher next-tokenLinaAnitaMayaStudent next-tokenTomSarahMikeTeacher next-tokenOkaforOseiOrtizStudent next-tokenSmithChenParkTeacher next-tokenwith,andStudent next-tokenwith,andTeacher next-token12a10Student next-tokenaoverseveralTeacher next-tokenpeoplemembersstaffStudent next-tokenpeoplemembersemployees4 of 10 tokens from the teacher, at the positions where the context changes the answer.τ → ∞Marketingteamismainlyfocusedoncreatingthetransient states: after the update the student stops reaching themTeacher next-tokenMarketingTheStatusStudent next-tokenMarketingTheLeadingTeacher next-tokenteamdepartmentatStudent next-tokenteamisdepartmentTeacher next-tokenisatconsistsStudent next-tokenisatplaysTeacher next-tokenledheadedmadeStudent next-tokenmainlyresponsibleaTeacher next-tokenfocusedresponsiblededicatedStudent next-tokenfocusedresponsibletaskedTeacher next-tokenonaroundinStudent next-tokenonaroundinTeacher next-tokencreatingbuildingdrivingStudent next-tokencreatingbuildingdevelopingTeacher next-tokentheandcontentStudent next-tokentheandengagingAfter “mainly”, the rollout never reaches the team lead, and the teacher has little left to correct.
❚❚
↺
**The SSD decoding loop.** The student and the teacher are the same model, and only the teacher sees the document *C*. At each position both produce a next-token distribution (panels above and below the token being decided). The bars at the bottom show their divergence δt; when it exceeds the threshold τ (dashed line), the teacher writes the token (orange), otherwise the student does (blue). The tabs replay the same prompt under off-policy (τ → 0), SSD and on-policy (τ → ∞) generation. Off-policy text is the teacher's own phrasing, which echoes the document (“According to the memo, …”) in a way the student cannot reproduce without it; SSD keeps the student's phrasing and lets the teacher supply the facts. SSD and on-policy tokens follow the paper's running example; the distributions and δ values are illustrative.
## Self-distillation and who writes the rollout
Let $x$ be a prompt and $C$ the privileged context, for example a document. The teacher $\pi\_T(\cdot\mid x, C)$ is the base model with $C$ in its context, and the student $\pi\_\theta(\cdot\mid x)$ is the same model without it. The goal is to update $\theta$ so that the student behaves like the teacher on new prompts, without being given $C$. All the methods we compare minimize the same token-level objective:
$$\mathcal{L}(\theta)=\mathbb{E}\_{y\sim\pi\_{\text{gen}}}\Big[\tfrac{1}{|y|}\sum\_t D\big(\pi\_T(\cdot\mid x,C,y\_{<t})\,\|\,\pi\_\theta(\cdot\mid x,y\_{<t})\big)\Big]$$
where $D$ is a divergence between the two next-token distributions, such as forward KL, reverse KL or the Jensen–Shannon divergence (JSD).
*Divergence Measures Based on the Shannon Entropy* (Lin, 1991) We use forward KL as $D$ in all experiments. What distinguishes the methods is the rollout policy $\pi\_{\text{gen}}$: the model that writes the sequence $y$ on which the loss is computed.
Setting $\pi\_{\text{gen}} = \pi\_T$ gives off-policy self-distillation: the teacher writes the response and the student imitates it. Every position lies on a well-informed trajectory, but at test time the student has to continue from its own prefixes, which it never practiced on, a form of exposure bias familiar from imitation learning.
[A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning](https://arxiv.org/abs/1011.0686) (Ross, Gordon and Bagnell, 2011) Setting $\pi\_{\text{gen}} = \pi\_\theta$ gives on-policy self-distillation: the student writes the response and the teacher scores every token of it.
[On-Policy Distillation of Language Models: Learning from Self-Generated Mistakes](https://arxiv.org/abs/2306.13649) (Agarwal et al., 2024)
[Self-Distillation Enables Continual Learning](https://arxiv.org/abs/2601.19897) (Shenfeld, Damani, Hübotter and Agrawal, 2026)
[On-Policy Distillation](https://thinkingmachines.ai/blog/on-policy-distillation/) (Lu and Thinking Machines Lab, 2025) Training and test-time behavior then match, and on-policy training reaches higher accuracy, but it is considerably slower.
## On-policy signal fades after a few mistakes
On Wikipedia, on-policy training needed about five times more supervised tokens than off-policy to reach 78% accuracy, so we looked at where its supervision goes. The per-token loss measures how much the teacher and the student disagree at a position, and therefore how large an update that token produces; we call it the **signal**. On the Wikipedia task (Figure 2), the on-policy signal is high for the first ~15 tokens of each rollout and then drops to a low level for the rest of it.
Off-policy (teacher writes)On-policy (student writes)
0%20%40%60%80%100%04008001,200Accuracysupervised tokens (×1000)≈5× faster, lower plateau00.40.81.204008001,200Per-token loss = signalsupervised tokens (×1000)0123255075100125Signal along one rollouttoken position in the rollouton-policy signal collapses early
↺ replay
**On-policy rollouts lose their training signal after a few tokens.** Off- and on-policy self-distillation on the Wikipedia task. Left: test accuracy against supervised tokens; off-policy converges faster but plateaus lower. Middle: average per-token loss during training; off-policy rollouts start with more than twice the signal and use it up quickly. Right: per-token loss by position within a rollout; along on-policy rollouts it drops from around 2 to below 1 within the first 15 tokens, while off-policy rollouts stay high.
Off-policy training converges faster, consistent with prior work, but on-policy training reaches a higher final accuracy. Off-policy rollouts start with more than twice the per-token signal and reduce it quickly. And along on-policy rollouts, the signal is concentrated in the first few tokens. The student writes without the document, so it soon reaches states that have little to do with it; conditioned on such a prefix, the teacher's distribution falls back to one close to the student's, and there is little left to correct.
Most of the supervised tokens in on-policy training are therefore spent on positions where the teacher adds little information.
## Inflection tokens
In the example of Figure 3, asked about the marketing team of the company described in the memo, the student and the teacher agree on the opening words “Marketing team is”. At the fourth token they diverge: the teacher, which has read the memo, continues with “led by Lina Okafor”, while the student writes the generic “mainly focused on creating the …”. We call such a position an **inflection position**. Given a rollout and a threshold τ, position $t$ is a τ-inflection position if
$$\delta\_t = D\_{\text{switch}}\big(\pi\_T(\cdot\mid x,C,y\_{<t}) \,\|\, \pi\_\theta(\cdot\mid x,y\_{<t})\big) > \tau,$$
where $D\_{\text{switch}}$ is any divergence between the two next-token distributions.
teacher tokenstudent tokentransient stateinflection position
“Tell me about the marketing team of the company.”Marketingteamisδₜ > τSSD: the teacher writes at the inflectionOn-policy: the student continuesledbyLinaOkaforwith12peoplemainlyfocusedoncreatingthe
**Two continuations of the same prefix.** Student and teacher agree up to “Marketing team is”, and the next token is an inflection position (δt > τ). SSD lets the teacher write it, and the rollout goes on to name the team lead and the team size. On-policy keeps the student's “mainly”; the grey tokens after it are transient states, which the student will rarely visit once the update has corrected the inflection.
At an inflection position the loss pushes the student strongly away from its original prediction, so after the update it is unlikely to write “mainly” in this context again. The states that follow in the on-policy rollout were generated by a policy that the update is changing, and the student will rarely visit them again. We call them **transient states**, and supervision on them is of limited use. On-policy training learns about each inflection position separately, over many updates, whereas an off-policy rollout contains the team lead, the team size and the remaining details in a single pass, but on text the student would not have written.
## Speculative Self-Distillation
SSD ke