Jump to text
On this page
Copy and source
Published source confirmed at last check

Source changed 2026-11-23 00:01:58 UTC · snapshot created 2026-11-23 00:02:28 UTC · last check 2026-11-23 06:20:10 UTC

Engineering.Reference:26.4.5.2 - Choose the teaching target and its probability domain

Choose the training objective from the information available:

Available teaching informationExecutable choiceConsequential limit
A qualified demonstrated action or generated tokenMinimize its negative log probability under the student.This hard-target loss does not supply the teacher’s alternative probabilities.
A teacher distribution over the same alternatives at a compatible historyMinimize a specified distribution loss, such as teacher-to-student KL.Tokenization, action meaning, history and probability support must match the comparison.
An independently grounded outcome for an executed attemptUse the outcome update in 26.4.1, optionally with a separately specified teaching term.An episode reward alone may penalize a useful action preceding a failure.

For a language-model sequence, retain the original order reason, action, observation, reason, action, …. Align character annotations with the tokenizer’s prediction positions. Specify whether delimiters are targets, exclude observations and padding from direct output loss, and check the masks after truncation. Keep observations in the input to later predictions. Concatenating all reasoning before all actions teaches another history. Masking an observation’s label does not remove its influence through context or the shared model.

For reasoning and actions in one vocabulary, the teacher-to-student KL divergence is D_KL(q || p) = sum_{a:q(a)>0} q(a) log(q(a)/p(a)), summed over its alternatives a. Use it in the normalized objective

L = sum_t w_t D_KL(q_t || p_theta,t) / sum_t w_t.

Sum over the supervised positions t, with positive selected weights and compatible teacher distributions q_t. A one-hot q_t gives hard-target cross-entropy. For any fixed q_t, minimizing teacher-to-student KL is equivalent to minimizing cross-entropy with that q_t, since the teacher entropy is constant. Here w_t and q_t are held fixed during the update; the denominator includes the supervised weights, not observations. To imitate a teacher distribution, obtain its conditionals at the retained prefixes. A text-only teacher response, an unqualified truncated probability list or cached probabilities for a different history does not supply this objective.

Structured Agent Distillation v5, §§3.1–3.9 and Appendices L–N motivates separate reasoning and action supervision, including an optional action head. Specify the masks, weights, probability representation and reduction used for the comparison. With equal weights, one probability domain and one reduction, splitting the selected positions into two masks leaves their summed loss unchanged. A finite action head changes the representation; for a call with free-form arguments, provide an action/argument factorization or a compatible token distribution. A list of command names does not define probabilities over all argument strings.

Separate masks or heads also do not ensure independent parameter changes. Two binary heads sharing θ, each returning sigmoid(θ), with teacher probabilities 0.9 and 0.1 have KL gradients −0.4 and +0.4 at zero: their inner product is −0.16. Weighting or changing architecture can alter that conflict; naming the spans cannot remove it. Check the gradients before relying on orthogonality when choosing the update. The finite example below uses four independent logits.

Decide which histories to collect before choosing a curriculum. With a sufficient fixed dataset, score the stored teacher histories and fit offline. With student-generated histories, query the teacher on those prefixes or obtain compatible cached scores. SAD describes both paths without one consistent reproduction recipe; choose one and count its teacher calls. For a curriculum, specify how examples will be sampled or ordered. An entropy coefficient alone leaves that choice open.

When demonstration selection is the difficulty, SmartAD, §3 offers a concrete hard-target alternative: generate several teacher executions per question, admit those passing the chosen correctness/tool checks, score them with the frozen initial student, and select the lowest NLL per question. Average token NLL within each assistant response, then average responses. Its training weights reasoning, intermediate code and final code by 1, 1.5 and 2, normalized by the sum of supervised-token weights. This needs no teacher logits, but requires extra generation and scoring. Low NLL measures compatibility, not correctness. Its tool-failure filter would remove the job-status recovery above; preserve that needed behavior through a revised admission/selection rule.