Repository navigation
Add HELMET ICL and LongQA tasks (4k-128k) - #287
Merged
Merged
Conversation
Carries HELMET's five ICL tasks (trec_coarse, trec_fine, banking77, clinic150, nlu) into olmo-eval, keeping them HELMET-namespaced rather than factoring them out: the length-controlled construction (shot count per length tier, shuffled integer labels) is HELMET's, not a property of the underlying datasets, so they aren't interchangeable with standalone tasks. Three of the five source datasets no longer load: datasets 4.0 dropped script-based loading, which HELMET relies on via trust_remote_code. trec and nlu_evaluation_data resolve to the Hub's auto-converted parquet branch, and banking77 to legacy-datasets/banking77, since PolyAI/banking77 hosts only the script. Split sizes and label counts verified against HELMET's hardcoded values (6/50/77/151/68). Also: - helmet_tasks.py now takes per-task context_sizes, since coverage is ragged (json_kv 4k-2m, ICL 4k-128k only). - helmet_all__* aggregates category suites via AVERAGE_OF_AVERAGES instead of flat-averaging tasks, so recall isn't outweighed 5:1 by ICL's task count, and is only registered where >1 category exists -- above 128k it would silently be a rename of helmet_recall__* whose composition differs from the same suite at shorter lengths. Verified: demo labels match each instance's own permutation and the answer field agrees (20/20); output is deterministic per seed; the answer parser is byte-identical to HELMET's parse_output across 11 cases; all five datasets produce well-formed prompts. ruff, ty, and 820 existing tests pass.
HELMET fit its ICL shot counts against a Llama-2-era tokenizer, so under Olmo 3's larger vocabulary the rendered prompts land at 0.78-0.85x their nominal length: icl_*__4096 is really ~3.2-3.5k tokens and __131072 is ~104-108k. Keeps HELMET's counts verbatim so our ICL numbers stay directly comparable to published HELMET results, and records the measured shortfall in-file so it is visible when reading a length sweep rather than being a silent property of the tasks. Note this leaves ICL inconsistent with json_kv, which is calibrated against Olmo 3 and does hit its nominal lengths -- a helmet_all__4096 average therefore mixes a 4.1k-token task with ~3.3k-token ones. Adds scripts/internal/calibrate_helmet_icl_shots.py to measure that shortfall for any tokenizer. It also prints Olmo-3-calibrated counts, but is explicitly documented as a diagnostic rather than the source of the committed values, and labels that output as a deliberate trade so it doesn't get pasted in by accident.
Adds the rougeL_f1 metric HELMET uses as the primary score for infbench_qa_eng, plus rougeL_recall (HELMET's metric for qmsum-style tasks), neither of which olmo-eval had. Backed by Google Research's rouge_score with use_stemmer=True, matching HELMET so numbers stay comparable to published results -- hand-rolling ROUGE-L is easy to get subtly wrong, since tokenization and stemming both move the score. Verified byte-identical to HELMET's calculate_metrics across five cases including multi-reference, no-overlap, and empty-prediction. Scoring takes the max over all reference answers, as HELMET does. Reads either multi-reference metadata convention already present in this repo (all_answers, used by the SQuAD scorer; all_gold_answers, used by RULER/HELMET tasks), falling back to a single gold_answer. rouge-score adds cleanly: the lockfile diff is the one new package, no version changes elsewhere, and all 820 existing tests pass.
Registers helmet_infbench_qa_eng__{4096..131072}, scored with the rougeL_f1
metric added in the previous commit -- HELMET's primary metric for this task.
Capped at standard HELMET's lengths since the context is a real book and
can't be stretched the way json_kv's synthetic context can.
Contexts are truncated with a fixed reference tokenizer (Llama 2, via an
ungated mirror so the repo needs no gated-model access) rather than the
tokenizer of the model under test. That is what makes every model see the
same text, and it keeps results comparable to published HELMET -- the same
trade already taken for the ICL shot counts.
Two deviations from a literal port, both verified safe:
- HELMET's >=65536-token filter is skipped. It is a no-op (the shortest
InfiniteBench story is ~78k reference tokens, and HELMET itself calls it
"just a sanity step"), which lets us sample first and truncate only the
rows we keep instead of tokenizing all 351 book-length contexts.
- Truncation is memoized per distinct context, since 351 questions are drawn
from just 69 stories.
Demos are still drawn from the full pool, not the sampled subset, so they
don't depend on how many instances are evaluated.
Also adds use_chat_template handling to the shared HelmetTask: HELMET runs
LongQA in chat format, where the "Answer:" prefix is not fed in as a partial
assistant turn. json_kv and ICL are unaffected and keep their prefixes.
Verified: truncation lands exactly on budget (3886/3886 at 4k, 65326/65326 at
64k), the rendered 4k prompt is 4002 reference tokens, the truncation notice
is present, gold answers reach the scorer as a list, and ROUGE gives 1.0 on
exact gold with sensible partial credit. ruff, ty, and 820 tests pass.
Registers helmet_infbench_choice_eng__{4096..131072}: same book-length story
as infbench_qa_eng, but with four options and a single-letter answer, scored
by exact match.
Reuses the InfiniteBench loader and task class, with a per-task metrics_key
so subsets sharing a loader can score differently (ROUGE for qa_eng, exact
match here) instead of both being pinned to the task kind.
Adds InfbenchChoiceScorer, which ports HELMET's choice_post_process: a
response counts as correct if the raw generation, or its "Answer:"-stripped
form, normalizes to either the bare letter or "letter. option text", or if
the latter appears anywhere in the generation -- the last rule being what
credits a model that answers in a sentence. It reads output.text rather than
only extracted_answer because that rule is defined against the untouched
generation. Verified to agree with HELMET on all 11 cases tried, including
bare/lowercase/trailing-period letters, prefixed and embedded answers, wrong
answers, and empty output.
Note the rendered prompt can run slightly over nominal at the smallest tier
(~4109 vs 4096 tokens at 4k), because the options block eats into HELMET's
fixed 200-token prompt reserve. This is faithful -- HELMET budgets both
subsets identically at size - 200 - 10 -- and is 0.3% at 4k, less above.
HELMET's LongQA category is now complete except narrativeqa, whose primary
metric is LLM-judged. ruff, ty, and 820 tests pass.
This was referenced Aug 17, 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.
Targets
jacksonp/ladder, which already carries the HELMET-plus recall work (squash-merged asf1abe85, "Helmet plus recall (#283)"), so this diff is only the incremental 5 commits.Same content as jopetty#3, rebased onto
ladder— the one conflict was a competing import incommon/{scorers,metrics}/__init__.py, whereladder's ngram_copying work (#285) and this branch's ROUGE work both add to the same block. Resolved by keeping both; verified they coexist at import time and that the full test suite still passes.Extends the HELMET integration beyond recall: the five ICL tasks and two of the three LongQA tasks, at standard HELMET's 4k–128k lengths.
helmet_all__{size}now spans 8 tasks across three categories.json_kvladder)infbench_qa_eng,infbench_choice_engtrec_coarse,trec_fine,banking77,clinic150,nluThese are kept HELMET-namespaced rather than factored into standalone tasks (as RULER was in #276): the length-controlled construction — shot count per length tier, shuffled integer labels, truncation to a token budget — is HELMET's, not a property of the underlying datasets, so they aren't interchangeable with a generic
narrativeqaorbanking77task.Commits
Each is independently reviewable; metric infrastructure is separate from the tasks that use it.
b5fb646ICL tasks682018eICL length caveat + measurement script0bd6f44ROUGE-L F1/recall scorers and metrics82e33eainfbench_qa_eng3d679d1infbench_choice_engThings worth a reviewer's attention
Three ICL source datasets no longer load.
datasets4.0 dropped script-based loading, which HELMET relies on viatrust_remote_code.CogComp/trecandxingkunliuxtracta/nlu_evaluation_dataare repointed to the Hub's auto-convertedrefs/convert/parquetbranches;banking77tolegacy-datasets/banking77, sincePolyAI/banking77hosts only the loading script and no data. Split sizes and label counts were verified against the values HELMET hardcodes (6/50/77/151/68).ICL prompts render ~20% short of nominal. HELMET fit its shot counts against a Llama-2-era tokenizer, so under Olmo 3 they come out at 0.78–0.85× —
icl_*__4096is really ~3.2–3.5k tokens,__131072is ~104–108k. The counts are kept verbatim anyway so results stay comparable to published HELMET; the shortfall is documented inhelmet_tasks.py, andscripts/internal/calibrate_helmet_icl_shots.pymeasures it (or generates Olmo-3-calibrated counts, if we ever decide comparability isn't worth it). Note this leaves ICL inconsistent withjson_kv, which is Olmo-3-calibrated — ahelmet_all__4096average mixes a 4.1k-token task with ~3.3k-token ones.LongQA truncates with a fixed reference tokenizer (Llama 2, ungated mirror), not the model under test. That's what makes every model see the same text, and it matches HELMET. Same nominal-vs-realized caveat as above.
Two suite-semantics changes vs. what's currently on
ladder.helmet_all__*now aggregates category suites viaAVERAGE_OF_AVERAGESrather than flat-averaging tasks — otherwise ICL's five tasks would outweigh recall's one 5:1. And it's only registered where more than one category exists: above 128k onlyjson_kvextends, so a combined suite there would be a rename ofhelmet_recall__*whose composition silently differs from the same name at shorter lengths, which is how a length sweep becomes a misleading trend line. Usehelmet_recall__*for the extended tiers.Two deliberate deviations from a literal port of
load_infbench, both measured rather than assumed:>=65536-token filter is skipped — it's a no-op (shortest InfiniteBench story is ~78k reference tokens, and HELMET itself calls it "just a sanity step"), which lets us sample first and truncate only the rows we keep instead of tokenizing all 351 book-length contexts.Demos are still drawn from the full pool, not the sampled subset, so they don't depend on how many instances are evaluated.
Verification
calculate_metricsbyte-for-byte across 5 cases (multi-reference, no-overlap, empty prediction).InfbenchChoiceScoreragrees with HELMET'schoice_post_processon all 11 cases tried — bare/lowercase/trailing-period letters, prefixed (Answer: B), embedded (The answer is B. Paris), wrong, and empty.parse_outputacross 11 cases.answerfield agrees (20/20); deterministic per seed; demo label balance correct.rouge-scoreis the only lockfile addition — verified no other package versions moved.Known caveat
infbench_choice_engcan render slightly over nominal at the smallest tier (~4109 vs 4096 tokens at 4k) because the options block eats into HELMET's fixed 200-token prompt reserve. This is faithful — HELMET budgets both InfiniteBench subsets identically atsize - 200 - 10— and is 0.3% at 4k, less above.Not included
narrativeqaand both Summ tasks (infbench_sum_eng,multi_lexsum) are LLM-judged in HELMET —gpt-4-score/gpt-4-f1are their primary metrics, so they need judge integration rather than another metric. That's one coherent follow-up.🤖 Generated with Claude Code