Repository navigation
Add a multi-teacher distillation notebook with DistillationTrainer - #8685
Closed
behroozazarkhalili wants to merge 1 commit into
Closed
behroozazarkhalili wants to merge 1 commit into
behroozazarkhalili wants to merge 1 commit into
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. Pages changed in this PR: |
Member
|
Closing, see #8686 (comment). Multi-teacher distillation is covered by the "multiple teachers" docs section and |
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.
This adds
examples/distillation_mopd/distillation_mopd.ipynband its row in the examples overview.The notebook distills a math teacher and a code teacher into one Qwen2.5-0.5B student with
DistillationTrainer, routing each prompt to its teacher. In the committed run the student goes from 48.5% to 51.5% on GSM8K and from 38.0% to 42.0% on MBPP. Training takes 34 minutes and peaks at 15.9 GB of GPU memory, so it does not fit a free Colab T4 as configured; the overview row says so.The outputs come from one end-to-end run.
Note
Low Risk
Adds a notebook and one overview table row only; no runtime or trainer implementation changes.
Overview
Adds
examples/distillation_mopd/distillation_mopd.ipynb, an end-to-end walkthrough of multi-teacher on-policy distillation withDistillationTrainer(TRL 1.19+): a Qwen2.5-0.5B student, math and code Qwen2.5 teachers on GSM8K and MBPP, routing via ateacher_idcolumn and a teacher dictionary. The notebook covers dataset prep, tokenizer checks, pre/post divergence and task metrics (GSM8K / MBPP), training (~15.9 GB peak), smoke-test mode, and optional Hub push; committed outputs are from one full run.docs/source/example_overview.mdgains an index row fordistillation_mopd, noting the ~15.9 GB peak so it is not runnable on free Colab as configured (no Colab badge).This is documentation and example only; no changes to library training code.
Reviewed by Cursor Bugbot for commit 4ec1407. Bugbot is set up for automated code reviews on this repo. Configure here.