Rescoring an evaluation with a new metric#3310
Open
Mamiglia wants to merge 7 commits intoUKGovernmentBEIS:mainfrom
Open
Rescoring an evaluation with a new metric#3310Mamiglia wants to merge 7 commits intoUKGovernmentBEIS:mainfrom
Mamiglia wants to merge 7 commits intoUKGovernmentBEIS:mainfrom
Conversation
17f428a to
4b3c400
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.
This PR contains:
What is the current behavior? (You can also link to an open issue here)
When rescoring an existing eval log with
inspect score, only the metrics stored in the original log are used. There is no way to specify new or different metrics at rescore time, so users cannot backfill new metrics (e.g.rate_of_no_answers) on previous evaluation runs without re-running the entire evaluation.Fixes #3000
What is the new behavior?
A new
--metricCLI option is added toinspect score(repeatable) that allows overriding the metrics used during rescoring. For example:Metrics can be specified by registry name or by
file@functionreference, consistent with how--scorerworks. Thescore()andscore_async()Python APIs also accept a newmetricsparameter for programmatic use.Does this PR introduce a breaking change?
The addition of the
metricsparameter as the third parameter in bothscore()andscore_async()defaults toNone, preserving existing behavior. If the implementation of someone relies on the third posistional parametet beingepochs_reducerthey'll get the wrong behaviour (let me know if you prefer a modification here and how). The CLI is purely additive.Other information:
Files changed:
score.py: adds--metricCLI option andresolve_metrics()helperloader.py: addsmetric_from_spec()to load metrics from registry or file (mirrors existingscorer_from_specpattern)score.py: threadsmetricsparameter throughscore()andscore_async(); when provided, overridesmetrics_from_log_header()__init__.py: exportsmetric_createtest_score.py: addsunscored-metrictest case verifying--metric accuracyproduces exactly 1 metricI want to disclose that I was assisted by LLMs for writing this code.