Fix incorrect examples in distillation docs#6334
Merged
Merged
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
The sdft.py example used --teacher_update_rate 0.01 while the SDFTConfig default, the sdft_trainer.md example, and the trainer test all use 0.05. Align the script to 0.05.
cmpatino
approved these changes
Jul 9, 2026
cmpatino
left a comment
Collaborator
There was a problem hiding this comment.
LGTM! Thank you for fixing these.
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.
What does this PR do?
Fixes several incorrect/misleading examples in the distillation documentation, all verified against the configs. Docs-only, no code changes.
paper_index.md— GOLD snippet import fails.from trl.experimental import GOLDConfigraisesImportError(GOLDConfigisn't re-exported there). Changed tofrom trl.experimental.gold import GOLDConfig, matching every other snippet andexamples/scripts/gold.py.paper_index.md— SDPO snippet silently disables feedback. The example setinclude_environment_feedback=Falsewith the comment "Use dataset privileged_context when available" and listsprivileged_contextas an expected column. But the flag defaults toFalse, which gates off all environment feedback (feedback_used_fraction=0,distillation_lossstays 0) — the example looks wired up but trains on zero distillation signal. Set toTrue(matchessdpo_trainer.md).paper_index.md— broken MiniLLM cross-refs.[experimental.MiniLLMTrainer]/[experimental.MiniLLMConfig]don't resolve; the autodoc anchors areexperimental.minillm.*(seeminillm_trainer.md).gold_trainer.md— stray config flag. Removedmodel_revisionfrom "configuration flags onGOLDConfig"; it is not aGOLDConfigfield (onlyteacher_model_revisionis) — it's aModelConfig/CLI arg, soGOLDConfig(model_revision=...)wouldTypeError.minillm_trainer.md—gamma=False→gamma=0.0.gammais afloat(default0.0) and the surrounding text says γ=0;Falseis type-inconsistent.examples/scripts/sdft.py—--teacher_update_rate0.01 → 0.05. The script used0.01while theSDFTConfigdefault, thesdft_trainer.mdexample, and the trainer test all use0.05. Aligned the script to0.05.Fixes # (issue): n/a
Before submitting
AI writing disclosure
Note
Low Risk
Documentation and example-only edits; no library or training logic changes.
Overview
Docs-only fixes so distillation examples match real TRL APIs and config fields.
paper_index.md: GOLD import isfrom trl.experimental.gold import GOLDConfig(the oldtrl.experimentalimport fails). MiniLLM doc links useexperimental.minillm.*autodoc paths. The SDPO snippet setsinclude_environment_feedback=Truesoprivileged_contextis actually used (withFalse, distillation from feedback stays off).gold_trainer.md: Dropsmodel_revisionfrom theGOLDConfigflag list—it belongs on model/CLI loading, notGOLDConfig.minillm_trainer.md: Usesgamma=0.0instead ofgamma=Falsefor the γ=0 on-policy case.examples/scripts/sdft.py: Example CLI uses--teacher_update_rate 0.05(was0.01).Reviewed by Cursor Bugbot for commit 7b6b28a. Bugbot is set up for automated code reviews on this repo. Configure here.