Repository navigation
fix(trainer): re-measure the force-written slow-update skill (#404) - #422
Merged
Merged
Conversation
In force-write slow-update mode (optimizer.slow_update_gate_with_selection: false, the default), the epoch-end guidance was injected into current_skill without validation, but current_score kept the pre-injection value and the selection cache stored the new skill as (current_score, 0.0): a gate score where a (hard, soft) pair belongs. Later step gates compared candidates against a score the injected skill never achieved, and a byte-identical later candidate reused the fake numbers. Measure the injected skill once on the selection split (or reuse a real cache entry), store its real (hard, soft), and set current_score with the same select_gate_score call as the baseline. slow_result.json records selection_hard, selection_soft and current_score. best_skill, best_score, best_step and best_origin are untouched, so final validation and promotion work as before. Gated mode is unchanged. On resume at exactly that epoch boundary, current_score is restored from slow_result.json without a rollout, covering an interruption between that write and runtime_state.json, and the history-only resume path. Cost: one selection rollout per epoch boundary in force-write mode, none when the exact skill text is already cached. Fixes #404 Co-authored-by: Claude <noreply@anthropic.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.
Fixes the stale-score bug reported in #404.
Problem. In the default force-write slow-update mode (
optimizer.slow_update_gate_with_selection: false), the epoch-end guidance is injected intocurrent_skillwithout validation, but:current_scorekeeps the pre-injection value, so later step gates compare candidates against a score the injected skill never achieved;(current_score, 0.0), which is a gate score where a(hard, soft)pair belongs. A byte-identical later candidate would then reuse those fake numbers, which is wrong undersoft/mixedgate metrics.Fix.
(hard, soft)is cached, andcurrent_scoreis set with the sameselect_gate_score(...)call the baseline uses.slow_result.jsonrecordsselection_hard,selection_softandcurrent_score.slow_result.json, with no rollout.best_skill,best_score,best_stepandbest_originare untouched (as since ffe5810), so the final-skill validation and promotion work as before. Gated mode is unchanged.Docs.
training-loop.mdand the config table now state that the paper's numbers and the releasedckpt/skills usedslow_update_gate_with_selection: true.Tests.
tests/test_trainer_slow_update_score.pydrives the realtrain()loop with a mock adapter and no model calls:use_gate;On current
main, the 5 force-write, cache and resume tests fail, and the 2 gated tests pass, which confirms gated mode is unchanged. With the fix, the full suite, the strict docs build and ruff all pass.The code was written with Claude Code and reviewed and verified by the maintainer.