Repository navigation
feat(score): admit teacher scores across compatible token spaces - #66
Merged
Merged
Conversation
…hecked token-space permit Signed-off-by: Feathbow <feathbow@gmail.com>
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.
Why
A distillation teacher had to share the student's complete tokenizer identity. Scorers also checked the path against the target's prompt rendering and stopping rules. A teacher with a different chat template could not score a student path even when its token identifiers had the same meaning.
What
Tokenizer identity now hashes a canonical description with three layers: token space, text processing and execution. Inference and score load records carry the loaded tokenizer's description; the pure core verifies its identity and rejects source tokens outside its space.
Teacher scoring requires a directional consumption permit. The target must have the same base vocabulary and decoder, and matching added tokens on every source identifier; it may have additional identifiers. The permit binds the admitted trajectory to the loaded target and its input/output bounds. HF, MLX and vLLM consume the recorded path without rendering it again or applying the teacher's EOS. Probabilities remain normalized over every target output coordinate, and full-vocabulary probes must match that width. This permits scoring a path; it does not establish equivalence between the models' full distributions.
Input checks distinguish the tokens needed to score the response from extra tokens an executor feeds. HF and vLLM do not feed the last response token. MLX does for its discarded lookahead, so its worker checks that token before any forward, and the core checks it from the execution record. Online admission and replay use the same pure checks.
invar trainadds--teacher-tokenizer-digest. Student rollout and learner roles still share a complete tokenizer identity, including the versions oftokenizers,transformersandjinja2, so their environments must agree on those versions. Tokenizer identities change; existing checkpoints and evidence need the corresponding earlier core and workers. The loop and backend documentation describe these requirements.Validation
The core suite, formatting, lint, type fixtures and HF, MLX, vLLM and shared worker suites passed. Regression cases cover directional inclusion, implementation versions, probe widths and execution-specific input bounds. The HF distillation test uses a teacher with a different template through training, resume and history admission. Mutation checks exercise both omitted checks and an overly restrictive shared input bound.
On an RTX 6000 Ada, a Qwen3.5-4B student and frozen Qwen3.8-27B teacher completed scoring and two distillation updates with a PEFT learner and one resident teacher. The teacher's token space includes the student's. The run passed resume and history admission; the final core re-admitted its retained score and history with matching reports. Using different tokenizer package versions for student roles was refused at load.