Repository navigation
fix: reject non-finite accuracy scores in the single-turn gate - #183
Open
anandhu-eng wants to merge 1 commit into
Open
anandhu-eng wants to merge 1 commit into
anandhu-eng wants to merge 1 commit into
Conversation
A NaN score compares false with every bound, so _gate_accuracy passed it; +inf passed a lower bound. The client can write both: json.dumps emits a float NaN as the literal NaN, and RougeScorer writes "nan" for an empty set. The gate now reports each non-finite metric and does not compute the aggregate. The inline entry is still not gated. The agentic gates already reject these values; tests now cover that. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅ |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the change to reject non-finite accuracy metrics.
No open issues 🎉
What changed in this PR
This PR closes the single-turn accuracy gate’s non-finite score loophole by rejecting NaN and infinite metrics before computing aggregate accuracy. It preserves the exclusion of inline scores from that gate.
Changes:
- Reject non-finite accuracy metrics and report the affected datasets and metrics.
- Add a diagnostic message with rescoring guidance.
- Add regression tests for single-turn rejection, inline-score exclusion, and existing agentic rejection behavior.
| File | Description |
|---|---|
| tests/submission_checker/test_checks_aggregate.py | Tests non-finite scalar and ROUGE scores, JSON NaN, and inline-score exclusion. |
| tests/submission_checker/test_checks_agentic_accuracy.py | Tests existing agentic rejection of NaN and infinity. |
| src/submission_checker/models/aggregate/context.py | Rejects non-finite metrics before aggregate calculation. |
| src/submission_checker/data/messages.yaml | Adds the non-finite score error and rescoring guidance. |
Review effort: Balanced
pgmpablo157321
approved these changes
Nov 13, 2026
This branch has not been deployed
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 #177. Stacked on #182.
A NaN score compares false with every bound, so
_gate_accuracyreported a pass.+infpassed a lower bound. The client can write both: it writesaccuracy_results.jsonwithjson.dumps, which emits a float NaN as the literalNaN, andRougeScorerwrites"nan"for an empty set.The gate now reports each non-finite metric (
accuracy-gate / non-finite-scores, e.g.rouge1=nan) and does not compute the aggregate. The inline entry is still not gated.The agentic gates already reject these values, because NaN and inf fail the
[0, 1]check in_dataset_score. New tests cover that; that code is unchanged.Tests:
"nan",infand-infas a scalar score, plus a report parsed from JSON text with a bareNaN, as the client writes it."nan"strings: the message names only the non-finite metrics.score-not-fraction, not a pass.The six single-turn rejection tests fail without the fix. Full suite: 1,839 passed. Ruff and mypy pass.
🤖 Generated with Claude Code