Skip to content

Add final_answer maths variants that score only text after </think> - #564

Open
abhishekraok wants to merge 1 commit into
mainfrom
final-answer-math-variants
Open

abhishekraok wants to merge 1 commit into
mainfrom
final-answer-math-variants

Conversation

@abhishekraok

Copy link
Copy Markdown
Collaborator

Written by Claude Code session olmo-eval thinking stripping

AIME, HMMT, Minerva Math and MATH-500 extract the last \boxed{} from the whole output, so an answer that appears only inside the reasoning trace gets credit, including in a trace that ran to the token cap. This adds a composable final_answer variant to each of them that scores only the text after the last </think>. A response without </think> scores 0.

The variant reuses the existing flags; it adds no new scoring code:

Flag Effect
strip_thinking (strip-thinking-task-option (#361)) Score only the text after the last </think>
strip_unclosed_thinking (add-strip-unclosed-thinking (#389)) An unterminated trace scores 0
thinking_prefilled An output with no </think> counts as unterminated. This is needed because Olmo Think chat templates end the prompt in <think>, so a runaway trace contains neither tag.

Use it only for thinking models. A model that answers without a trace also scores 0 under this variant.

It composes with the existing variants, e.g. hmmt_feb_2026:pass_at_32:16k:final_answer or aime_2025:pass_at_32:final_answer.

Affected specs: 16 new :final_answer specs (5 AIME, 3 HMMT, 7 Minerva Math subsets, MATH-500). Existing specs, suites and their hashes are unchanged; task_hashes.json only gains entries. No suite uses the new variant yet.

Related: final-answer-only-scoring (#545) adds a similar opt-in gate as a separate scoring path for GPQA and other scorers.

Validation

uv run pytest tests/evals/tasks/test_math_final_answer.py      # 25 passed
uv run pytest tests/evals/tasks/test_task_hashes.py            # passed after --update-task-hashes (16 added, 0 changed)
uv run ruff check src/ tests/ && uv run ruff format --check src/ tests/ && uv run ty check src/   # clean
uv run pytest tests/ --ignore=tests/integration                # 5410 passed, 41 skipped, 4 failed

The 4 failures are in tests/scripts/test_check_file_sizes.py and also fail on clean main in the same local environment. The new tests cover a trace that ran to the cap, a right answer inside the trace with a wrong final answer, and the reverse; they also check that the existing specs still credit the answer inside the trace. No model run was launched.

🤖 Generated with Claude Code

AIME, HMMT, Minerva Math and MATH-500 take the last \boxed{} from the whole
output, so an answer inside the reasoning trace (including a trace that ran
to the token cap) gets credit. The new composable final_answer variant turns
on strip_thinking, strip_unclosed_thinking and thinking_prefilled: only the
text after the last </think> is scored, and a response without </think>
scores 0. Existing specs and their hashes are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@abhishekraok
abhishekraok requested a review from a team as a code owner November 12, 2026 23:08
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T23:10:08.397121Z 63c05d5 PR opened
ℹ️ 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.

This branch has not been deployed

No deployments
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.

1 participant