ON-POLICY DISTILLATION · CASEBOOK 02

Diagnose the prefix.
Then name the method.

Seven invented records. Five questions each. One stubborn distinction: prefix provenance and objective direction are separate axes.

Applied-ML field guideTOY fixtures, sourced boundariesNo score or outcome claim

Five Prefix Autopsies

A diagnostic casebook for on-policy distillation

Here is the first training record on the desk:

Is this on-policy distillation?

Not enough information appears in the rendered answer alone. In this record, the missing fact is decisive: a teacher decoded 22 <EOS> earlier, and the sequence was stored before this student update. The student is learning now, but it did not generate the continuation it is learning on.

That distinction is the center of this casebook. We will examine seven invented training records through the same five questions. By the end, you should have a practical way to describe a record without letting one attractive label do five different jobs.

This is a diagnostic reading experience, not a benchmark or learner study. Its experimental premise—that repeated classification of matched near misses may help practical distinction-making—is unproven. Completing the final set does not establish mastery, retention, or real-world performance.

Evidence key

All readable word pieces in the dossiers are illustrative; they do not assert production tokenizer boundaries. Probability-vector cases explicitly assume aligned teacher/student token support.

The autopsy sheet

Every dossier uses CASE-FRAME-001 in the same order:

  1. Who generated this prefix? Record the prompt source separately from the continuation source.
  2. What exactly did the teacher supply? A hard target, a dense distribution, a subset of probabilities, a sequence-level likelihood signal, or one scalar score?
  3. Which loss is computed where? Name the visited state or sequence, the objective, and the KL direction when there is one.
  4. Does sampling receive a gradient? Separate no draw, a detached discrete draw, a differentiable local distribution loss, and score-function credit.
  5. What changes next? Usually the student parameters—not the recorded token, prefix, or teacher values.

This is not merely a checklist. Removing one field collapses cases that train differently. A dense teacher vector does not reveal who generated its prefix. A reverse KL does not reveal whether its state was fixed. A sampled token does not reveal how its probability enters the estimator.

A faithful GKD-style step can likewise be read as five distinct operations: sample or select a state source, record the visited prefix, evaluate teacher and student at that prefix, construct a loss, then update the student. This decomposition follows Agarwal et al.’s algorithm; it should not be read as a claim about universal wall-clock scheduling. [SOURCE + INFERRED · OPD-CL-004] (author manuscript v3, Algorithm 1)

CASE-FIG-001

The five-tray autopsy sheet

INFERRED Every dossier answers all five questions. The specimen column uses CASE-DOS-03.

Who generated this prefix?

Required evidence

Prompt source + continuation source + behavior snapshot

Answer kinds

fixed / fresh student / mixed / unresolved

If omitted: A method name gets mistaken for provenance.

CASE-DOS-03fixed x; fresh B; visited xB

What exactly did the teacher supply?

Required evidence

Payload and support

Answer kinds

hard target / dense vector / subset / scalar

If omitted: Feedback richness gets mistaken for freshness.

CASE-DOS-03dense [A,B] vector at xB

Which loss is computed where?

Required evidence

State or sequence + objective + reduction

Answer kinds

hard NLL / local KL / policy-gradient objective

If omitted: KL direction overwrites the state source.

CASE-DOS-03forward KL at x and xB

Does sampling receive a gradient?

Required evidence

Draw and estimator semantics

Answer kinds

no draw / detached / score-function credit

If omitted: A draw is confused with a loss or update.

CASE-DOS-03draw detached; local Sθ differentiable

What changes next?

Required evidence

Trainable target + held-fixed record

Answer kinds

usually student parameters

If omitted: Generation is mistaken for parameter change.

CASE-DOS-03student parameters only

Relationship: all five answers belong to one training record, but none substitutes for another.

Dossier 01 — The teacher wrote the answer

CASE-DOS-01 · TOY · CASE-CL-016

Prompt: “Write only the sum: 17 + 5 =”. Before student training, a teacher decoder stores 22 <EOS>. At each stored position, the record retains only the selected target token. It does not retain the teacher’s probability for alternatives.

Autopsy questionFinding
1. Who generated this prefix?The prompt is fixed. Continuation prefixes after the first target token come from the stored teacher-decoded sequence, not from the student being updated.
2. What did the teacher supply?One hard decoded token at each position: the stored sequence, not a dense probability vector.
3. Which loss is computed where?Hard-target token negative log-likelihood/cross-entropy on the fixed teacher path.
4. Does sampling receive a gradient?There is no current-student trajectory draw. The teacher’s earlier decoding created data; it is not a differentiable path through the current student.
5. What changes next?Student parameters change to increase the stored targets’ likelihood. The stored sequence and teacher do not change in this update.

Diagnosis: basic/mode-approximation SeqKD-style hard-target training on a fixed teacher-decoded sequence. It is not on-policy student-prefix distillation for the student now being updated.

Tempting wrong label: “It is on-policy because the student is updated immediately.” Update timing does not rewrite continuation provenance.

Evidence seal. Kim and Rush’s basic SeqKD construction approximates the teacher sequence distribution with a high-scoring decoded output, then trains the student on the resulting generated dataset. This supports the diagnosis above, but it does not establish that every later method called “sequence KD” uses exactly one beam output. [SOURCE · CASE-CL-001] (Kim & Rush, EMNLP 2016, §3.2, pp. 1319–1320)

Now change one thing: keep the stored path, but ask the teacher for more information.

Dossier 02 — Same prefix, fuller teacher payload

CASE-DOS-02 · TOY · CASE-CL-016

Reuse the arithmetic prompt and fixed teacher-decoded prefixes from Dossier 01. At each same fixed prefix, query the teacher for a full next-token distribution over a declared, aligned toy vocabulary.

Autopsy questionFinding
1. Who generated this prefix?The same fixed/teacher-generated record as Dossier 01. Denser feedback does not change its source.
2. What did the teacher supply?A dense probability distribution over every token in the aligned toy vocabulary at that prefix.
3. Which loss is computed where?A declared token-distribution discrepancy—forward KL in this dossier—at each fixed stored prefix, followed by the declared position reduction.
4. Does sampling receive a gradient?No student sampling constructs these prefixes. Gradients flow through student probabilities in the local distribution loss, not through the fixed record.
5. What changes next?Student parameters change to reduce the discrepancy on the fixed states. Teacher probabilities and stored prefixes remain fixed for the update.

Diagnosis: dense full-distribution distillation on fixed prefixes; still not on-policy state sampling.

Tempting wrong label: “Full teacher probabilities make the record on-policy.” Feedback richness and prefix provenance occupy different fields.

In Agarwal et al.’s supervised token-level KD expression, the teacher and student distributions are compared on prefixes from a fixed dataset. The equation can carry dense teacher information without turning those prefixes into student-generated states. [SOURCE + INFERRED · CASE-CL-002] (Agarwal et al., author manuscript v3, Eqs. 2–3)

Controlled pair 01 — Hard versus dense, provenance held fixed

FieldDossier 01Dossier 02
Prompt and prefix sourceFixed teacher-decoded pathThe same fixed path
Teacher payloadOne decoded target tokenFull aligned-vocabulary distribution
Local training objectHard-target NLL/cross-entropyForward KL / equivalent cross-entropy up to teacher-only terms
Current-student rolloutNoneNone
What the comparison isolatesFeedback granularityFeedback granularity

[INFERRED · CASE-PAIR-01] A hard target discards the teacher’s allocation over alternatives; a dense vector retains it. Neither payload makes the fixed state on-policy.

The next record changes provenance for real: the student chooses the branch.

Dossier 03 — The student takes the branch; forward KL follows

CASE-DOS-03 · OPD-TOY-001 · TOY · CASE-CL-016

Begin with fixed prompt x and an aligned toy vocabulary [A, B]. At x, the student assigns [0.75, 0.25] to [A, B]. Supply the uniform value u=0.8. Because the cumulative interval for A ends at 0.75, the categorical draw is B, and the next visited prefix is xB.

At the two visited states, the fixture contains:

StateStudent [A,B]Teacher [A,B]
x[0.75, 0.25][0.50, 0.50]
xB[0.60, 0.40][0.90, 0.10]

Every number is invented. The behavior snapshot that draws B is declared to be the current student for this local record. That declaration matters: text produced by an older student is not automatically on-policy for a later update.

Autopsy questionFinding
1. Who generated this prefix?The prompt x is fixed; the current student samples continuation token B. Thus xB is a student-visited on-policy prefix under the disclosed snapshot.
2. What did the teacher supply?A dense distribution over the same [A,B] support at each visited prefix.
3. Which loss is computed where?Forward KL, teacher-to-student, at x and xB; the two local losses are averaged.
4. Does sampling receive a gradient?The discrete draw B is detached in this GKD-style toy. The student still receives gradients through its differentiable probability vector in the local losses.
5. What changes next?A later optimizer step would change student parameters using the selected local loss. The realized draw, recorded prefixes, and teacher vectors remain fixed for that update.

Diagnosis: GKD-style on-policy prefix distillation with a forward-KL objective under this local detached-draw contract.

Tempting wrong label: “Forward KL means off-policy.” It does not. KL direction tells us how distributions are compared, not who generated xB.

Agarwal et al.’s on-policy loss samples a completion from the student and evaluates teacher and student token distributions on its intermediate prefixes; the paper’s Eq. 4 uses forward KL. Its algorithm separately chooses the student-data fraction and the divergence. [SOURCE · OPD-CL-001, OPD-CL-002, OPD-CL-003, CASE-CL-003] (official ICLR 2024 record; author manuscript v3, §3.1 and Eq. 4)

A fixed prompt set is compatible with this: prompt x can come from a fixed collection while the continuation and later prefixes come from the student. [SOURCE · OPD-CL-006] (Agarwal et al., §3 and Eq. 4)

There is one more fixed record in the fixture: xA, from a teacher-demonstration comparison. It is displayed later, but it is not part of this student-visited path and must not enter the canonical mean.

CASE-FIG-002

One rollout trace, five distinct operations

SOURCE + INFERRED Workflow order does not create a gradient through the discrete draw.

  1. 1

    Student samples

    At fixed rollout start x, S(.|x)=[0.75,0.25] and u=0.8 selects B.

    TOY · detached draw
  2. 2

    Visited prefix

    Append realized B to form xB. This continuation state is fresh-student under the disclosed snapshot.

    PROVENANCE · xB
  3. 3

    Teacher evaluates

    At that same xB, T(.|xB)=[0.9,0.1]. Teacher allocation is not ground truth.

    SAME PREFIX · xB
  4. 4

    Local objective

    At recorded states, forward and reverse KL are alternative objective choices. The canonical mean includes fixed start x and visited xB; xA is comparison only.

    DERIVED · x + xB
  5. 5

    Student update

    An optimizer would consume the selected local objective. This arithmetic fixture executes no optimizer step.

    NOT EXECUTED
no gradient through realized B in this local toy; student probability terms in the selected loss remain differentiable

Held fixed for the hypothetical local update: teacher values, realized B, and the recorded prefixes. Only student parameters would change.

Dossier 04 — Same student branch; reverse the discrepancy

CASE-DOS-04 · OPD-TOY-001 · TOY · CASE-CL-016

Reuse everything from Dossier 03: prompt x, current-student draw B, visited prefix xB, both student vectors, both teacher vectors, detached draw, and unweighted two-position reduction. Change only the local divergence from teacher-to-student to student-to-teacher.

Autopsy questionFinding
1. Who generated this prefix?The student generated the continuation that formed xB; provenance is unchanged.
2. What did the teacher supply?The same dense [A,B] distributions at the same student-visited states.
3. Which loss is computed where?Reverse KL, student-to-teacher, at x and xB, followed by the same unweighted mean.
4. Does sampling receive a gradient?The discrete draw remains detached in this local fixture. Gradients flow through the student distribution terms in the reverse-KL loss.
5. What changes next?A later optimizer step would change student parameters according to those local losses. Prefix provenance and the observed draw do not change.

Diagnosis: GKD-style on-policy prefix distillation with reverse KL under the same local detached-draw contract.

Tempting wrong label: “This is on-policy because reverse KL is on-policy.” Dossier 03 is the counterexample: it is equally on-policy with forward KL.

GKD treats divergence choice and student-data fraction as separate controls and includes reverse KL among its divergence variants. That supports this pairing; it does not imply reverse KL is universally preferable. [SOURCE · OPD-CL-003, CASE-CL-004, CASE-CL-017] (Agarwal et al., §3.1 “Choice of Divergence” and §4)

Controlled pair 02 — Forward versus reverse, provenance held fixed

FieldDossier 03Dossier 04
Student draw and visited pathu=0.8 → B → xBSame
Prefix provenanceFresh current-student continuationSame
Teacher payloadDense [A,B] vectors at x and xBSame
Sampling semanticsDetached discrete draw; local distribution gradientSame
Deliberate changeForward D_KL(T ∥ S)Reverse D_KL(S ∥ T)

[DERIVED · CASE-PAIR-02] Both records are on-policy on the provenance axis. Only the weighting inside the discrepancy changes.

CASE-FIG-003

State or behavior provenance × objective family

SOURCE + DERIVED Move on one axis without silently moving on the other. Mixed entries name their subtype; empty cells mean “not represented here,” not impossible.

State / behavior provenance ↓ / objective →Hard targetDense forward KLDense reverse KLScalar rewardSequence reverse KLPartial / top-k
Fixed / teacher-generatedCASE-DOS-01CASE-DOS-02OPD-XFER-A———
Fresh student-generated—CASE-DOS-03
OPD-XFER-B
CASE-DOS-04CASE-DOS-06
CASE-XFER-001-B
——
Mixed provenance — subtype required—CASE-DOS-05
fixed/student states
——CASE-DOS-07
teacher/student behavior sampler
—
Unresolved without freshness—————CASE-XFER-002

Fixed / teacher-generated

  • CASE-DOS-01 · hard target
  • CASE-DOS-02 · dense forward KL
  • OPD-XFER-A · dense reverse KL

Fresh student-generated

  • CASE-DOS-03 · dense forward KL
  • CASE-DOS-04 · dense reverse KL
  • CASE-DOS-06 / CASE-XFER-001-B · scalar reward

Mixed provenance — subtype required

  • CASE-DOS-05 · fixed/student states · dense forward KL
  • CASE-DOS-07 · teacher/student behavior sampler · sequence reverse KL

Unresolved without freshness

  • CASE-XFER-002 · partial/top-k objective unresolved
CASE-DOS-02 → CASE-DOS-03: source changes; forward KL stays.CASE-DOS-03 → CASE-DOS-04: KL direction changes; fresh-student source stays.

The notation the cases now require

We have finally earned symbols. Let

Forward KL is teacher-weighted:

DKL(T∥S;st)=∑v∈VT(v|st)lnT(v|st)S(v|st)
Equation sourceD_{\mathrm{KL}}\!\left(T\parallel S_\theta; s_t\right) =\sum_{v\in V}T(v\mid s_t)\log\frac{T(v\mid s_t)}{S_\theta(v\mid s_t)}.

Reverse KL is student-weighted:

DKL(S∥T;st)=∑v∈VS(v|st)lnS(v|st)T(v|st)
Equation sourceD_{\mathrm{KL}}\!\left(S_\theta\parallel T; s_t\right) =\sum_{v\in V}S_\theta(v\mid s_t)\log\frac{S_\theta(v\mid s_t)}{T(v\mid s_t)}.

[SOURCE · OPD-CL-003, CASE-CL-003, CASE-CL-004] These are the conventional KL definitions used in the GKD paper. They are asymmetric; if the weighting distribution has positive mass where the denominator distribution has zero mass, the divergence is infinite rather than silently clipped. (Agarwal et al., §2)

Rendering contract. The displayed equations are the canonical LaTeX source. The site should render them with semantic MathML, for example through KaTeX’s HTML+MathML output, and retain the nearby prose as the no-script/print interpretation. Do not replace them with raster images. Plain-text fallback names are D_KL(T || S) and D_KL(S || T).

Compute OPD-TOY-001

All inputs in this subsection are TOY. All values produced from them are DERIVED. Natural logarithms make the unit nats. The fixture scores exactly two positions, x and xB, with an unweighted mean. It models no EOS transition.

At x, forward KL is

0.5ln0.50.75+0.5ln0.50.25=0.143841 nats
Equation source0.5\log(0.5/0.75)+0.5\log(0.5/0.25) =0.143841\ \text{nats}.

At xB, reverse KL is

0.6ln0.60.9+0.4ln0.40.1=0.311239 nats
Equation source0.6\log(0.6/0.9)+0.4\log(0.4/0.1) =0.311239\ \text{nats}.

The complete recomputation is:

StateProvenance in this fixtureForward D_KL(T ∥ S)Reverse D_KL(S ∥ T)In canonical mean?
xFixed prompt at start of student rollout0.1438410.130812Yes
xBStudent-visited after detached draw B0.2262890.311239Yes
xAFixed teacher-demonstration comparison0.5341110.582685No
Mean of x,xBCanonical path only0.1850650.221025—

[DERIVED · OPD-TOY-001, CASE-LAB-001] The different means arise because the two directions weight the same log ratios differently. They do not show that either objective is better for a real model. xA is a useful contrast precisely because it is excluded.

CASE-FIG-004

OPD-TOY-001 — same path, two KL directions

TOY inputs DERIVED arithmetic. Bars are invented allocations, not truth or calibrated correctness.

x

fixed rollout start

IN MEAN
Student A0.75
Student B0.25
Teacher A0.50
Teacher B0.50
Forward D_KL(T || S)
0.143841 nats
Reverse D_KL(S || T)
0.130812 nats
xB

student-visited after detached B draw

IN MEAN
Student A0.60
Student B0.40
Teacher A0.90
Teacher B0.10
Forward D_KL(T || S)
0.226289 nats
Reverse D_KL(S || T)
0.311239 nats
xA

fixed teacher-demonstration comparison

NOT IN MEAN
Student A0.30
Student B0.70
Teacher A0.80
Teacher B0.20
Forward D_KL(T || S)
0.534111 nats
Reverse D_KL(S || T)
0.582685 nats
Teacher-weighted forward mean0.185065 natsx + xB only
Student-weighted reverse mean0.221025 natsx + xB only

Relationship: reversing the KL weighting changes the arithmetic, not the recorded path. Means use full-precision operands; xA remains excluded.

Lab bench — recompute, then inspect membership

CASE-LAB-001 is a standard-library Python companion. It is an arithmetic demonstration, not a language-model training run. The complete runnable source is lab/run.py; the focused excerpt below is CASE-LAB-LIST-002.

def kl_divergence(p, q):
    p_checked = validate_distribution(p, label="p")
    q_checked = validate_distribution(q, label="q")
    if len(p_checked) != len(q_checked):
        raise ValueError("p and q must have the same length")

    terms = []
    for p_i, q_i in zip(p_checked, q_checked):
        if p_i == 0.0:
            continue
        if q_i == 0.0:
            return math.inf
        terms.append(p_i * math.log(p_i / q_i))
    return math.fsum(terms)

Run from the variant folder:

python -B lab/run.py

Deterministic output — captured from the delivered constants and Python standard-library operations:

prefix  source                 reverse KL   forward KL   canonical mean?
x       fixed rollout start      0.130812     0.143841   yes
xB      student-visited          0.311239     0.226289   yes
xA      off-policy comparison    0.582685     0.534111   no

mean(x, xB)                      0.221025     0.185065
draw: u=0.8 -> B -> xB; gradient_through_draw=false (local toy only)
xA is displayed for comparison and excluded from both means.

The lab keeps student_sampling → visited_prefix → teacher_evaluation → local_loss_computation → parameter_update as distinct named stages (CASE-LAB-LIST-004). The last stage is intentionally not executed: this fixture does not invent parameters, gradients, or an optimizer. Its local draw is detached, but that does not prevent differentiation through S_θ(·|x) and S_θ(·|xB) in a selected local loss.

The captured run passed its eight internal contract checks, and the focused suite passed 31 tests under Python 3.12.0. Those are implementation checks, not model-quality or learner-outcome evidence. The lab does not test a real tokenizer, EOS handling, behavior-policy lag, sequence-level policy gradients, reward learning, or whether one KL direction is generally preferable.

Dossier 05 — One batch, two prefix sources

CASE-DOS-05 · TOY · CASE-CL-016

Prompt: “Condense to five words: The prototype battery lasted nine hours during the bench test.” An invented 50/50 source rule selects either a stored fixed prefix, Battery lasts, or a freshly sampled current-student prefix, Nine-hour battery. The teacher supplies a dense next-token vector at whichever prefix is selected. Both branches use the same forward-KL local loss.

Autopsy questionFinding
1. Who generated this prefix?One branch is fixed; the other is current-student-generated. The record is mixed, and the 50/50 rule must survive aggregation. The prompt is fixed in both branches.
2. What did the teacher supply?A dense next-token distribution at the selected prefix.
3. Which loss is computed where?Forward KL on states from both sources, combined by the disclosed source weights.
4. Does sampling receive a gradient?No draw occurs on the fixed branch. The student draw is detached in this local teaching case; student probabilities in the selected local loss remain differentiable.
5. What changes next?Student parameters receive losses from both source populations. The provenance field must not be erased by the mean.

Diagnosis: fixed/on-policy mixture—not purely on-policy and not purely fixed.

Tempting wrong label: “A fixed prompt set makes the whole batch offline.” The prompt is fixed; one continuation is freshly generated by the student.

For a disclosed toy weight \lambda_{\mathrm{data}}=0.5, the case is represented as

Lmix=(1−λdata)𝔼fixed[DKL(T∥Sθ;s)]+λdata𝔼student[DKL(T∥Sθ;s)]
Equation sourceL_{\mathrm{mix}} =(1-\lambda_{\mathrm{data}})\,\mathbb{E}_{s\sim q_{\mathrm{fixed}}} [D_{\mathrm{KL}}(T\parallel S_\theta;s)] +\lambda_{\mathrm{data}}\,\mathbb{E}_{s\sim q_{\mathrm{student}}} [D_{\mathrm{KL}}(T\parallel S_\theta;s)].

[SOURCE + TOY · CASE-CL-005] GKD’s λ controls how often student-generated rather than fixed outputs supply training states; 0.5 here is only an invented clarity aid, not a recommendation. (Agarwal et al., §3.1, Algorithm 1 and boxed objective)

Do not confuse this coefficient with generalized-JSD β, which changes a divergence, or ImitKD’s β_i, which controls an initial-data versus student-sequence mixture in that paper. [SOURCE · CASE-CL-006, CASE-CL-007] (Agarwal et al., §2 Eq. 1; Lin et al., EMNLP 2020, §§3.2–3.3)

Dossier 06 — A teacher score is not automatically distribution distillation

CASE-DOS-06 · TOY · CASE-CL-016

Reuse the summary prompt. The current student samples Nine-hour battery bench result. <EOS>. A teacher-like judge returns only the invented scalar 0.8 for the completed sequence. The record contains no hard teacher target, dense teacher distribution, or sampled-token teacher likelihood.

Autopsy questionFinding
1. Who generated this prefix?The current student generated the completion, so its trajectory provenance is on-policy under the stated freshness assumption.
2. What did the teacher supply?One uncalibrated scalar score for the completed sequence.
3. Which loss is computed where?An algorithm-specific scalar-reward RL objective over sampled sequences. A prefix-distribution KL cannot be reconstructed from one score.
4. Does sampling receive a gradient?Token identities are not pathwise differentiated. A score-function estimator may attach credit through sampled-token log probabilities; its returns, baseline, normalization, and regularization must be stated.
5. What changes next?Student parameters may change to increase expected return. The score does not reveal a teacher token distribution or causal explanation.

Diagnosis: on-policy scalar-reward RL in this record. Calling it prefix-distribution OPD would be unsupported.

Tempting wrong label: “A teacher produced feedback, so this must be distillation.” Teacher identity does not specify payload or objective.

The bounded claim is source-specific: Agarwal et al.’s combined objective writes expected scalar reward and generalized on-policy distillation as separate summands. This invented record contains the scalar-reward term and no distribution-matching term. RL and distillation can still be combined; this dossier does not declare them mutually exclusive or impose a universal naming rule on all literature. [SOURCE + INFERRED · CASE-CL-008] (Agarwal et al., §3.2 Eq. 5)

One sharp score is not proof of correctness. Nor would a sharp teacher probability vector be proof: it is a teacher-matching signal, and the cited GKD paper explicitly notes a teacher can hallucinate. [SOURCE + INFERRED · CASE-CL-014] (Agarwal et al., §4.1)

Dossier 07 — Sequence-level reverse KL is a different estimator family

CASE-DOS-07 · TOY surface + SOURCE method · CASE-CL-009, CASE-CL-016

Prompt: “Correct OCR: rnodern rneter.” In the toy surface, the current student samples modern meter <EOS>. We now use that surface to inspect MiniLLM’s method family: a sequence-level student-to-teacher reverse-KL objective with policy-gradient semantics.

Autopsy questionFinding
1. Who generated this prefix or sequence?In this toy record, the current student generated it. For MiniLLM’s practical estimator, the behavior sampler must be recorded separately because the paper also introduces a teacher/student mixture sampler with importance weighting.
2. What did the teacher supply?The published estimator uses two teacher payloads: a dense next-token teacher distribution for its exact single-step component at sampled prefixes, and teacher log-likelihood on sampled tokens for its long-horizon sequence-return component.
3. Which loss is computed where?Sequence-level D_KL(S_θ(y∣x) ∥ T(y∣x)), estimated with method-specific decomposition and corrections. It is not the two-position local mean from OPD-TOY-001.
4. Does sampling receive a gradient?A score-function/policy-gradient term accounts for sampling-dependent sequence credit. This is not pathwise differentiation through discrete token identities.
5. What changes next?Student parameters change under the verified sequence estimator and documented auxiliary terms. The sampled sequence remains an observed record.

Diagnosis: MiniLLM-style sequence-level reverse-KL policy-gradient distillation, kept separate from the local detached-rollout GKD toy.

Tempting wrong label: “It is just Dossier 04 summed over more tokens.” The objective level, estimator, feedback requirements, sampler, normalization, and gradient semantics differ.

The sequence-level objective family can be written

DKL(Sθ(y|x)∥T(y|x))=𝔼y∼Sθ(·|x)[lnSθ(y|x)T(y|x)]
Equation sourceD_{\mathrm{KL}}\!\left(S_\theta(y\mid x)\parallel T(y\mid x)\right) =\mathbb{E}_{y\sim S_\theta(\cdot\mid x)} \left[\log\frac{S_\theta(y\mid x)}{T(y\mid x)}\right].

MiniLLM derives a Monte Carlo policy-gradient estimator, then introduces an exact single-step term that consumes the dense teacher next-token distribution at sampled prefixes, a long-horizon return that uses teacher likelihood on sampled tokens, a teacher/student mixture behavior distribution, importance weighting, and length normalization. Its objective is student-distribution reverse KL; its practical behavior sampler can be mixed when the paper’s mixture coefficient is nonzero. State the two payloads and the behavior source separately rather than calling every realized prefix strictly student-only. [SOURCE · OPD-CL-007, CASE-CL-009] (official ICLR 2024 record, published as “MiniLLM: Knowledge Distillation of Large Language Models”; current author manuscript v6, retitled “MiniLLM: On-Policy Distillation of Large Language Models,” §§2.1–2.3)

Controlled pair 03 — Local reverse KL versus sequence reverse KL

FieldDossier 04Dossier 07
Shared headline wordsStudent-generated; reverse KLStudent-generated; reverse KL
Objective levelLocal token distributions at visited prefixesWhole-sequence distribution objective
Teacher payloadDense aligned-vocabulary vector at each toy stateDense next-token vector for the exact single-step term; teacher likelihood on sampled tokens for the long-horizon return
Sampling semanticsRollout detached in the GKD-style local estimatorScore-function/policy-gradient credit; practical mixed sampler and corrections
ReductionInvented unweighted mean over x,xBPublished method-specific decomposition and length treatment

[SOURCE · OPD-CL-007] Two shared labels do not establish estimator equivalence.

CASE-FIG-005

Controlled near-miss bench

SOURCE + TOY Pairs A, B, and D isolate a primary changed field. Bridge C names both changes explicitly.

PAIR A

Held constant · Arithmetic prompt and fixed teacher path

CASE-DOS-01Hard token → dense teacher distributionCASE-DOS-02

Feedback richness changes; provenance does not.

PAIR B

Held constant · Prompt, draw B, xB, vectors, detached sampling, reduction

CASE-DOS-03Forward KL → reverse KLCASE-DOS-04

Objective weighting changes; on-policy provenance does not.

BRIDGE C

Held constant · Fixed summary prompt and the presence of a fresh-student branch

CASE-DOS-05Mixed dense-prefix objective → fresh-sequence scalar objectiveCASE-DOS-06

This is a diagnostic bridge, not a one-field controlled pair: provenance and payload/objective both differ.

PAIR D

Held constant · Only the phrases “student-generated” and “reverse KL”

CASE-DOS-04Local detached estimator → sequence policy-gradient estimatorCASE-DOS-07

Shared headline words do not establish estimator equivalence.

The two-axis field map

The seven records can now be summarized without pretending they form one linear spectrum.

DossierContinuation-prefix sourceTeacher payloadObjective locationSampling semanticsWorking diagnosis
CASE-DOS-01Fixed teacher-decodedHard tokenFixed token positionsNo student drawBasic SeqKD-style hard-target training
CASE-DOS-02Same fixed prefixesDense full distributionFixed token positionsNo student drawDense fixed-prefix KD
CASE-DOS-03Fresh studentDense full distributionStudent-visited token states, forward KLDetached draw; local gradientGKD-style on-policy + forward KL
CASE-DOS-04Same fresh student pathSame dense distributionsSame states, reverse KLSame detached drawGKD-style on-policy + reverse KL
CASE-DOS-05Disclosed fixed/student mixtureDense distributionMixed-source token statesNone on fixed branch; detached locally on student branchMixed-state distillation
CASE-DOS-06Fresh studentScalar sequence scoreExpected-return objectiveScore-function credit if specifiedScalar-reward RL; no prefix-distribution KD shown
CASE-DOS-07Objective-level student sequence; practical sampler must be disclosedMethod-specific likelihood signalSequence-level reverse KLPolicy-gradient estimator, with method-specific correctionsMiniLLM-style sequence reverse KL

Misconception ledger

The wrong labels are tempting because real method names often bundle several choices. This ledger points back to the field that actually discriminates. It is also the complete static form of CASE-FIG-006.

IDTempting shortcutDecisive discriminatorReplacement model
CASE-MC-001On-policy means reverse KL.Dossiers 03 and 04 have one student path and opposite KL directions.SOURCE: provenance and divergence are separate controls. (GKD §3.1)
CASE-MC-002Forward KL implies fixed states.Dossier 03 evaluates forward KL at student-visited xB.SOURCE: any declared divergence can be paired with a disclosed state source.
CASE-MC-003Fixed prompts make completions off-policy.Ask who generated the continuation, not where x came from.SOURCE: fixed x can seed y~S_θ(.∣x). (GKD Eq. 4)
CASE-MC-004Dense teacher probabilities make a state on-policy.Dossier 02 has dense feedback on a fixed path.INFERRED: payload granularity does not determine provenance.
CASE-MC-005Teacher feedback is always distillation.Dossier 06 contains only a scalar return.SOURCE + INFERRED: diagnose payload and objective; RL and OPD may also be combined. (GKD Eq. 5)
CASE-MC-006A detached draw means the student cannot learn.Hold B fixed and differentiate the local loss through S_θ(.∣xB).SOURCE: the draw selects a state; local student probabilities remain differentiable.
CASE-MC-007Policy gradient differentiates through token identity.Inspect the log-probability score-function term.SOURCE: sampled actions receive score-function credit, not pathwise token differentiation. (MiniLLM §2.2)
CASE-MC-008Basic SeqKD preserves full teacher uncertainty.Compare one decoded target with Dossier 02’s full vector.SOURCE: the basic SeqKD mode approximation retains a hard sequence. (SeqKD §3.2)
CASE-MC-009Full-vocabulary, sampled-token, and top-k feedback are equivalent.Ask what support is summed and what happens to omitted mass.QUALIFIED SOURCE: these estimators use different supports; top-k is truncated. (2026 preprint §3.1; engineering report)
CASE-MC-010A mixed batch must be on- or off-policy.Preserve the source label of each component in Dossier 05.SOURCE: “mixed” with disclosed weights is the faithful answer.
CASE-MC-011MiniLLM reverse KL is the local GKD toy.Compare objective level, sampler, and gradient estimator.SOURCE: sequence policy-gradient and detached local objectives are different estimators.
CASE-MC-012Teacher confidence means correctness.Ask for an external task truth signal; the vector supplies none.SOURCE + INFERRED: teacher probability is preference, not proof. (GKD §4.1)
CASE-MC-013Tokenwise feedback is causal/process supervision.A term is conditioned on an already-realized prefix.INFERRED: local discrepancy does not identify the cause of a later outcome.
CASE-MC-014A stronger teacher must improve the student.Ask for task, alignment, shift, and empirical comparison.UNSUPPORTED at guarantee strength: capacity alone supplies no invariant. (MiniLLM §3.3)
CASE-MC-015Temperature, EOS, and length rules are presentation details.Change them and the visited path or included terms can change.SOURCE + INFERRED: they belong in the training contract.
CASE-MC-016Once student-generated, a record stays on-policy forever.Compare behavior snapshot with current update parameters.SOURCE + INFERRED: freshness is relational and method-specific.
CASE-MC-017Lower toy KL proves better real-model quality.OPD-TOY-001 has invented two-symbol probabilities and no outcomes.TOY BOUNDARY: these values validate arithmetic only.
CASE-MC-018A correct diagnosis-set tally proves mastery.There is no delayed or real-work evaluation.UNRESOLVED OUTCOME: report only interaction state, never mastery or retention.
CASE-FIG-006

Shortcut → discriminator → replacement

MIXED STATUS The full 18-row semantic ledger immediately above is the figure's complete text and print fallback.

Provenance

MC-001 · MC-002 · MC-003 · MC-004 · MC-010 · MC-016

Payload

MC-005 · MC-008 · MC-009 · MC-012

Gradient + estimator

MC-006 · MC-007 · MC-011 · MC-013

Evidence limits

MC-014 · MC-015 · MC-017 · MC-018

Start with MC-001: compare Dossiers 03 and 04. The same fresh-student path supports opposite KL directions.

Blind diagnosis set

Apply the five autopsy questions before reading the key. The prompts appear without category labels, but the explanations remain openly available below. A future interactive treatment may record selections; it must not gate this key or convert a tally into a mastery claim.

OPD-XFER-A

OPD-XFER-B

CASE-XFER-001 — same OCR text, different records

Record A · TOY: For “Correct OCR: c1ear,” a teacher decoder stores clear <EOS>. The student later minimizes hard-target cross-entropy on that fixed sequence.

Record B · TOY: For the same prompt, the current student samples clear <EOS>. A judge returns only scalar 1.0, and the trainer applies a disclosed policy-gradient estimator.

CASE-XFER-002 — incomplete top-k record

Record · TOY: A student snapshot generated a summary prefix, but the record does not identify whether that behavior snapshot matches the student now being updated. The teacher returns its top two token probabilities, but the record does not say whether remaining mass is discarded, renormalized, aggregated, or corrected. The trainer report calls the loss “the same as full forward KL.”

CASE-EXP-001

Diagnose the prefix before naming the method

TOY PRACTICE · NO SCORE Commit provenance and objective as two separate facts. Feedback never collapses them into a tally.

TOY + DERIVED

OPD-XFER-A · Reverse KL on a fixed comparison prefix

A trainer loads fixed teacher-demonstration prefix xA. At xA, student [0.3, 0.7] and teacher [0.8, 0.2] share the aligned toy support [A, B]. It computes local reverse KL. No fresh student draw produced xA for this update.

Explicitly missing or bounded fields
  • No production tokenizer or EOS rule is modeled.
  • No optimizer step is executed.
Prefix provenance

Classify the continuation state, not merely the prompt.

Name what is computed, including level and direction.

OPD-XFER-A loaded; no answer committed.

CASE-EXP-001 · STATIC / PRINT PATH

Complete open diagnosis key

All five records stay visible without scripts or an attempt. Each answer preserves the full autopsy, the matched counterexample, and its boundary.

TOY + DERIVED

OPD-XFER-A · Reverse KL on a fixed comparison prefix

Provenance
Fixed or teacher-generated continuation
Objective
Local reverse KL, D_KL(S || T)

A trainer loads fixed teacher-demonstration prefix xA. At xA, student [0.3, 0.7] and teacher [0.8, 0.2] share the aligned toy support [A, B]. It computes local reverse KL. No fresh student draw produced xA for this update.

Five-field autopsy

  1. Who generated this prefix?The fixed teacher-demonstration record supplied xA. It is not a fresh student-visited state.
  2. What did the teacher supply?A dense distribution [0.8, 0.2] over the aligned toy vocabulary [A, B] at xA.
  3. Which loss is computed where?Local reverse KL, D_KL(S || T), at fixed xA: 0.582685 nats (derived).
  4. Does sampling receive a gradient?There is no current-student trajectory draw in this record. The loaded prefix is fixed.
  5. What changes next?An optimizer would update student parameters from the declared local objective; this fixture executes no update.

Boundary: Reverse KL: yes. On-policy state sampling: no. Teacher probability is a preference signal, not ground truth.

TOY + DERIVED + SOURCE

OPD-XFER-B · Forward KL after the student takes the branch

Provenance
Fresh student-generated continuation
Objective
Local forward KL, D_KL(T || S)

Fixed prompt x starts a rollout. The disclosed current student has S(.|x)=[0.75, 0.25]; supplied u=0.8 selects B and visits xB. The teacher is queried at that same visited prefix, and the trainer computes local forward KL over x and xB.

Five-field autopsy

  1. Who generated this prefix?Prompt x is fixed, but the disclosed fresh student draw B generates the continuation prefix xB.
  2. What did the teacher supply?Dense aligned-vocabulary distributions at the recorded states x and xB.
  3. Which loss is computed where?Local forward KL, D_KL(T || S), at x and xB; the full-precision unweighted mean is displayed as 0.185065 nats.
  4. Does sampling receive a gradient?The categorical draw B is detached in this local GKD-style toy; student probability vectors in the local losses remain differentiable.
  5. What changes next?An optimizer would update student parameters from the selected local objective. The lab executes no optimizer and keeps B, xB, and teacher values fixed.

Boundary: The student draw makes xB on-policy for the disclosed fresh snapshot; forward KL changes weighting, not provenance.

TOY + SOURCE

CASE-XFER-001-A · OCR record A — stored teacher target

Provenance
Fixed or teacher-generated continuation
Objective
Hard-target NLL / cross-entropy

Prompt: Correct OCR: c1ear. A teacher decoder stores clear <EOS>. Later, the student minimizes hard-target cross-entropy on that fixed sequence. No current-student rollout generated the target record.

Five-field autopsy

  1. Who generated this prefix?The continuation is teacher-decoded and stored before the current student update.
  2. What did the teacher supply?One hard decoded target token at each stored position, not a dense distribution.
  3. Which loss is computed where?Hard-target NLL / cross-entropy on fixed teacher-sequence positions.
  4. Does sampling receive a gradient?No current-student trajectory draw exists; the teacher's earlier decoding is fixed data construction.
  5. What changes next?Student parameters would move toward the stored targets. The stored sequence remains fixed.

Boundary: This is a basic SeqKD-style hard-target record, not student-prefix on-policy distillation.

TOY + SOURCE

CASE-XFER-001-B · OCR record B — fresh sequence, scalar score

Provenance
Fresh student-generated continuation
Objective
Scalar-reward policy gradient

Prompt: Correct OCR: c1ear. The disclosed current student samples clear <EOS>. A judge returns only scalar 1.0, and the trainer applies a disclosed sequence-return policy-gradient estimator. No teacher token distribution is recorded.

Five-field autopsy

  1. Who generated this prefix?The disclosed fresh current-student snapshot generated the completion.
  2. What did the teacher supply?One scalar sequence score, 1.0; no hard target or token-distribution payload.
  3. Which loss is computed where?An algorithm-specific scalar-reward policy-gradient objective over the sampled sequence.
  4. Does sampling receive a gradient?Sampled actions receive score-function credit through log probabilities, not pathwise differentiation through token identities.
  5. What changes next?Student parameters would be updated toward higher expected scalar return under the declared estimator.

Boundary: This is on-policy scalar-reward RL in the stated toy record; local teacher-distribution distillation is not established.

TOY + UNRESOLVED

CASE-XFER-002 · Top-k report with missing contract fields

Provenance
Unresolved without behavior freshness
Objective
Unresolved partial-feedback objective

A report contains a student-generated summary prefix, but does not identify whether its behavior-policy snapshot matches the student being updated. The teacher returns only its top two token probabilities. The report omits aligned-support, missing-mass, renormalization or correction, objective, reduction, EOS, and length rules, yet calls the result the same as full forward KL.

Five-field autopsy

  1. Who generated this prefix?A student snapshot generated it, but behavior freshness relative to the update is absent. Current on-policy provenance is unresolved.
  2. What did the teacher supply?Only two teacher probabilities on an unspecified restricted support; omitted probability mass is unaccounted for.
  3. Which loss is computed where?Unresolved. Partial top-k feedback is not enough to infer dense full-vocabulary forward KL or its reduction.
  4. Does sampling receive a gradient?Unresolved. The report does not specify detached local evaluation, a sampled-token estimator, or score-function semantics.
  5. What changes next?Presumably student parameters, but the estimator and update contract are too incomplete to claim equivalence.

Boundary: Refuse a full-forward-KL equivalence. Full-vocabulary, sampled-token, and teacher-top-k feedback are not interchangeable.

Open answer key

OPD-XFER-A — two-axis explanation

OPD-XFER-B — two-axis explanation

CASE-XFER-001 — identical text does not imply identical training

Record A: The prompt is fixed and the continuation is teacher-decoded/stored. The teacher supplies hard targets. Hard-target cross-entropy is computed on fixed positions. There is no current-student rollout draw. Student parameters update toward the stored sequence. Diagnosis: basic SeqKD-style fixed hard-target training.

Record B: The prompt is fixed but the completion comes from the current student. The judge supplies one uncalibrated scalar, not token targets or a distribution. A sequence-return policy-gradient estimator is used; sampled tokens receive score-function credit rather than pathwise differentiation. Student parameters update toward higher expected scalar return. Diagnosis: on-policy scalar-reward RL in the stated record.

The rendered completion clear <EOS> matches in both records, but the provenance, payload, objective, and estimator do not. Both strings and the score are TOY, not observed model results.

CASE-XFER-002 — refuse the false equality

Prefix provenance is UNRESOLVED because the record does not supply behavior-policy freshness. The loss identity is also UNRESOLVED. Two teacher probabilities are not a full-vocabulary vector unless the method specifies aligned support, how top-k was selected, what happens to missing mass, whether either distribution is renormalized or corrected, the objective formula, and the position reduction. EOS, truncation, and length/mask handling are also missing.

Therefore the record cannot be called “the same as full forward KL.” Current primary sources distinguish full-vocabulary, sampled-token, and teacher-top-k objectives; the latter two do not become equivalent because they produce one scalar. This boundary is supported by a 2026 preprint and an author engineering report, so empirical conclusions retain those source statuses. [QUALIFIED SOURCE · CASE-CL-010] (Fu et al., arXiv v2, §3.1; Thinking Machines Lab engineering report)

The field card

Before accepting any “on-policy distillation” label in a codebase or paper, record:

  1. prompt source;
  2. continuation-prefix source and behavior-policy version;
  3. freshness, replay, mixture, or importance-correction rule;
  4. teacher payload and its support;
  5. tokenizer/vocabulary alignment;
  6. objective level and direction;
  7. discrete-sampling and gradient-estimator semantics;
  8. sampling temperature and decoding rule;
  9. EOS, truncation, masks, length normalization, and reduction; and
  10. the parameters that actually update.

The opening arithmetic record is now straightforward: fixed prompt, fixed teacher-decoded continuation, hard targets, hard-target loss on stored prefixes, no current-student draw, student update. The model name was never the key; the record was.

Where this casebook stops

OPD-TOY-001 assumes a shared two-token vocabulary, natural logs, a supplied draw at temperature implicit in the fixed probabilities, exactly two scored positions, no modeled EOS transition, a fresh behavior snapshot, and a detached local draw. It executes no optimizer step. The summary and OCR records are also invented. None establishes model quality, training stability, teacher correctness, process supervision, causal blame, efficiency, or a preferred divergence.

Cross-tokenizer mapping, stale or asynchronous rollouts, partial-support corrections, tool-using trajectories, teacher ensembles, adaptive teachers, and production serving are outside this treatment. So are universal comparisons among OPD, SFT, fixed distillation, and RL. A stronger or more confident teacher is not guaranteed to help.

Primary source path

A good diagnosis is not a fashionable method name. It is a compact record of provenance, payload, objective, estimator, update, and the assumptions that make each field meaningful.