Repository navigation
Add OMEGA-500 task - #308
Conversation
500-problem OOD math reasoning subset (saumyamalik/omega-500), run as 0-shot chat with the boxed-answer template and temp 0.6 / top-p 0.95 / 131k tokens. Adds a shared regex-cascade answer extractor (common/answer_extraction.py) that mirrors oe-eval's extract_answer, reusable by other reasoning-regime tasks. Metrics: exact_match (answers below the format-correctness cutoff are demoted) and exact_match_flex (primary). Prompts verified byte-identical against oe-eval's implementation on all 500 docs; scorer verdicts identical on 544 synthetic responses run through oe-eval's own ExactMatch metric. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01B9VUctQuzfAtrdpk4wDjEx
footgun on models with <131k context Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01B9VUctQuzfAtrdpk4wDjEx
The previous comment said the delimiters are stripped "when they surround the whole answer text", but the substitution is unanchored and operates per line. The behavior is a verbatim port of the reference implementation (whose own comment is equally imprecise) and is required for parity, so only the description changes. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01LMFjgUqHjQA3aCeB4QmEHZ
Parity evidence (complete)Consolidates the two per-cell comments previously posted here plus the paired scorer check. Cross-harness score parity —
|
| model | oe-eval | olmo-eval | z | budgets | at ceiling (oe / olmo) |
|---|---|---|---|---|---|
| Olmo-3-7B-Instruct (official) | 0.274 | 0.304 | ≈1.1 SE | both ~uncapped | — |
| dense Olmo3-7B SFT | 0.100 | 0.086 | 0.76 | ~31,819 vs 32,768 (matched) | 10.8% / 7.6% |
| Qwen3-8B (official) | 0.464 | 0.462 | 0.06 | ~39,864 vs 32,768 | 0% / 5.0% |
All three agree. n=500 at T=0.6 is inherently a wide cell (SE ≈ 0.018–0.031).
Budget note: oe-eval's effective omega budget under --max-length 32768 is ~31,819 tokens, readable from its own predictions (54/500 items sit exactly there) — so olmo-eval @32,768 is the matched setting, not a handicap. On Qwen the generation behavior matches directly: oe-eval mean output 16,450 tokens vs olmo-eval median 15,063.
Runs
| cell | harness | experiment | result dataset |
|---|---|---|---|
| Olmo-3-7B-Instruct | oe-eval | 01M0MYKGN52QMVWXJD9KW9PT3D |
01M0NKZ01X8CARTWD7R46ZSZHX |
| Olmo-3-7B-Instruct | olmo-eval | 01M0Q1YB4N3WA1YZTH92Q6DE9P |
— |
| Qwen3-8B | oe-eval | 01M0P4FSQ51SQ0BG66BQY804D6 |
01M0SG1YQ7ZX4ZKJEVCSF7KWE7 |
| Qwen3-8B | olmo-eval | 01M0R6SP8ERWSY5RNYVXFGE33G |
— |
The two result datasets hold the per-instance predictions the paired check below ran on, so the 500/500 agreement is reproducible from them without a GPU. Spot-checked 01M0NKZ01X8CARTWD7R46ZSZHX: exact_match 0.26 / exact_match_flex 0.274, num_instances 500, max_tokens_reached 0.0 — matching the table above. The budget-matched dense-SFT cell came from the cross-architecture SFT session and its run IDs aren't recorded here.
Generation budget is not a confound
Three-way decomposition on the dense SFT model:
| setting | exact_match_flex |
|---|---|
| olmo-eval @8,192 | 0.078 |
| olmo-eval @32,768 | 0.086 |
| oe-eval @~31,819 | 0.100 |
Budget effect z=0.46, harness effect z=0.76, combined z=1.22 — all ns. Quadrupling the generation budget buys ≲1 point, indistinguishable from zero: runaway items don't convert to correct however long they run. That is the empirical justification for capped runs (previously argued only from first principles), and it makes capped cells legitimate parity evidence with a truncation audit attached. It also bounds the 5% cap asymmetry on the Qwen cell — directionally that would only lower the capped side, which scored equal.
Paired offline scorer check — zero sampling noise
oe-eval's own stored generations scored with this PR's OmegaExactMatchScorer (strict + flex), compared per instance against oe-eval's own verdicts. Identical inputs both sides:
| model | n | strict agree | flex agree | oe (strict/flex) | this PR (strict/flex) |
|---|---|---|---|---|---|
| Olmo-3-7B-Instruct | 500 | 500/500 (100%) | 500/500 (100%) | 0.2600 / 0.2740 | 0.2600 / 0.2740 |
| Qwen3-8B | 500 | 500/500 (100%) | 500/500 (100%) | 0.4640 / 0.4640 | 0.4640 / 0.4640 |
Aggregates match to four decimals because every per-instance verdict matches. This exercises the full regex cascade in common/answer_extraction.py — answer-format regex → prefix regexes → bare fallbacks, plus comma normalization and delimiter stripping — against 1,000 real reasoning traces including the truncated/degenerate tail. Much stronger than the sampled cells above.
Incidental: scoring cost on long traces
Scoring is CPU-cheap for normal traces but not for very long ones — the 500 Olmo traces scored in ~1 second, the 500 Qwen traces (mean ~16.4k tokens, max ~40k) took ~964 seconds. The (.*)\.? and [\s\S]*?\\boxed\{(.*?)\}[\s\S]*? fallback patterns are the likely cost on long inputs. Not a correctness issue and not blocking, but worth knowing before scoring a large reasoning-heavy suite on CPU, and worth a look if scoring ever lands on the critical path.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 416dfb7578
ℹ️ 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".
| # max_tokens=None generates to the model's context limit, matching the | ||
| # reference regime's effective behavior on any context size. | ||
| sampling_params = SamplingParams( | ||
| max_tokens=None, |
There was a problem hiding this comment.
Avoid uncapped tokens until OLMo-core tracing supports them
When this task is run with the documented olmo_core provider, the async runner calls describe_request() before generation; that method passes these parameters directly to _build_generation_kwargs(), which evaluates params.max_tokens <= 0 before _resolve_max_tokens() can replace None. Consequently every OMEGA-500 request using that provider raises a TypeError before inference starts, so either retain a concrete token limit or make the provider's trace path resolve uncapped limits.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Confirmed — good catch, and it was broader than this task. Fixed in #319.
Verified the mechanism: describe_request() builds generation kwargs without calling _resolve_max_tokens(), and runners/asynq/processing.py:110 traces every request before generation, so params.max_tokens <= 0 raises TypeError: '<=' not supported between instances of 'NoneType' and 'int' before inference starts. The generate path was fine because it resolves first.
This hits every task using max_tokens=None, not just OMEGA — also #307 popqa:chat and #309 gpqa_*:cot. It went unnoticed because the parity runs used vllm_server.
Fixed in the provider rather than by reverting to a concrete cap: max_tokens=None is deliberate here (it avoids the fixed-131k footgun in #310, which silently 400s every request on models with smaller context). #319 lets None through the guard while still rejecting a concrete non-positive limit, with a regression test.
| ans_match = re.findall(answer_regex, continuation) | ||
| if ans_match: | ||
| answer = ans_match[-1] if use_last_raw_match else ans_match[0] |
There was a problem hiding this comment.
Discard empty matches before selecting the last raw answer
For an unformatted continuation such as 42, OMEGA's fallback regex (.*)\.? produces ['42', ''] because it is unanchored and can also match at end-of-string. Selecting ans_match[-1] therefore returns the empty match, causing the primary flex metric to reject exactly the bare-answer responses this fallback is intended to accept; filter zero-length matches or anchor the regex before choosing the last result.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Accurate description of the behavior, but this is a deliberate port and oe-eval does exactly the same thing — so changing it here would break the parity this PR exists to establish.
oe-eval's extract_answer (oe_eval/tasks/utils.py) has the identical final fallback, with no empty-match filtering:
for idx, answer_regex in enumerate(answer_regexes):
ans_match = re.findall(answer_regex, continuation)
if ans_match:
answer_string = ans_match[-1] if use_last_raw_match else ans_match[0]Ran both implementations on your example:
| input | oe-eval | this PR |
|---|---|---|
42 |
('', 0.1) |
('', 0.1) |
So a bare unformatted 42 scores 0 on both metrics in oe-eval too. Filtering the empty match would make olmo-eval score responses oe-eval scores 0, and the 500/500 per-instance agreement reported above would no longer hold.
Worth fixing — but upstream, so both harnesses move together. Filing it there rather than diverging here.
There was a problem hiding this comment.
A note on this; I've typically matched and then versioned as a v2 or something with fixes ignoring oe-eval backporting.
There was a problem hiding this comment.
That pattern fits here well — matched v1 for comparability, then a :v2 variant with the extraction fixes, no oe-eval backporting required. Noted it on #320 as the disposition for the two extraction bugs.
| r"(?i)answer is", | ||
| r"(?i)answer is:", |
There was a problem hiding this comment.
Match colon-bearing answer prefixes before shorter prefixes
For an unboxed response such as The answer is: 42, the earlier the answer is/answer is pattern matches first and leaves : 42 as the answer text; the catch-all answer regex then extracts the leading colon, so both metrics compare : 42 against 42 and fail. The explicit answer is: pattern is unreachable in this scenario because the extractor returns after the first matching prefix, so the colon-bearing forms need to precede their shorter prefixes or consume an optional colon.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Same situation as the empty-match finding: real behavior, faithfully ported, and oe-eval's prefix list has the identical order.
From oe_eval/configs/tasks.py, omega_500's answer_prefix_regexes:
"(?i)Therefore,? the final answer is", "(?i)Therefore,? the answer is",
"(?i)the final answer is", "(?i)the answer is", "(?i)answer is",
"(?i)answer is:", "(?i)answer:"
the answer is precedes answer is: there too, so the colon-bearing entries are equally unreachable upstream. Ran both on your example:
| input | oe-eval | this PR |
|---|---|---|
The answer is: 42 |
(': 42', 0.5) |
(': 42', 0.5) |
The answer is 42 |
('42', 0.5) |
('42', 0.5) |
Both extract the leading colon and both fail the comparison. Reordering the list here would change scores relative to oe-eval on exactly the responses this PR is being certified against.
Also worth fixing upstream rather than diverging. Same for the answer_regexes and the 0.4 cutoff — all copied verbatim.
undfined
left a comment
There was a problem hiding this comment.
A few suggestions but otherwise looks good.
| # reference regime's effective behavior on any context size. | ||
| sampling_params = SamplingParams( | ||
| max_tokens=None, | ||
| temperature=0.6, |
There was a problem hiding this comment.
These sampling params look like they come from omega_500:0-shot-chat_deepseek config. oe-eval's plain omega_500:0-shot-chat uses temperature=0.7 and no top_p.
Should we rename this to reflect the deepseek regime?
There was a problem hiding this comment.
Keeping the name and documenting the regime rather than renaming, unless you feel strongly. Reasons: (1) precedent — merged #307's popqa:chat mirrors popqa::hamish_zs_reasoning_deepseek without carrying the deepseek name; (2) this config is the OLMO_3 suite entry, i.e. the setting the published numbers and the parity certification use, which is what an unqualified omega_500 should mean here; (3) with the formatter refactor above, plain omega_500:0shot-chat (temp 0.7, no top_p) becomes a straightforward variant if anyone needs it, which resolves the ambiguity in the direction of more tasks rather than a rename. Docstring now states which upstream config the defaults mirror.
| def process_doc(self, doc: dict[str, Any], index: int = 0) -> Instance | None: | ||
| question = str(doc["messages"][0]["content"]).replace(_BOXED_SUFFIX, "") | ||
| return Instance( | ||
| question=question + _TEMPLATE_SUFFIX, |
There was a problem hiding this comment.
The prompt suffix is concatenated onto the question inside process_doc, and the regexes are module-level constants that _STRICT and _FLEX close over. Both are fixed at
import time, so register_variant cannot override either one.
That blocks the other three upstream configs:
- 0-shot-chat needs a different temperature
- olmo3:midtrain needs stop sequences
- rlzero needs a different prompt template and a different set of regexes
aime.py:32 handles this by putting the CoT suffix in ChatFormatter(user_template=...). register_variant can override a formatter. Moving the suffix there now would make those variants a config change later instead of a refactor.
There was a problem hiding this comment.
Adopted in a838ccd, aime-style: the CoT suffix now lives in ChatFormatter(user_template=...) (braces escaped), process_doc stores the bare question, and format_request defers to config.formatter — so the upstream 0-shot-chat / midtrain / rlzero regimes become register_variant config (template, sampling, stops) rather than a refactor. The regexes stay module constants for now; the rlzero variant can pass its own set to the extractor when it lands. Emitted requests verified byte-identical on all 500 docs before/after, so the parity certification stands.
| @@ -0,0 +1,104 @@ | |||
| """Regex-cascade answer extraction for generative tasks. | |||
There was a problem hiding this comment.
This module does answer extraction, but it is not in the answer extraction package.
src/olmo_eval/evals/extract/ already holds extract_math_answer, extract_mcq_answer, and MathExtractor, and exports them through all. This new module is in common/ and is not exported anywhere.
Suggest moving it to evals/extract/answer_format.py and adding it to that package's all.
There was a problem hiding this comment.
Behavior-preservation evidence for the move + formatter refactor, all three cascade paths re-verified against real stored generations at the new heads: omega paired scorer 500/500 strict and flex (aggregates equal, 0.4640); gpqa paired scorer 448/448 on both models (templates path, aggregates equal to five decimals); mmlu:cot 3,207/3,207 prompts+golds byte-identical, scorer 56/56. Emitted omega requests also byte-identical on all 500 docs.
| *, | ||
| answer_format_regex: str | None = None, | ||
| answer_regexes: Sequence[str] | None = None, | ||
| answer_regexes_templates: Sequence[str] | None = None, |
There was a problem hiding this comment.
Three parameters here have no callers.
omega_500.py:74 is the only call site. It passes answer_format_regex, answer_regexes, and prefix_regexes. It never passes answer_regexes_templates, and it never overrides use_last_prefix_match or use_last_raw_match.
The template branch at lines 62-76 is about fifteen lines that nothing can currently reach.
If future ported tasks will need these let's add a comment otherwise maybe we can drop this.
There was a problem hiding this comment.
Half right — kept with a comment (a838ccd). answer_regexes_templates does have callers: the stacked GPQA (#309) and MMLU (#321) CoT tasks pass OLMO_3_ANSWER_REGEX_TEMPLATES through it; reviewing #308 in isolation hides them. The use_last_* flags genuinely have no caller overriding the defaults (ours or oe-eval's configs) — kept to mirror the reference extract_answer contract, noted as such, and now covered by direct tests either way.
| format_correct: float | ||
|
|
||
|
|
||
| def extract_answer_with_format( |
There was a problem hiding this comment.
This function has no direct tests. It is only tested through the omega scorers, which exercise one path through it.
Not covered:
- the 0.2 and 0.1 fallback scores, as distinct from each other
- use_last_prefix_match=False
- use_last_raw_match=False
- the entire answer_regexes_templates branch
There was a problem hiding this comment.
Fixed in a838ccd: tests/evals/extract/test_answer_format.py covers every cascade stage's format score (1.0 / 0.5 / 0.2 / 0.1 as distinct cases), both use_last_* flags in both settings, and the templates branch.
| flex: bool = False | ||
|
|
||
| def score(self, instance: Instance, output: LMOutput) -> float: | ||
| answer, format_correct = _extract(output.text or "") |
There was a problem hiding this comment.
_extract returns format_correct, and this line uses it only to decide the strict/flex cutoff. Then it is discarded.
oe-eval reports this value as a metric (omega.py:75). It answers a specific question: when the strict score is low, was the model wrong, or did it just format the answer differently?
Writing it to output.metadata would make it available in results.
There was a problem hiding this comment.
Fixed in a838ccd: the scorer now writes answer_format_correct to output.metadata, so results carry the wrong-vs-badly-formatted distinction the reference reports.
|
|
||
| @register("omega_500") | ||
| class Omega500(Task): | ||
| data_source = DataSource(path="saumyamalik/omega-500", split="train") |
There was a problem hiding this comment.
split="train" here has no effect.
TaskConfig.get_data_source (common/base.py:212-218) always calls with_split(self.split.value), so the class-level split = Split.TRAIN on line 108 overwrites this argument every time.
Both values are "train", so nothing is broken. But the argument looks like it controls the split, and it does not. Suggest removing it.
There was a problem hiding this comment.
Fixed in a838ccd — the argument is gone.
| name: str = "exact_match" | ||
| flex: bool = False |
There was a problem hiding this comment.
name and flex are separate fields, and every caller has to set both correctly.
OmegaExactMatchScorer(flex=True) gets the default name "exact_match". Task._get_scorers (common/base.py:554) keys scorers by name and skips duplicates, so that scorer would be dropped and its metric would report 0.0. No error, no warning.
Lines 101-102 set both fields correctly, so this is not a bug today but likely a foot gun down the road.
Consider setting name from flex in post_init, or delete the flex field and derive the behavior from the name.
There was a problem hiding this comment.
Fixed in a838ccd: __post_init__ derives the name from flex unless set explicitly, so OmegaExactMatchScorer(flex=True) now gets exact_match_flex instead of silently colliding with the strict scorer and being dropped.
…, scorer hygiene Review changes from #308 (undfined): - Move common/answer_extraction.py to evals/extract/answer_format.py and export it from the package alongside the other extractors. Keep the full reference-contract signature; the templates parameter is called by the GPQA and MMLU chain-of-thought tasks, now noted. - Carry the CoT suffix in a ChatFormatter user_template instead of concatenating in process_doc, so register_variant can swap prompt templates for the other upstream regimes (0-shot-chat, midtrain, rlzero). Emitted requests verified byte-identical on all 500 docs before and after. - Record answer_format_correct in output metadata: it distinguishes a wrong answer from a badly formatted one, and the reference implementation reports it. - Derive the scorer name from flex in __post_init__ — a flex scorer left with the strict default name was silently dropped by scorer deduplication and its metric reported 0.0. - Drop the no-op split= argument to DataSource; the class-level split always overwrites it. - Add direct tests for extract_answer_with_format: every cascade stage's format score, both use_last_* flags, and the templates branch. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01LMFjgUqHjQA3aCeB4QmEHZ
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01LMFjgUqHjQA3aCeB4QmEHZ
`_build_generation_kwargs` rejected `max_tokens <= 0`, which raises TypeError when max_tokens is None. The generation path never hit this — it calls `_resolve_max_tokens` first — but `describe_request` builds the same kwargs without resolving, and the async runner traces every request before generation. Any task using `max_tokens=None` (generate to the context limit) therefore failed on this provider before inference. None now passes the guard; a concrete non-positive limit is still rejected. Reported by Codex review on #308. Claude-Session: https://claude.ai/code/session_01LMFjgUqHjQA3aCeB4QmEHZ Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Ports OMEGA-500 from oe-eval as 0-shot chat with the boxed-answer template, temp 0.6 / top-p 0.95 / 131k tokens (mirrors
omega_500:0-shot-chat_deepseek, the OLMO_3 suite entry). Addscommon/answer_extraction.py, a shared port of oe-eval's regex-cascadeextract_answer, for reuse by other reasoning-regime tasks (GPQA CoT already builds on it in #309). Metrics:exact_match(format-demoted) andexact_match_flex(primary).Verification (CPU, against oe-eval's own code):
Before undraft: GPU parity run vs oe-eval on a fixed checkpoint.
🤖 Generated with Claude Code
https://claude.ai/code/session_01B9VUctQuzfAtrdpk4wDjEx