Repository navigation
feat(matching): training now says which parameters it did not measure - #598
Merged
Merged
Conversation
The publish advisories predict which `exact` levels the u-sample will not reach, from the profile alone and before any training exists. This is the other half: what actually came back unmeasured, which is what makes that prediction checkable rather than merely plausible. `TrainedModel::defaulted_levels()` reports every non-null level whose m or u is still `ProbabilitySlot::Unset` after training, so the scorer reads the level's built-in default instead of a value measured on this corpus. Falling back to the default is the right behaviour — it is a considered prior for the level's POSITION in the ladder, which beats asserting "these values practically never agree by chance" on no evidence. But it is silent: training succeeds, the model saves, every golden passes, and nothing in the saved document distinguishes a u measured over a million pairs from an assumption. For an exact level on a near-unique column the two can be orders of magnitude apart, because the true u of an equality is that corpus's own collision probability. Read off the final slots rather than the estimate history, deliberately. The question is what the scorer will use, and a level pinned by `fix_m` / `fix_u` or supplied in the settings JSON is a declared value, not a fallback. `Unset` is the one state that means "the default is in force". Surfaced in the three places the convergence report already travels: - `TrainReport.defaulted_levels` + `fully_measured()`, beside `not_converged` and for the same reason — a confidence statement, not a failure - the train task's counters as `levels_defaulted` / `levels_fully_measured`, because the ledger is the only place the distinction survives the run - `er train`'s summary, on its own line: provenance is not a verdict, and an operator reading "converged" should not have to work out which parameters that convergence measured Computed after the label pass, not with the rest of the report: a tenant's verdicts can still supply `m` for a level EM never observed, so reading it earlier would name a fallback the next few lines go on to remove. The test uses the committed goldens rather than hand-built settings, which also makes the two halves separable — `model_initial.json` has neither parameter on any of its 20 non-null levels, and `model_after_u.json` has all 20 u values and still no m. A report that conflated m and u fails it; verified by mutating the accessor to read the same slot twice and watching it fail on exactly that assertion. Also corrects `ProbabilitySlot::resolve`'s doc comment, which still described the deleted `NotObserved` variant mapping to 1e-6. That line is the origin of the belief that an untrained level scores at 1e-6. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
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.
#596 added publish advisories that predict which
exactlevels the u-sample will not reach, from the profile alone and before any training exists. This is the other half: what actually came back unmeasured — which is what makes that prediction checkable rather than merely plausible.What it reports
TrainedModel::defaulted_levels()returns every non-null level whosemoruis stillProbabilitySlot::Unsetafter training, so the scorer reads the level's built-in default instead of a value measured on this corpus.Falling back to the default is the right behaviour — it is a considered prior for the level's position in the ladder, which beats asserting "these values practically never agree by chance" on no evidence at all. But it is silent: training succeeds, the model saves, every golden passes, and nothing in the saved document distinguishes a
umeasured over a million pairs from an assumption. For an exact level on a near-unique column the two can be orders of magnitude apart, because the true u of an equality is that corpus's own collision probability.Final slots, not estimate history
Read off
level.m/level.urather than the estimate history, deliberately. The question is what the scorer will use, and a level pinned byfix_m/fix_uor supplied in the settings JSON is a declared value, not a fallback.Unsetis the one state that means "the default is in force".Where it surfaces
The three places the convergence report already travels:
TrainReportdefaulted_levels+fully_measured(), besidenot_convergedand for the same reason — a confidence statement, not a failurelevels_defaulted/levels_fully_measured, because the ledger is the only place the distinction survives the runer train's summaryComputed after the label pass, not with the rest of the report: a tenant's verdicts can still supply
mfor a level EM never observed, so reading it earlier would name a fallback the next few lines go on to remove.Test
Uses the committed goldens rather than hand-built settings, which also makes the two halves separable:
model_initial.json— neither parameter on any of its 20 non-null levels → all 20 reported, bothmandumodel_after_u.json— all 20uvalues present, still nom→ all 20 reported,monlyA report that conflated
mandufails it. Verified by mutating the accessor to read the same slot twice and watching it fail on exactly that assertion:Also corrects
ProbabilitySlot::resolve's doc comment, which still described the deletedNotObservedvariant mapping to1e-6. That line is the origin of the belief that an untrained level scores at 1e-6.Verification
make checkgreen from the repo root — 819 tests, 0 failures. Thededupe-coregolden suite goes 64 → 65 (the one new test); no golden value moved, which is expected since the accessor is read-only and changes no scoring.🤖 Generated with Claude Code