Skip to content

Fix IFEval loose scoring: build each verifier once, not per variant - #296

Open
abhishekraok wants to merge 3 commits into
mainfrom
fix/ifeval-loose-scoring-nondeterminism
Open

Fix IFEval loose scoring: build each verifier once, not per variant#296
abhishekraok wants to merge 3 commits into
mainfrom
fix/ifeval-loose-scoring-nondeterminism

Conversation

@abhishekraok

@abhishekraok abhishekraok commented Aug 17, 2026

Copy link
Copy Markdown

Summary

IFEvalScorer rebuilt the instruction verifier for the strict check and again for each of the 8 loose variants. Several ifbench verifiers (e.g. count:word_count_range) draw random parameters for kwargs the dataset leaves unset, so the nine checks could each run against different criteria. Measured on 150 identical responses:

  • loose accuracy below strict (0.375 vs 0.400 prompt-level) — impossible, since loose's variant set includes the raw response
  • score drift across reruns of byte-identical output (spread 0.0084 on inst_level_strict_acc)

Fix: build each verifier once (_build_instruction) and reuse it for the strict check and all loose variants.

Notes for review

  • oe-eval reuses one instance within its loose test but builds a separate one for strict, so the reference can itself produce loose < strict on random-kwarg prompts. This PR shares one instance across both — slightly stronger than oe-eval; expected values unchanged.
  • Reuse is safe: of all 83 verifier classes, only EndChecker mutates state in check_following, and idempotently.
  • Numbers shift: affects ifeval_ood, live in the ifbench suite. Zero effect on allenai/IFBench_test (kwargs fully specified); ~0.8pt on google/IFEval-style prompts.

Test plan

  • New regression test: count:word_count_range with unset kwargs, 200 trials, asserts strict ⇒ loose. Fails on pre-fix code, passes on the fix.
  • ruff, ty, and the full unit suite pass (1860 passed, 7 skipped).

🤖 Generated with Claude Code

https://claude.ai/code/session_01B9VUctQuzfAtrdpk4wDjEx

IFEvalScorer rebuilt a fresh instruction instance for the strict check
and again for each of the 8 loose response variants. Several ifbench
verifiers (e.g. count:word_count_range) draw random parameters for any
kwarg the dataset leaves unset, so rebuilding per variant scored each
one against different criteria instead of the same one.

Two observable symptoms: loose accuracy could fall below strict, which
is impossible since loose's variant set includes the unmodified
response; and scores drifted across repeated scoring of identical
model output (measured spread up to 0.0084 on inst_level_strict_acc
over 5 runs on 150 IFEval responses).

Now each instruction is built once via _build_instruction and reused
for the strict check and every loose variant, matching oe-eval's
reference implementation in test_instruction_following_loose. This
affects ifeval_ood, which is already live in the ifbench suite.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B9VUctQuzfAtrdpk4wDjEx
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@abhishekraok abhishekraok mentioned this pull request Aug 17, 2026
6 tasks
abhishekraok and others added 2 commits August 17, 2026 20:33
Per-trial flip probability under the pre-fix code is ~0.04 (measured by
simulating the verifier's random draws), so 50 trials caught the
regression with only ~87% probability; 200 trials raise that above
99.9% at negligible runtime cost.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B9VUctQuzfAtrdpk4wDjEx
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B9VUctQuzfAtrdpk4wDjEx
@abhishekraok
abhishekraok requested a review from undfined August 17, 2026 21:39

@undfined undfined left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants