Skip to content

Add HELMET ICL and LongQA tasks (4k-128k) - #287

Merged
jopetty merged 5 commits into
allenai:jacksonp/ladderfrom
jopetty:helmet-plus-icl-ladder
Aug 14, 2026
Merged

jopetty merged 5 commits into
allenai:jacksonp/ladderfrom
jopetty:helmet-plus-icl-ladder

Conversation

@jopetty

@jopetty jopetty commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Targets jacksonp/ladder, which already carries the HELMET-plus recall work (squash-merged as f1abe85, "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 in common/{scorers,metrics}/__init__.py, where ladder'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.

category tasks lengths
recall json_kv 4k–2m (already on ladder)
longqa infbench_qa_eng, infbench_choice_eng 4k–128k
icl trec_coarse, trec_fine, banking77, clinic150, nlu 4k–128k

These 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 narrativeqa or banking77 task.

Commits

Each is independently reviewable; metric infrastructure is separate from the tasks that use it.

  • b5fb646 ICL tasks
  • 682018e ICL length caveat + measurement script
  • 0bd6f44 ROUGE-L F1/recall scorers and metrics
  • 82e33ea infbench_qa_eng
  • 3d679d1 infbench_choice_eng

Things worth a reviewer's attention

Three ICL source datasets no longer load. datasets 4.0 dropped script-based loading, which HELMET relies on via trust_remote_code. CogComp/trec and xingkunliuxtracta/nlu_evaluation_data are repointed to the Hub's auto-converted refs/convert/parquet branches; banking77 to legacy-datasets/banking77, since PolyAI/banking77 hosts 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_*__4096 is really ~3.2–3.5k tokens, __131072 is ~104–108k. The counts are kept verbatim anyway so results stay comparable to published HELMET; the shortfall is documented in helmet_tasks.py, and scripts/internal/calibrate_helmet_icl_shots.py measures it (or generates Olmo-3-calibrated counts, if we ever decide comparability isn't worth it). Note this leaves ICL inconsistent with json_kv, which is Olmo-3-calibrated — a helmet_all__4096 average 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 via AVERAGE_OF_AVERAGES rather 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 only json_kv extends, so a combined suite there would be a rename of helmet_recall__* whose composition silently differs from the same name at shorter lengths, which is how a length sweep becomes a misleading trend line. Use helmet_recall__* for the extended tiers.

Two deliberate deviations from a literal port of load_infbench, both measured rather than assumed:

  • HELMET's >=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.
  • Truncation is memoized per distinct context, since 351 questions come 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.

Verification

  • ROUGE matches HELMET's calculate_metrics byte-for-byte across 5 cases (multi-reference, no-overlap, empty prediction).
  • InfbenchChoiceScorer agrees with HELMET's choice_post_process on all 11 cases tried — bare/lowercase/trailing-period letters, prefixed (Answer: B), embedded (The answer is B. Paris), wrong, and empty.
  • ICL answer parser is byte-identical to HELMET's parse_output across 11 cases.
  • ICL correctness: each instance's demo labels match that instance's own label permutation and the answer field agrees (20/20); deterministic per seed; demo label balance correct.
  • LongQA truncation lands exactly on budget (3886/3886 at 4k, 65326/65326 at 64k).
  • rouge-score is the only lockfile addition — verified no other package versions moved.
  • ruff, ty, and all 820 existing tests pass on the rebased branch.

Known caveat

infbench_choice_eng can 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 at size - 200 - 10 — and is 0.3% at 4k, less above.

Not included

narrativeqa and both Summ tasks (infbench_sum_eng, multi_lexsum) are LLM-judged in HELMET — gpt-4-score/gpt-4-f1 are their primary metrics, so they need judge integration rather than another metric. That's one coherent follow-up.

🤖 Generated with Claude Code

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.
@jopetty
jopetty merged commit 5cfac09 into allenai:jacksonp/ladder Aug 14, 2026
1 check passed
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.

1 participant