Skip to content

Add PopQA task - #307

Merged
abhishekraok merged 4 commits into
mainfrom
task/add-popqa
Aug 26, 2026
Merged

abhishekraok merged 4 commits into
mainfrom
task/add-popqa

Conversation

@abhishekraok

@abhishekraok abhishekraok commented Aug 22, 2026 •

Copy link
Copy Markdown
Collaborator

Ports PopQA from oe-eval. Default popqa = completion regime (15-shot, greedy, 15 tokens, \n\n stop, mirrors oe-eval popqa); popqa:chat = post-training regime (few-shot in a single user message, temp 0.6 / top-p 0.95, uncapped tokens, mirrors popqa::olmo3:adapt and popqa::hamish_zs_reasoning_deepseek).

Scoring — deliberate divergence from oe-eval

Two metrics, alias containment (verbatim / lowercased / capitalized) both:

  • exact_match_first_line (primary) — searches only up to the first newline.
  • exact_match_containment — whole output; this is what oe-eval computes. Anyone comparing against historical Olmo 3 popqa numbers must use this one.

The primary intentionally diverges because whole-output containment awards free credit proportional to a model's ramble rate: models that continue past their answer invent follow-up Q/A pairs full of plausible entity names, and any accidental alias hit counts. Measured identically on both harnesses' stored predictions for Olmo-3-7B-Instruct (22.8% ramble rate, n=14,267):

answer region oe-eval olmo-eval
whole output (containment) 0.1876 0.1845
before first invented Q: 0.1748 0.1721
first line only 0.1640 0.1623

~12.5% of containment credits on this model are spurious. The effect is a per-model level shift (saturates within ~230 tokens, so budget/caps don't matter) that ranks verbose models above equally knowledgeable concise ones — and concision is an explicit Olmo 3.5 SFT goal, so a successful SFT would look like a popqa regression under containment. Terse models are unaffected (dense/hybrid SFT audits: ~0 spurious hits; first-line ≈ containment), so the between-model gap-replication result (z>3) carries over.

First-line is the mildly conservative boundary (a genuine two-line answer scores as a miss); before-first-Q: is the mildly generous one. They bracket the truth ~1pt apart.

Verification

  • Parity scope: the 4-model cross-harness cells and the 14,267/14,267 paired scorer result in the comments certify the containment metric — that's oe-eval's metric, and it stays reported. The first-line metric has no oe-eval counterpart; its cross-harness sanity check is the table above (gap +0.0017, tighter than containment's +0.0031).
  • Shipped scorers reproduce the audit exactly on oe-eval's stored predictions: 0.1876 containment, 0.1640 first-line.
  • Prompts byte-identical in both regimes vs oe-eval's own code; golds/aliases identical.
  • 15 unit tests; ruff/ty clean; full suite 1972 passed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LMFjgUqHjQA3aCeB4QmEHZ

15-shot QA over akariasai/PopQA with the standard fixed few-shot source.
Default is the completion regime (greedy, 15 tokens, "\n\n" stop); the
:chat variant is the post-training regime (single-user-message few-shot,
temp 0.6 / top-p 0.95, 131k tokens). Scoring accepts any answer alias
appearing verbatim, lowercased, or capitalized in the response.

Prompts (both regimes), golds/aliases, and scorer verdicts verified
byte-identical against oe-eval's implementation on the first 25 test
docs and 150 synthetic responses.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01B9VUctQuzfAtrdpk4wDjEx

@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: 44fe03b89f

ℹ️ 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/popqa.py Outdated
Comment on lines +102 to +103
if self.config.num_fewshot and self.config.num_fewshot < len(instances):
instances = instances[: self.config.num_fewshot]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Honor zero-shot overrides when building fixed examples

When num_fewshot is overridden to 0—supported by task variants and CLI overrides—this condition is false, so _build_fewshot() returns all 16 fixed examples instead of none. As a result, a requested zero-shot PopQA run silently becomes 16-shot; slice the list unconditionally according to num_fewshot, or explicitly return an empty list for zero.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Confirmed and fixed in 557c5c0.

Reproduced: with num_fewshot=0, _build_fewshot() returned all 16 examples and the prompt came out with 17 segments — a requested zero-shot run was silently 16-shot. The guard treated 0 as "unset".

Now slices unconditionally and returns [] for a non-positive count. Two tests added (zero-shot yields a bare Q: … A: prompt; num_fewshot=3 yields 3). Note for anyone writing similar tests: get_task hands back a shared config object, so they restore num_fewshot via addCleanup — mutating it leaks into other tests otherwise.

Default 15-shot behavior is unchanged, so the parity runs on this PR are unaffected.

@abhishekraok

Copy link
Copy Markdown
Collaborator Author

Parity evidence (complete)

Consolidates the four per-cell comments previously posted here plus the paired scorer check, which together said this across five posts.

Cross-harness score parity — popqa::hamish_zs_reasoning_deepseek vs popqa:chat, n=14,267 each

model oe-eval olmo-eval diff z olmo-eval run oe-eval run
Olmo-3-7B-Instruct (official) 0.1876 0.1845 +0.0031 0.67 — —
dense Olmo3-7B SFT (1zhwoaof/hf_step1723) 0.1721 0.1703 +0.0018 0.41 01M0R57MR3VSJ3GB9TPXZGWGE9 01M0PW58DJFSYZZB8F79V2ZBGZ
Olmo-Hybrid-7B SFT 0.1865 0.1861 +0.0004 0.09 01M0RBP7Y5Z53PANT0NDHD07E9 —
Qwen3-8B (official) 0.31289 0.31254 +0.00035 0.06 01M0R6SER776WAFB74CGVYGXFN 01M0P4FF51FG5WZDW2GWVQ0KSW

The dense cell is the tightest constraint (SE_diff 0.0045). Predictions were sanity-checked per instance there (2,429/14,267 correct recomputed), and both sides verifiably served correct YaRN — without that the known rope bug shows up as a spurious ~1.3-point "harness" gap.

Between-model gaps replicate across harnesses

A port could match on average while scrambling per-item behavior, so this is the stronger check:

harness dense hybrid gap z
oe-eval 0.1721 0.1865 −0.0144 3.17
olmo-eval 0.1703 0.1861 −0.0158 3.49

Both independently resolve the hybrid ahead by ~1.5 points at z>3 — the ranking signal these harnesses are actually used for is preserved.

Token distributions and cap audits

model oe-eval (med/p90/p99) olmo-eval (med/p90/p99) olmo-eval cap binding
Qwen3-8B 524 / 1147 / 1939 511 / 1131 / 1916 4096 24 items (0.17%)
Olmo-3-7B-Instruct 63 / 726 / 59,412 59 / 487 / 8,192 8192 3.25% (degenerate tail)
Olmo-Hybrid-7B SFT — median 4 2048 4/14,267

Near-identical distributions independently confirm both harnesses elicit the same generation behavior, not just the same mean. The Instruct cap asymmetry is bounded by the omega budget-decomposition result on #308 (runaway generations don't convert regardless of budget) and the sub-cap distributions match.

Paired offline scorer check — zero sampling noise

oe-eval's own stored Qwen3-8B generations scored with this PR's PopQAContainsScorer, compared per instance against oe-eval's own verdicts. Identical inputs both sides:

instances               : 14267
per-instance agreement  : 14267/14267 = 100.0000%
oe-eval aggregate       : 0.31289
this PR's scorer        : 0.31289
paired diff             : 0.00000

Strictly stronger than the sampled cells above, which at T=0.6 only bound gross error. The two scorer implementations never disagree on a single one of 14,267 real generations, including the degenerate/rambling tail that synthetic cases don't cover. For this task's scorer, the "item-level untested" caveat on #311 no longer applies. (Item-level agreement of generations across harnesses remains untested and isn't expected at T=0.6 — different claim.) Worth doing routinely: filed as #315.

Operational note

Completion in ~2 minutes is normal for this task — the 15 fixed few-shot examples train terse answers (median output 4 tokens on SFT checkpoints). Runtime is not a silent-no-op signal in either direction; check num_tokens and answer strings.

`if self.config.num_fewshot and ...` treated 0 as "unset", so a run
requesting zero shots silently got all 16 fixed examples. Slice
unconditionally and return nothing for a non-positive count.

Reported by Codex review on #307.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LMFjgUqHjQA3aCeB4QmEHZ

@undfined undfined left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm!

Whole-output containment credits an alias appearing anywhere, and models
that ramble past their answer invent follow-up Q/A pairs full of
plausible entity names — free credit proportional to a model's ramble
rate (+1.3-2.4pt on Olmo-3-7B-Instruct at a 22.8% ramble rate, measured
identically on both harnesses' predictions, n=14,267). That ranks
verbose models above equally knowledgeable concise ones.

The primary metric now searches only up to the first newline
(exact_match_first_line). Whole-output containment stays as
exact_match_containment: it is what the reference implementation
computes, so it remains the cross-harness and historical comparison
point. On oe-eval's stored Olmo-3-7B-Instruct predictions the shipped
scorers reproduce the audit exactly: 0.1876 containment, 0.1640
first-line.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LMFjgUqHjQA3aCeB4QmEHZ
@abhishekraok
abhishekraok merged commit 464525f into main Aug 26, 2026
10 checks passed
@abhishekraok
abhishekraok deleted the task/add-popqa branch August 26, 2026 00:35
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