Repository navigation
feat(bench): Split the attention fit by group and let a feature be dropped - #261
Merged
Merged
Conversation
…opped `scripts/fit_attention.py` split train and holdout by fen. That is not a split. Rows from one root share a parent node and most of a feature vector, so a holdout row usually has a sibling in the training half and the held out auc it reports is not held out. `scripts/groups.py` rejects the same shape for the tuner, and says why in its own words: a pair of games is one unit. `--group-by` takes a file naming each ledger and the group its rows belong to, and splits by that instead. A ledger recorded one root at a time then keeps every row of a root on one side. `--drop` leaves a feature out of the fit and writes a zero for its constant, which is how a weight identified on a thin slice of the rows is priced against one that is not. What the holdout says now comes with an error bar and a breakdown. The area under the curve is reported over every row, over the rows the gate can act on (depth four and up) and one depth at a time, and the error is a bootstrap that resamples groups where there are groups. Resampling rows under a sample drawn by group reports an error for a sample nobody drew. The engine does not move. No weight and no threshold changes here: this is the script the next fit is run with, not that fit. Bench: 3868987 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
Speed against
|
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.
scripts/fit_attention.pysplit train and holdout by fen. Rows from one root share a parent node and most of a feature vector, so that split can put a row and its sibling on opposite sides. This adds what is needed to check whether that matters.--group-by FILEnames the group each ledger's rows belong to and splits by group. Record the ledger one root per file and the map attributes every row to its root.--drop FEATUREleaves a feature out of the fit and writes a zero for its constant.Nothing in the engine changes. No weight, no threshold.
What it showed, on a depth 8 ledger over 1,428 roots from our own games (13.7 million scouts, fitted on a 20% row sample, grouped by source game):
hist_millidropped, by gamealpha_gapdropped, by gameOn a corpus this wide the fen split does not inflate the auc. It understates its error by about 2.4 times.
hist_millican go at no measured cost andalpha_gapcannot.Tests: 26 in
test_fit_attention.py, the whole script suite, and both cargo test runs pass. A second agent reviewed the change; its four minor findings are folded in.🤖 Generated with Claude Code