Command Palette
Search for a command to run...
EOSトークンが一致しないとき:オンポリシー蒸留における長さインフレーションの理解
EOSトークンが一致しないとき:オンポリシー蒸留における長さインフレーションの理解
Yuxiao Yang Tianrun Yu Shangzhe Li Kaixiang Zhao Xuchao Zhang Chetan Bansal Huaxiu Yao Taylor W. Killian Weitong Zhang
概要
我々は、オンポリシー蒸留(OPD)における長さインフレーションについて研究する。そこでは、生徒モデルの応答が過度に長くなり、生成予算を使い果たすことさえある。我々は、ベース生徒モデルと事後学習済み教師モデルとの間の終端トークンの不一致が、この挙動の重要な原因であることを特定する。Qwen3、Llama、Gemmaにわたり、2つのモデルは宣言された停止集合が同一であっても、停止確率を異なるEOSトークンに置くことがある。この不一致は、生徒モデルが好む終端動作を抑制しつつ、教師モデルが好む代替動作を確実には転送しない可能性がある。我々は、デコーディングの停止集合を揃えるだけでは不十分であり、機能的に等価なEOSトークンを共有の意味的停止動作として扱うことで、3つのモデルファミリーすべてにわたり不一致に起因する長さインフレーションが大幅に軽減されることを示す。終端動作が学習の過程でどのように進化するかをさらに理解するため、我々は異なるK2-Horizon学習段階にわたってOPDを研究する。この段階別解析は、終端の選好が学習中に大きく変化しうることを示すとともに、OPD実行の後期に、終端の整合化後も持続する明確な長さインフレーションを明らかにする。これらの結果は総合すると、終端の不一致がOPDの長さダイナミクスの重要な、しかし網羅的ではない原因であることを特定する。我々は、提案する終端処理の修正を組み込んだ実装を公開する。
One-sentence Summary
Researchers at the University of North Carolina at Chapel Hill, Brigham Young University, and Microsoft show that termination-token mismatch between base students and post-trained teachers drives length inflation in on-policy distillation across Qwen3, Llama, and Gemma, and they propose treating functionally equivalent EOS tokens as a shared semantic stopping action, which substantially mitigates this mismatch-induced inflation, while stage-wise K2-Horizon analysis reveals additional late-run length dynamics.
Key Contributions
- The paper identifies termination-token mismatch between base students and post-trained teachers as a key source of length inflation in on-policy distillation, showing across Qwen3, Llama, and Gemma that models can prefer different EOS tokens even when their declared stopping sets are identical, which suppresses the student's preferred termination action without reliably transferring the teacher-preferred alternative.
- The paper demonstrates that aligning the decoding stopping set alone is insufficient, whereas treating functionally equivalent EOS tokens as a shared semantic stopping action substantially mitigates mismatch-induced length inflation across all three model families.
- The paper presents a stage-wise analysis of on-policy distillation across K2-Horizon training stages, showing that termination preferences can shift substantially during training and that a distinct late-training length inflation persists beyond termination alignment, and it releases an implementation incorporating the proposed termination-handling corrections.
Introduction
On-policy distillation (OPD) trains a student on its own sampled rollouts with dense token-level supervision from a post-trained teacher, making it a practical way to transfer strong behavior to smaller or less capable models. However, OPD often produces progressively longer responses with truncation or repetition, and prior work has attributed this length inflation to objective-level effects, rollout degradation, or training instability. The authors identify termination-token mismatch as a direct and diagnosable cause: base students and post-trained teachers may encode the same semantic stop decision with different EOS tokens, even when their declared stopping sets match. Because the teacher evaluates only student-generated tokens, the student's own termination action can be suppressed. The authors show that aligning the decoding stopping set alone is insufficient, while treating functionally equivalent EOS tokens as a shared semantic stopping action substantially mitigates mismatch-induced length inflation across Qwen3, Llama, and Gemma.
Method
The authors identify that modifying only the decoding interface is insufficient to address termination mismatch in distillation. The mismatch must be corrected within the distillation signal itself by reconciling the termination probabilities of the teacher and the student. Let EEOS denote the termination-equivalent tokens under the rollout protocol, and let e⋆∈EEOS be a canonical EOS token supported by the base student. To address this, the authors propose three probability-level alignment corrections.
The first correction, teacher-side EOS mapping, maps the probability mass the teacher assigns to all termination-equivalent tokens to the canonical student EOS token. This is formulated as:
πE(e⋆∣st)=e∈EEOS∑πE(e∣st)In practice, negligible probability is retained on other EOS tokens for numerical stability, while the canonical probability is adjusted to preserve the total mass. The student distribution remains unchanged, and rollout terminates exclusively on e⋆.
The second correction, semantic EOS class, treats all tokens in EEOS as realizations of a single semantic action, STOP, rather than selecting a canonical surface token. For any policy π∈{πθ,πE}, the aggregated probability is defined as:
πˉ(STOP∣st)=e∈EEOS∑π(e∣st)while πˉ(a∣st)=π(a∣st) for non-EOS tokens. If a sampled token yt is an EOS token, it is replaced by yˉt=STOP. The standard sampled-token OPD update is then applied directly:
At=logπˉE(yˉt∣st)−logπˉθ(yˉt∣st),gt=At∇θlogπˉθ(yˉt∣st)This ensures EOS samples are supervised through the total termination probability without altering non-EOS tokens.
The third correction, canonical single-EOS action space, maps the teacher EOS probability mass to e⋆ and removes all other tokens in EEOS from the student sampling distribution, renormalizing the remaining probabilities. This creates a consistent action space with a single canonical termination action.
The authors note that these three corrections yield similar empirical results. Teacher-side EOS mapping is utilized for explicit, known mismatches because it simply modifies the teacher distribution. However, semantic EOS aggregation is adopted as the default for cross-family experiments because it avoids the requirement of designating a canonical surface form, accommodating models that expose the same declared EOS set but prefer different tokens.
The shared termination failure is distinct from its effect on measured task performance. Cross-template evaluation can reduce observed response length, and performance gains from OPD can persist despite severe length inflation, particularly under specific evaluation templates. The apparent effect on accuracy also depends on the grader, as certain evaluation styles are more sensitive to long redundant continuations. Consequently, length inflation does not necessarily imply a comparable loss of reasoning capability.
As shown in the figure below:
Experiment
The experiments evaluate sampled-token on-policy distillation between base student models and post-trained or instruct teachers from Qwen3, Llama 3.2, Gemma 3, and K2-Horizon on single-turn math reasoning tasks. They show that length inflation and clipping arise when teacher and student distribute termination probability across different equivalent EOS tokens, even if the decoding stopping sets are aligned, and that probability-level corrections such as semantic EOS aggregation substantially mitigate this mismatch across model families. Stage-wise K2-Horizon runs indicate that vanilla distillation can transfer a teacher-preferred termination token when the student already gives it enough sampling support, but later re-inflation and other residual length dynamics remain even after correction. Template and grader comparisons further show that the severity of length inflation depends on evaluation context, while some downstream performance gains can still transfer.
The studied model families differ in their declared EOS token configurations across training stages. Qwen and Llama base checkpoints declare a single end-of-text token, while their post-trained checkpoints also recognize additional conversational termination tokens. Gemma and K2-Horizon show cases where declared stopping sets are shared across stages, so termination mismatches can persist through learned preferences rather than decoding configuration alone. Post-trained Qwen and Llama checkpoints declare additional conversational termination tokens beyond the single end-of-text token used by their base checkpoints. Gemma and K2-Horizon keep declared stopping tokens consistent across compared stages, but learned termination preferences can still diverge.
The evaluation inspects declared end-of-text token configurations across base and post-trained checkpoints from Qwen, Llama, Gemma, and K2-Horizon. Qwen and Llama base models declare a single end-of-text token, while their post-trained versions add conversational termination tokens, creating a configuration-level shift. Gemma and K2-Horizon keep declared stopping tokens consistent across stages, but their learned termination preferences can still diverge, showing that stopping mismatches may arise from training behavior rather than decoding setup alone.