Skip to content

Repair OMEGA answer extraction on the hill-climb variants - #417

Merged
abhishekraok merged 5 commits into
mainfrom
abhishekr/answer-extraction-320
Oct 12, 2026
Merged

abhishekraok merged 5 commits into
mainfrom
abhishekr/answer-extraction-320

Conversation

@abhishekraok

@abhishekraok abhishekraok commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator

Written by the Claude Code session ledger-worker (session id 72ea05cb-832c-5396-b05b-5bece635b222), for hill-climb-evals (#378).

Description

Part of upstream-defects-eval-port (#320). This fixes items 3 and 4, the answer-extraction defects. Items 1 and 2 are dataset/verifier defects and are left out.

The OMEGA extraction ported from oe-eval mis-reads two common answer shapes. Both reproduce on current main:

  • A colon after the prefix survives into the answer. The answer is: 42, The final answer is: 42 and Therefore, the final answer is: 42 all extract : 42, and answer is:\n42 extracts : (the prefix path reads only the first line), because no prefix pattern takes the colon that follows it. Reordering the prefixes would not fix this.
  • An unformatted answer extracts "". The catch-all regex (.*)\.? also matches the empty string at the end of the text, and the last match wins, so 42 gives ('', 0.1). Both exact_match and exact_match_flex therefore score 0 on every response that reaches the fallback.

The hill-climb variants now use a repaired extraction path:

  • each prefix pattern gets \s*:? appended, so it takes an optional colon;
  • the catch-all becomes (.+), so it must match at least one character.

The repaired path lives in its own scorer class, OmegaRepairedExactMatchScorer, and is used by omega_500:hillclimb and by omega_500_out, which inherits from it. The shared extract/answer_format.py is unchanged.

Plain omega_500 is kept bug-compatible. It still uses the oe-eval-matched extraction, following the disposition on #320, so it stays comparable with published numbers. Its task hash is unchanged (4a504548233d37ea).

Score impact:

  • Task hashes. The hash changes for omega_500:hillclimb (a108d0e58e67391f → cec7662fd1c8fd90) and omega_500_out (a1ae3ff5c5f05f16 → db6ad61ad99ab35b), because the scorer class is part of the config. Results stored under the old extraction will not pair with new ones. The two tasks still share one scorer, so the pair stays comparable.
  • Strict score (primary). Can only go up: colon-prefixed answers are now read correctly.
  • Flex score. Can also go up: unformatted answers are now read. Their format score stays 0.1, below the strict cutoff, so strict still rejects them.
  • Empty response. answer_format_correct is now recorded as 0.0 instead of 0.1; the score is 0 either way.
  • Edge case. When a prefix is followed by . and then a line break (e.g. The answer is.\n42), the old path dropped to the next prefix, while the repaired path takes the next non-empty line. In a 200k-sample fuzz comparing the old and repaired paths, this accounted for 40 of 71,521 differing outputs, all contrived.
  • Other tasks. No other task changes. GPQA, MMLU:cot and MMLU-Pro use the shared extractor with a letter regex that can't match an empty string, and their colon cases (The answer is: C) already extract correctly.

Follow-up note (not in this PR): the shared OLMO_3_ANSWER_REGEX_TEMPLATES used by GPQA and MMLU:cot include a case-insensitive (?i)\b($ANS$)\b pattern. It can grab the article "a" in a response as the answer letter A.

Possible conflict: the abhishekr/omega500-dev-tier branch (omega-500 pin, 32K cap, gap report) may also touch omega_500.py. The two may need a trivial rebase.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)

Testing

New TestOmegaRepairedExtraction in tests/evals/tasks/test_omega_500.py, covering both hill-climb tasks:

  • a colon after the prefix scores (strict, flex) = (1, 1);
  • an unformatted answer scores (0, 1);
  • extract_answer returns 42 on the hill-climb task and : 42 on omega_500;
  • omega_500 keeps its old behaviour.

The existing fast-path equivalence test now also runs against the repaired path. Against main's omega_500.py, 16 of the new cases fail; on this branch all pass.

  • ruff check and ruff format --check: pass.

  • ty check src/ alembic/: the same 11 diagnostics as on main (vllm/litellm providers, unused ignores); none are in the changed files.

  • pytest tests/ --ignore=tests/integration: 2902 passed, 19 skipped.

  • Unit tests pass locally (pytest tests/ --ignore=tests/integration/)

  • Integration tests pass (if applicable)

  • New tests added for new functionality

Review

  • Codex: no findings.
  • Independent Claude review (fresh reviewer per PR, 2026-10-01): two nits. extract_answer and the scorers were two routes to the same cascade; Omega500.extract_answer now asks the primary scorer and the hill-climb override is gone (2c1e080). The answer is:\n42 example above was wrong and is corrected.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have added/updated documentation as needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

🤖 Generated with Claude Code

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-12T23:30:28.041180Z 1262240 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

omega_500:hillclimb and omega_500_out now use a repaired extraction
cascade. The reference cascade from oe-eval reads "The answer is: 42" as
": 42", because no prefix consumes the colon. It also reads any
unformatted answer as "", because the catch-all also matches the empty
string at the end of the text and the last match wins. The repaired
cascade consumes an optional colon after each prefix and requires the
catch-all to match at least one character.

omega_500 keeps the reference cascade, so it stays comparable with
oe-eval and its task hash does not change. The hill-climb scorers are
their own class, so those two task hashes change and stored results from
the old extraction will not pair with new ones.

Refs #320.

Co-Authored-By: Claude Code <[email protected]>
@abhishekraok
abhishekraok force-pushed the abhishekr/answer-extraction-320 branch from 5cd1b1a to 6e3f2db Compare October 1, 2026 18:30
@abhishekraok
abhishekraok requested a review from a team as a code owner October 1, 2026 18:30
abhishekraok and others added 2 commits October 1, 2026 18:40
extract_answer and the scorers were two routes to the same cascade, so a
variant that changed its scorers without overriding extract_answer would
show one answer and score another. Omega500.extract_answer now asks the
primary scorer, and the hill-climb override is gone.

Addresses independent review on #417.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b8bc7c6308

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/olmo_eval/evals/tasks/omega_500.py Resolved
A variant that overrides primary_metric (a MetricName, or another scorer)
made extract_answer fail its scorer assertion.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@abhishekraok
abhishekraok enabled auto-merge (squash) October 12, 2026 23:27
@abhishekraok
abhishekraok merged commit d4eba89 into main Oct 12, 2026
7 checks passed
@abhishekraok
abhishekraok deleted the abhishekr/answer-extraction-320 branch October 12, 2026 23:34
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