fix(validate): detect per-query .pt scores via the run config - #407
Merged
Conversation
A 2-D scores.pt is [docs, seq_len] for per-token runs but [docs, queries] for query_method: none, and load_attribution_scores always chose the per-token reading, so evaluate_retrained rejected per-query MAGIC scores with 'expects per-doc (1D) scores'. Disambiguate with the config.yaml written next to scores.pt.
luciaquirke
force-pushed
the
fix-pt-per-query-scores
branch
from
August 6, 2026 04:52
3949f63 to
a36d3b8
Compare
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.
Standalone
validatewithretrained_dirfails on per-query MAGIC scores:load_attribution_scoresreturnsmulti_query=Falsefor every.ptfile, so a[docs, queries]matrix fromquery_method: nonehits theevaluate_retrained expects per-doc (1D) scoresassertion.Shape alone can't distinguish per-query
[docs, queries]from per-token[docs, seq_len], so this reads theconfig.yamlthatrun_magicwrites next toscores.pt: the tensor is per-query iff the run usedquery_method: none(and notper_token). Falls back to the per-token interpretation when no config is present.Longer-term the cleaner path is routing per-query MAGIC scores through the unified score-directory writer, but this unblocks validating existing runs'
scores.ptartifacts.