An on-policy distillation case file

Follow the prefix, not the label.

A student sampled B, arrived at xB, and received teacher feedback there. A review note says the run is on-policy because it uses reverse KL. Your job is to test that reasoning against the trace.

One deterministic toy · no model download · no training · no score · no claim of mastery

Metaphorical archive desk where one paper trail branches and a lens follows one route; technical evidence appears in the adjacent text.
DETECTIVE-FIG-001Metaphor only: the paper trail suggests provenance. It contains no policy value, equation, or research claim.

Briefing · four labels

Know what each record can answer

We will introduce notation only when the case needs it. For now, keep four nouns separate.

Policy
A rule that assigns probabilities to next-token choices.
Prefix
The prompt plus tokens generated so far—the state for the next prediction.
Behavior policy
The particular student version that actually sampled the stored token.
Divergence
A declared objective comparing two distributions; its direction does not reveal provenance.
DETECTIVE-FIG-002 · derived teaching decomposition

Six records, not one magical “OPD step”

  1. 01SampleStudent distribution + declared draw
  2. 02VisitAppend token; record child prefix
  3. 03EvaluateTeacher at that same prefix
  4. 04Local lossDeclared divergence; aligned events
  5. 05ReduceDeclared positions and length rule
  6. 06Update boundarySeparate optimizer step; omitted here
Arrows encode the trace order. Sampling, teacher feedback, the loss, and a later update are kept distinct. OPD-CL-004

Case DETECTIVE-CASE-CANONICAL

The branch at xB

Reconstruct provenance first. Then calculate. Every number below is an invented teaching input frozen by OPD-CORE-v1.

toynatural lognatstemperature 1EOS excludedbehavior = loss policy v0

Evidence board

The file before interpretation

The fixed prompt is x. The behavior row at x is [0.75, 0.25]. The recorded uniform draw is 0.8. Do not use the teacher or loss name to infer the sampled token.

OPD-TOY-001 · invented teaching probabilities; vocabulary [A, B]
PrefixStudent AStudent BTeacher ATeacher BTrace role
x0.750.250.500.50fixed start · included
xB0.600.400.900.10student-visited · included
xA0.300.700.800.20fixed teacher comparison · excluded
fixed prompt xstudent-v0 draw u=.8sample Bvisit xB

Derived draw from a toy fixture. The provenance rule is source-backed. OPD-CL-001OPD-CL-006DETECTIVE-CL-013DETECTIVE-CL-014DETECTIVE-CL-015DETECTIVE-CL-016DETECTIVE-CL-017

Branching diagnosis

Which clue can answer the provenance question?

The choice changes the evidence you reveal, not the frozen trace.

DETECTIVE-BRANCH-PROVENANCE · action: provenance

Decisive evidence

Record. behavior student-v0 supplied [0.75, 0.25] at x; u=0.8 selected B; the child prefix is xB.

Ruling. Decisive for the continuation-side state source: B and xB came from the current student behavior policy. The fixed prompt x does not change that completion provenance.

DETECTIVE-BRANCH-OBJECTIVE · action: objective

Insufficient by itself

Record. the declared local objective is reverse KL.

Ruling. Insufficient for provenance. Reverse KL names the objective direction, not the policy that generated the visited prefix.

DETECTIVE-BRANCH-CONFIDENCE · action: teacher-confidence

Insufficient by itself

Record. teacher-v0 supplies [0.9, 0.1] at xB.

Ruling. Insufficient for provenance and correctness. The row says what this teacher predicts at xB; confidence neither identifies the behavior policy nor proves the teacher is right.

Read the machine record

The teacher sees the path the student actually visited

At xB, both student and teacher distributions are evaluated at that same prefix. The teacher is not asked to pretend the student took A.

Metaphorical recorder with blank plates, one inspection lens, and a separate adjustment tool; the event table supplies the technical meaning.
DETECTIVE-FIG-003Metaphor only: recording, inspection, and adjustment are visually separate. The trace below defines the actual operations.
[sample]

Discrete draw

u=.8 → B. Detached in this GKD-style toy.

[visit]

New state

x + B → xB. Provenance: current student-v0.

[teacher]

Same prefix

Teacher-v0 supplies its row at xB.

[boundary]

No invented update

The reduced loss reaches an update boundary; parameters are not modeled.

Canonical GKD detaches student sampling; that local estimator is not every OPD method. OPD-CL-002OPD-CL-004OPD-CL-005OPD-CL-007

DETECTIVE-CALC-001 · derived

Only now do we work the loss

The trace has already answered whose states these are. The equation answers a different question: how far apart are the two declared distributions at each included prefix?

DKL(pS ∥ pT;s)=∑v∈{A,B}pS(v∣s)ln⁡pS(v∣s)pT(v∣s)D_{KL}(p_S\,\|\,p_T;s)=\sum_{v\in\{A,B\}}p_S(v\mid s)\ln\frac{p_S(v\mid s)}{p_T(v\mid s)}

Read it as: at one visited prefix s, weight each natural-log student/teacher ratio by the student's probability. The unit is nats. Teacher and student rows must refer to the same prefix and aligned vocabulary.

Included · prefix x

0.130812 nats

TokenStudentTeacherWeighted log-ratio
A0.750.50.304098831081123
B0.250.5-0.173286795139986

Included · prefix xB

0.311239 nats

TokenStudentTeacherWeighted log-ratio
A0.60.9-0.243279064864899
B0.40.10.554517744447956

Excluded comparison · prefix xA

0.582685 nats

This is a valid reverse-KL calculation on a fixed teacher branch. It does not enter the current-student canonical reduction.

Dˉ=D(x)+D(xB)2=0.2210253577620973… nats\bar{D}=\frac{D(x)+D(xB)}{2}=0.2210253577620973\ldots\ \text{nats}

Display: 0.221025 nats. Average the unrounded locals, then round once. Averaging the displayed values gives 0.2210255 and can produce a different six-decimal result.

Derived from the invented OPD-TOY-001 fixture; not model evidence. DETECTIVE-CL-013DETECTIVE-CL-014DETECTIVE-CL-015DETECTIVE-CL-016

The misleading note

This run is on-policy because it uses reverse KL.

Misleading. The student-generated xB prefix establishes the completion-side provenance; reverse KL is a separate objective choice.

sourced OPD-CL-003

DETECTIVE-FIG-004 · transfer comparison

Four files where the label is not enough

Each ruling asks for one missing implementation contract. These are invented diagnostic cases, not observations from a trainer.

01 · toy

STALE BEHAVIOR

stale relative to update policy

Evidence
behaviorPolicyId=student-v0; updatePolicyId=student-v1.
Ruling
The prefix is student-generated, but it is not strictly current-policy data for student-v1 without a declared correction/freshness rule.
Needed next
importance correction, clipping, or allowed policy-lag rule.

02 · toy

TOPK

full-vocabulary KL not computable

Evidence
teacher returns renormalized top-k entries and does not expose omitted tail mass.
Ruling
Do not equate the record with full-vocabulary KL or a sampled-token log-ratio.
Needed next
k, tail-mass treatment, renormalization, and estimator definition.

03 · toy

TOKENIZER

mapping required

Evidence
studentTokenizerId differs from teacherTokenizerId even though decoded text matches.
Ruling
Do not zip token-probability vectors by index; the next-token event spaces are not aligned by the supplied evidence.
Needed next
explicit vocabulary/tokenizer mapping or another comparable event space.

04 · toy

WRONG BRANCH

local feedback only

Evidence
after an earlier wrong turn, the teacher assigns high probability to a locally plausible next token at the already-wrong prefix.
Ruling
Local agreement at the visited prefix is not causal/process supervision and does not retroactively certify the earlier branch.
Needed next
a separately justified process or causal supervision signal.

The distinctions draw on the cited primary methods; the concrete records are toys. DETECTIVE-CL-008DETECTIVE-CL-009DETECTIVE-CL-010DETECTIVE-CL-011DETECTIVE-CL-012

Transfer desk · no score, no mastery claim

Change one axis at a time

Answer in two sentences: first name the divergence; then name the state source. Open the worked resolution only after you have committed to both.

OPD-XFER-A

Reverse objective, fixed branch

A learner uses reverse KL on a fixed teacher-generated xA prefix. Is the divergence reverse KL, and is the state sampling on-policy? Explain both axes separately.

Open worked resolution

The divergence is reverse KL. The xA state is fixed and teacher-generated, so its state sampling is not current-student on-policy.

OPD-XFER-B

Forward objective, student branch

A learner samples B from the student, queries the teacher at xB, and computes forward KL. Is this on-policy distillation? Explain why divergence direction does not change the state source.

Open worked resolution

Yes with respect to the completion-side state source: B and xB came from the current student. Forward KL is the independent objective choice.

The compact rule: trace the behavior policy that generated the visited prefix. Then inspect teacher query, feedback granularity, objective, reduction, and update semantics as separate fields.

Field notes

Similar labels, different estimators

Use this page after the case. It keeps publication status, state source, feedback granularity, objective, and update semantics in separate columns.

Method matrix

These rows are not interchangeable recipes.
MethodState / trajectory sourceFeedbackObjectiveUpdate semanticsSource status
Canonical GKD / fully on-policyCurrent student completions when λ = 1Full teacher/student token distributions at identical prefixesDeclared divergence; forward, reverse, JSD testedDetached student sampling in Eq. 4Peer-reviewed ICLR 2024
SeqKDFixed teacher-decoded sequenceSequence target used for student likelihood trainingSequence-level teacher target / NLL setupSupervised update on fixed sequencePeer-reviewed EMNLP 2016
ImitKDMixture of initial data and student generations; generated pool may be olderTeacher best token or distribution at visited prefixesImitation cross-entropy variantsMixed-data imitation-learning loopPeer-reviewed EMNLP 2020
MiniLLMStudent sequence distribution with practical teacher-mixed samplingSequence-level reverse-KL estimator termsReverse KLPolicy-gradient derivation, IS and length termsPeer-reviewed ICLR 2024; later arXiv v6 retitled
Scalar-reward RLPolicy trajectories under the algorithm contractScalar reward / return signalReward objective, optionally regularizedPolicy-gradient family dependentSeparate term in Agarwal Eq. 5
Thinking Machines implementationStudent rolloutsTeacher/student log-probs on sampled tokensNegative sampled reverse log-ratio as per-token advantageRL importance-sampling loss2025 engineering report; not peer reviewed

Compact comparison only; read the primary papers before implementing a trainer. OPD-CL-007DETECTIVE-CL-003DETECTIVE-CL-004DETECTIVE-CL-005DETECTIVE-CL-006DETECTIVE-CL-007DETECTIVE-CL-008

What is sourced, derived, toy, or unresolved?

sourced

Sourced

Student-generated GKD trajectories, same-prefix distribution comparison, independent data-source/divergence axes, fixed-prompt compatibility, detached GKD sampling, and method-specific estimator distinctions.

derived

Derived

The categorical draw, three reverse-KL values, unrounded mean, operation decomposition, and trace-order invariants.

toy

Toy

Every probability, draw, version label, complication record, and narrative case detail.

unresolved

Unresolved until specified

Cross-tokenizer mapping, top-k tail handling, allowed policy lag/correction, EOS inclusion, production length weighting, and teacher correctness.

Exact claim index

Every record is expanded with its status, source locator, and wording boundary.

OPD-CL-001In canonical GKD, “on-policy” identifies output trajectories sampled from the student and the prefixes visited along those trajectories.
Classification
Sourced fact.
Status
Supported.
Source locator
SRC-GKD-ARXIV-V3, §3.1, Eq. 4 and Algorithm 1 lines 5–10; ICLR abstract/record.
Wording boundary
Say “student-generated output trajectories/prefixes,” not that every prompt is newly sampled online.
OPD-CL-002The teacher is evaluated at the same student-visited prefix used for the local student prediction; the returned feedback granularity is method-specific.
Classification
Sourced fact.
Status
Qualified.
Source locator
SRC-GKD-ARXIV-V3, §3 Eq. 2 and §3.1 Eq. 4; SRC-TML-OPD-2025, Implementation / Pseudocode steps 2–3.
Wording boundary
Do not call all feedback a full distribution and do not equate sampled-token feedback with full-vocabulary KL.
OPD-CL-003Trajectory provenance and divergence choice are independent axes; an on-policy student trajectory can be paired with forward KL, reverse KL, JSD, or another declared divergence.
Classification
Sourced fact.
Status
Supported.
Source locator
SRC-GKD-ARXIV-V3, §3.1, Algorithm 1 (lambda and divergence D are separate hyperparameters), boxed GKD objective, and GKD-variants paragraph in §4.
Wording boundary
Do not infer update semantics from the word “on-policy.”
OPD-CL-004Student sampling, prefix visitation, teacher evaluation, local loss computation, loss reduction, and parameter update are separable conceptual operations.
Classification
Derivation from sourced algorithms.
Status
Supported.
Source locator
Premises: SRC-GKD-ARXIV-V3, §3 Eq. 2 and Algorithm 1; SRC-TML-OPD-2025, four-step implementation outline.
Wording boundary
Say “conceptual operations”; do not market it as a universal architecture.
OPD-CL-005The canonical GKD-style toy does not backpropagate through the student sampling distribution or discrete sampled token.
Classification
Local toy contract aligned with a sourced GKD property.
Status
Supported for canonical GKD and this toy.
Source locator
SRC-GKD-ARXIV-V3, §3.1 immediately after Eq. 4 and after the boxed GKD objective.
Wording boundary
Never generalize to MiniLLM, the 2025 engineering implementation, or every method called OPD.
OPD-CL-006A fixed input/prompt collection can coexist with on-policy student-generated completions.
Classification
Sourced fact.
Status
Supported.
Source locator
SRC-GKD-ARXIV-V3, Eq. 4 (x ~ X, y ~ p_S(.|x)) and Algorithm 1 line 6.
Wording boundary
State which portion has fixed provenance and which portion is student-generated.
OPD-CL-007Canonical GKD's detached trajectory with token-distribution losses and MiniLLM's sequence-level reverse-KL policy-gradient formulation are distinct estimators with different gradient semantics.
Classification
Sourced comparison.
Status
Supported.
Source locator
SRC-GKD-ARXIV-V3, §3.1 Eq. 4; SRC-MINILLM-ICLR-2024, §2.1 Eq. 1 and §2.2 Eqs. 2–7; SRC-GKD-ARXIV-V3, related-work discussion.
Wording boundary
Attribute each estimator to its paper/version.
DETECTIVE-CL-001The canonical paper is an ICLR 2024 peer-reviewed conference paper; its current readable author manuscript is arXiv v3 dated 17 January 2024.
Classification
Sourced bibliographic fact.
Status
Supported.
Source locator
SRC-GKD-ICLR-2024, title/authors/conference record; SRC-GKD-ARXIV-V3, header/version line.
Wording boundary
Do not call later 2026 OPD preprints the canonical source.
DETECTIVE-CL-002GKD's tokenwise sequence discrepancy is a declared length reduction over divergences between teacher and student next-token distributions at identical prefixes.
Classification
Sourced fact.
Status
Supported.
Source locator
SRC-GKD-ARXIV-V3, §3 Eq. 2.
Wording boundary
The article must still declare its own EOS inclusion and length convention; the toy uses two visited positions and no EOS row.
DETECTIVE-CL-003Scalar-reward RL and the distillation divergence are separate objective terms that can be combined but are not synonyms.
Classification
Sourced fact.
Status
Supported.
Source locator
SRC-GKD-ARXIV-V3, §3.2 Eq. 5.
Wording boundary
Do not label the toy “RL”; it has no scalar reward or policy-gradient update.
DETECTIVE-CL-004SeqKD trains on a fixed teacher-generated sequence rather than gathering current-student trajectory prefixes for feedback.
Classification
Sourced fact.
Status
Supported.
Source locator
SRC-SEQKD-EMNLP-2016, §3.2, pp. 1319–1320; corroborated by SRC-GKD-ARXIV-V3, §3 baseline descriptions.
Wording boundary
Describe the paper's sequence-level teacher decoding/training setup; do not reduce all offline distillation to SeqKD.
DETECTIVE-CL-005ImitKD uses a sequence-level mixture of initial data and student generations, and its generated pool may contain outputs from earlier iterations.
Classification
Sourced fact.
Status
Supported.
Source locator
SRC-IMITKD-EMNLP-2020, §3.1–3.4, Eqs. 4–6 and Algorithm 1, pp. 6123–6125.
Wording boundary
Call it mixed and potentially stale under its stated pool strategy; do not relabel all ImitKD states as current on-policy.
DETECTIVE-CL-006The peer-reviewed MiniLLM formulation optimizes a sequence-level reverse KL using a policy-gradient derivation and practical estimator terms that are absent from OPD-TOY-001.
Classification
Sourced fact.
Status
Supported.
Source locator
SRC-MINILLM-ICLR-2024, §2.1 Eq. 1; §2.2 Eqs. 2–7; Appendix B.
Wording boundary
The 2026 retitled arXiv v6 is a post-publication revision; use the ICLR paper for this peer-reviewed claim.
DETECTIVE-CL-007The 2025 Thinking Machines implementation samples student trajectories, retrieves student and teacher log-probabilities on sampled tokens, assigns the negative sampled log-ratio as a per-token advantage, and updates through an RL importance-sampling loss.
Classification
Sourced engineering behavior.
Status
Supported for that report's described implementation.
Source locator
SRC-TML-OPD-2025, Implementation / Pseudocode steps 1–4 and code excerpt.
Wording boundary
Engineering report, not peer-reviewed consensus or a universal OPD recipe.
DETECTIVE-CL-008Full-vocabulary teacher distributions, sampled-token log-ratios, and top-k teacher feedback expose different information and are not interchangeable without an estimator/renormalization contract.
Classification
Derivation plus source-bounded comparison.
Status
Qualified.
Source locator
Premises: SRC-GKD-ARXIV-V3, Eq. 2 uses full distributions; SRC-TML-OPD-2025, Pseudocode step 3 uses sampled-token log-probabilities and explicitly says top-k/logit distillation was not tested in its experiments.
Wording boundary
Do not attribute an empirical top-k result to the engineering report; tail-mass handling remains implementation-specific.
DETECTIVE-CL-009A direct tokenwise divergence requires teacher and student probabilities over an aligned vocabulary/token event at the same prefix.
Classification
Derivation from the definition.
Status
Qualified.
Source locator
Premises: SRC-GKD-ARXIV-V3, §2 autoregressive policy definition over vocabulary V, §3 Eq. 2.
Wording boundary
Cross-tokenizer mapping is not specified by the canonical paper; label the mismatch case unresolved until a mapping is declared.
DETECTIVE-CL-010Sampling temperature changes the distribution of student-visited trajectories; canonical GKD reports training with student temperature 1.
Classification
Sourced fact.
Status
Supported.
Source locator
SRC-GKD-ARXIV-V3, §2 temperature definition and §3.1 after Eq. 4.
Wording boundary
Record rather than universalize temperature; the toy's fixed categorical draw is not a temperature experiment.
DETECTIVE-CL-011EOS inclusion, truncation, and sequence-length reduction affect the implemented objective and must be declared.
Classification
Inference from source differences.
Status
Qualified.
Source locator
Premises: SRC-GKD-ARXIV-V3, Eq. 2 averages over L_y and task appendices use output caps; SRC-MINILLM-ICLR-2024, §2.2 includes length normalization.
Wording boundary
The case file declares two visited positions, excludes EOS, and uses an unweighted mean; no broader default is claimed.
DETECTIVE-CL-012Stored data is only strictly current on-policy relative to the behavior policy that produced it; a later update policy may differ.
Classification
Sourced/inferred implementation condition.
Status
Qualified.
Source locator
SRC-GKD-ARXIV-V3, Algorithm 1 samples from current student at each step; SRC-IMITKD-EMNLP-2020, §3.4 permits generated samples from earlier iterations; SRC-MINILLM-ICLR-2024, Appendix C.1 describes inner optimization over collected samples.
Wording boundary
Record behaviorPolicyId and updatePolicyId; do not call every lag invalid without the method's correction contract.
DETECTIVE-CL-013For prefix x, D_KL([0.75,0.25] || [0.5,0.5]) = 0.13081203594113696… nats.
Classification
Derivation.
Status
Supported.
Source locator
OPD-CORE-v1 fixture; recomputed by lab/record_trace.py and an independent decimal calculation.
Wording boundary
Display 0.130812; retain full precision for the mean.
DETECTIVE-CL-014For prefix xB, D_KL([0.6,0.4] || [0.9,0.1]) = 0.3112386795830576… nats.
Classification
Derivation.
Status
Supported.
Source locator
Same as DETECTIVE-CL-013.
Wording boundary
Display 0.311239.
DETECTIVE-CL-015The full-precision unweighted mean of the two included local losses is 0.2210253577620973… nats, displayed 0.221025.
Classification
Derivation.
Status
Supported.
Source locator
Same as DETECTIVE-CL-013.
Wording boundary
Do not average the six-decimal displays: that gives 0.2210255, which rounds differently.
DETECTIVE-CL-016The off-policy comparison row xA has reverse KL 0.5826853020432398… nats and is excluded from the canonical mean.
Classification
Derivation.
Status
Supported.
Source locator
OPD-CORE-v1; independent computation and tests.
Wording boundary
Its numerical value is a diagnostic comparison, not part of OPD-TOY-001's canonical loss.
DETECTIVE-CL-017The shared kernel, extra cases, and generated illustrations are teaching devices and provide no empirical evidence about OPD efficacy or learner outcomes.
Classification
Provenance statement.
Status
Supported.
Source locator
OPD-CORE-v1 experiment boundaries; image-generation.md; project files.
Wording boundary
Label at the point of use, not only in this ledger.

Open the complete Markdown claim ledger copied into this local build (local copy).

Primary sources and versions

  1. Agarwal et al., ICLR 2024 official record · canonical peer-reviewed source.
  2. Agarwal et al., arXiv v3 · current author manuscript, revised 17 January 2024; §3 Eq. 2, §3.1 Eq. 4 and Algorithm 1.
  3. Kim & Rush, SeqKD, EMNLP 2016 · §3.2, pp. 1319–1320.
  4. Lin et al., ImitKD, EMNLP 2020 · §3.1–3.4, Eqs. 4–6 and Algorithm 1.
  5. Gu et al., MiniLLM, ICLR 2024 conference paper · §2.1 Eq. 1, §2.2 Eqs. 2–7.
  6. MiniLLM author manuscript v6 · post-publication revision, retitled in 2026; not silently substituted for the conference source.
  7. Lu & Thinking Machines Lab, 2025 engineering report · sampled-token implementation; explicitly did not test top-k/logit distillation in those experiments; living page, not peer reviewed.

Implementation disclosures

Contract
OPD-CORE-v1; SHA-256 9AAD0A…0E697, verified before build.
Sampling
Already-declared toy probabilities, temperature recorded as 1, half-open categorical intervals, u=.8; draw detached.
Alignment
Teacher and student use DETECTIVE-ALIGNED-TOY-v1. The mismatch case fails closed.
Length / EOS
Exactly two included prefixes, x and xB; EOS excluded; unweighted mean of unrounded values.
Freshness
Canonical behavior and loss policies are both student-v0. A separate case exposes v0 → v1 lag.
Feedback granularity
Canonical case is full-vocabulary. Sampled-token and top-k variants are described, never equated.
Update
No optimizer, learning rate, logits, or parameter update is invented.
State runtime
Pure reducer; no state-machine library. The trace is generated by Python and replayed, not recomputed, in the browser.

What this case cannot establish

It does not show that OPD universally beats SFT, offline distillation, or RL; that a stronger or more confident teacher is correct; that tokenwise feedback supplies causal/process supervision; that full-vocabulary, sampled-token, and top-k feedback are equivalent; or that completing this case demonstrates mastery. No real model was trained or downloaded.

The experimental hypothesis about diagnostic reconstruction remains unproven. A learner study would be needed to compare transfer, retention, or speed across variants.