test(fact-extraction): stop judging phrasing/attribution the system already captures#2769
Merged
Merged
Conversation
…lready captures
Two hs_llm_core quality tests failed frequently on the core-LLM job, not
because the judge flaked (it is already temp-0 primary + majority-vote
confirmations) but because they judged model output that is genuinely
variable and already checked deterministically elsewhere.
test_date_field_calculation_yesterday: the resolved date lives in the
structured `occurred_start` field, which the test already asserts is
Nov 12/13. The judge additionally required the absolute date to appear in
the free-text fact prose ("...state the absolute date in the fact text"),
so a correct extraction that wrote "Yesterday" in prose but Nov 12 in
occurred_start still failed. That tested phrasing, not capability. Make the
occurred_start assertion mandatory (require a dated fact — calculating the
date is the point of the test) and drop the date clause from the judged
criteria; the judge now only checks the fuzzy activity-content claim.
test_cognitive_epistemic_dimension: the judge penalised entity/speaker
attribution ("Involving: She/He") that is not what this test is about — it
asserts cognitive/epistemic *states* survive extraction. Scope the criteria
to that dimension and instruct the judge to ignore attribution and wording,
so a state counts as preserved even if attributed to the wrong person.
Both still catch real regressions (missing/incorrect dates, dropped
cognitive states); they just no longer flake on aspects the system either
captures structurally or does not claim to get right. Verified locally: both
pass (extraction gpt-4o-mini, judge gpt-4.1-mini).
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.
Two
hs_llm_corefact-extraction-quality tests failed frequently on the Core LLM job (seen on #2727 and elsewhere). The judge was not the flaky part —llm_judge.pyalready does a temp-0 primary plus majority-vote higher-temperature confirmations. The tests were failing because they judged model output that is genuinely variable and already checked deterministically elsewhere.test_date_field_calculation_yesterdayThe resolved date lives in the structured
occurred_startfield, which the test already asserts is Nov 12/13. But the judged criteria additionally required the absolute date to appear in the free-text fact prose ("…state the absolute date in the fact text"). So an extraction that correctly setoccurred_start = 2024-11-12but wrote "Yesterday" in the prose still failed — that tests phrasing, not capability.Fix: make the
occurred_startassertion mandatory (require a dated fact — calculating the date is the test's point) and drop the date clause from the judged criteria. The judge now only checks the fuzzy activity-content claim; the date is verified structurally.test_cognitive_epistemic_dimensionThe judge penalised entity/speaker attribution ("Involving: She/He") — e.g. "2/3 judges agree not met … 'The meeting might not happen | Involving: She' … input states 'uncertainty about a meeting'". But this test asserts that cognitive/epistemic states survive extraction, not who they're attributed to.
Fix: scope the criteria to the dimension and instruct the judge to ignore attribution and exact wording — a state counts as preserved even if attributed to the wrong person.
Why this doesn't weaken the tests
Both still catch real regressions: a dropped/incorrect date fails the deterministic
occurred_startassertion, and dropped cognitive states fail the (still-judged) dimension criteria. They just no longer flake on aspects the system either captures structurally (occurred_start) or doesn't claim to get right (entity attribution in a dimension-preservation test).This follows the repo's own testing guidance (CLAUDE.md): assert deterministic structure directly; judge only the irreducibly-fuzzy semantic claim.
Verification
Both pass locally (extraction gpt-4o-mini, judge gpt-4.1-mini). This branch touches the API tests, so CI runs the Core LLM job against the real Gemini judge.
🤖 Generated with Claude Code