Repository navigation
Add a strip_thinking task option that drops the reasoning trace before scoring - #361
Merged
Merged
Conversation
…e scoring Reasoning models emit `<think>...</think>` before the answer. Scorers that read output.text directly (IFEval constraints, PopQA containment, judges) then score the trace as well as the answer: IFEval's "no commas" or word-count checks fail on the reasoning, and containment scorers pick up entity names mentioned while thinking. oe-eval handles this with the `r1_style` output processor; olmo-eval had no equivalent outside the safety tasks' answer_extractor, which scorers that use output.text never see. `TaskConfig.strip_thinking` (default False; `-o strip_thinking=true` from the CLI, or set on a variant) removes everything up to the last `</think>` in `score_responses` before answer extraction, matching oe-eval's regex. Outputs with no closing tag (budget exhausted mid-thought) are scored as-is, also as in oe-eval. The pre-strip text is kept in `output.metadata["original_text"]` and written to the prediction row, so trace length and termination rate can be audited from the artifact; metadata is otherwise not serialized. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01RKJs8PPByCsRbgCucpXmLq
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: e4c9c92628
ℹ️ 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".
…original_text persistence Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01RKJs8PPByCsRbgCucpXmLq
…e original text Two review findings. Tasks that override score_responses (AstaBench SQA, ExpertQA, FrontierScience, LitSearch, ResearchQA, SAGE) never reached the strip inside Task.score_responses, so `-o strip_thinking=true` silently scored the unstripped text there. The strip is now Task.strip_thinking_traces, called by both runner scoring paths (results.score_and_store and preparation.finalize_task) before score_responses; it is idempotent and a no-op unless the config enables it. Logprobs describe the whole generation, so bits_per_byte and logits_per_char divided full-sequence logprobs by the stripped answer's length. BitsPerByteScorer and build_predictions now normalize by original_text when present, and the prediction row carries num_chars_all alongside num_chars. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01RKJs8PPByCsRbgCucpXmLq
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01RKJs8PPByCsRbgCucpXmLq
gregorybchris
approved these changes
Sep 9, 2026
This was referenced Sep 9, 2026
This was referenced Sep 11, 2026
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.
Claude Code · https://claude.ai/code/session_01RKJs8PPByCsRbgCucpXmLq — agent-written, Abhishek reviewed the request
Problem
Reasoning models emit
<think>...</think>before the answer. Scorers that readoutput.textdirectly (IFEval constraints, PopQA containment, LLM judges) score the trace along with the answer: IFEval's "no commas" / word-count / keyword checks fail on the reasoning, and containment scorers credit entity names mentioned while thinking. oe-eval handles this with ther1_styleoutput processor (oe_eval/models/output_processors.py); olmo-eval has no equivalent outside the safety tasks'answer_extractor, whichoutput.text-based scorers never see.Change
TaskConfig.strip_thinking: bool = False. When set,Task.strip_thinking_tracesremoves everything up to the last</think>(same regex as oe-eval). The runner calls it beforescore_responsesin both scoring paths, so tasks that overridescore_responses(AstaBench SQA, ExpertQA, FrontierScience, LitSearch, ResearchQA, SAGE) are covered. Outputs with no closing tag are scored as-is, also matching oe-eval.output.metadata["original_text"]and written to the prediction row, so trace length and termination rate can be audited from the artifact (metadata is otherwise not serialized). Logprobs describe the whole generation, soBitsPerByteScorerand the prediction row'slogits_per_char/bits_per_bytenormalize byoriginal_textwhen present; the row also carriesnum_chars_allnext tonum_chars.strip_thinkingis accepted as a-otask override; it can also be baked into a variant viaregister_variant(..., strip_thinking=True).Usage
Verification
ruff check/ruff format --check/ty checkclean on the touched files;tests/evals/tasks/test_base.py,tests/cli/test_utils.py,tests/runnerspass (103 tests).</think>text (e.g. 1300 generated tokens, 915 visible characters), extracted answers came from the answer rather than the trace.TestStripThinkingintests/evals/tasks/test_base.py(closed tag, last-tag-wins, unterminated, no tag, idempotence, default off,to_dict);tests/runners/test_strip_thinking_runner.py(a task overridingscore_responsesstill sees stripped text throughfinalize_task);tests/runners/io/test_builders.py(original_text,num_chars_all, logprob normalization);tests/common/test_bits_per_byte_scorer.py. 154 tests pass across the touched areas.Not included here: the
olmo3adaptMATH/AIME chat variants that reproduce oe-eval'solmo3:adaptconfigs. They sit onabhishekr/paper-protocoland can follow as a separate PR.🤖 Generated with Claude Code
https://claude.ai/code/session_01RKJs8PPByCsRbgCucpXmLq