Repository navigation
[GKD] Preserve EOS supervision for off-policy distillation - #10285
Merged
hjh0119 merged 3 commits intoOct 2, 2026
Merged
Conversation
hjh0119
approved these changes
Oct 2, 2026
1 task done
|
Thanks for fixing this problem i found hope this SIWFT framework better |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR type
PR information
Fixes #10282.
Off-policy GKD (
--lmbda 0) inherits the rollout defaultadd_eos=False, so dataset responses without a literal EOS lose EOS supervision in both distillation and the auxiliary SFT loss. Restoring only student labels leaves remote teacher prompt logprobs without the EOS position, which is then filtered out of the KL loss.Use the normal training EOS policy (
None) for datasetGKDSamples and preserve it in the OPSD teacher view. For remote scoring, add an explicit'auto'value toRolloutInferRequest.add_eosand forward it from both HF/Megatron and Ray GKD requests. The template handles this value during actual encoding, using its existing stop-word, tokenizer-separator and token-overlap rules. The existingNone,TrueandFalsebehavior remains unchanged; generated samples still setFalse, including length-truncated rollouts.The final diff changes five production files: 10 insertions and 4 deletions. The base template changes only two condition lines; no extra rendering or helper for inferring EOS is needed. Template registrations and model-specific templates are unchanged. No test files are included.
Both trainer and teacher must use the updated implementation: older teacher servers do not support the new request mode.
Experiment results
_FakeTemplatewithout_get_response_prefixand were separately confirmed to fail identically on unmodified main; one case requires an unavailable Qwen2-VL processor.git diff --checkpassed. The published patch was compared byte-for-byte with this validated candidate.Validation used CPU. Teacher logprobs were synthetic; live vLLM scoring, distributed Ray/Megatron execution and the reported full 8B training run were not exercised.