Skip to content

Share the long-context task base, task registration and JSONL/Hub helpers between RULER and HELMET - #455

Draft
jopetty wants to merge 32 commits into
allenai:mainfrom
jopetty:long-context-shared-base
Draft

jopetty wants to merge 32 commits into
allenai:mainfrom
jopetty:long-context-shared-base

Conversation

@jopetty

@jopetty jopetty commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Stacked on #281. This branch is built on helmet-plus-recall, so until #281 merges the diff here includes its commits. Review only the last two commits:

  • 54f25b5: Share JSONL and Hub download helpers across RULER and HELMET
  • d96f430: Share one long-context task base and drop the class factories

This addresses the three main items in #454.

Shared task base. RulerTask and HelmetTask were near line-for-line copies. Both now subclass LongContextTask in evals/tasks/common/long_context.py, which holds data loading, instance caching, prompt rendering, metadata, request formatting and answer extraction. Each family adjusts it through three hooks:

  • render_prompt: RULER keeps the prebuilt input prompts from its data files, while HELMET renders from templates.
  • instance_id: RULER uses the row's index.
  • scoring_metadata: HELMET adds its ALCE, judge and re-ranking fields.

Task registration. Both families generated a subclass per task name with type(...) and globals() injection. A new registry helper, register_configured(name, cls, **config), registers one class under many names with per-name TaskConfig fields, and it replaces both factories. Each family's stop sequences are now a named constant, so the difference between them is explicit. RULER stops on \n, Ċ, ĊĊ and <0x0A>; HELMET stops on \n only, as upstream does.

JSONL and Hub helpers. _load_jsonl was defined four times, and the Multi-LexSum and InfiniteBench loaders had their own inline copies. The hf_hub_download wrapper was copied between the RULER and helmet-plus loaders. These now live in two modules:

  • data/jsonl.py: load_jsonl, sample_jsonl_rows, sample_jsonl_by_key
  • data/hub.py: download_dataset_file, whose revision argument is required

Nothing observable changes.

  • All 216 RULER and HELMET task hashes are identical before and after.
  • So are 1,825 rendered requests (prompt, sampling params, gold answer) snapshotted from real data: RULER and HELMET RULER NIAH at 4k/16k/128k, and HELMET ICL.
  • Registered tasks still pickle.
  • Lint, format and ty are clean apart from the existing diagnostics in untouched files. The unit suite passes: 3058 passed, 35 skipped.

The smaller items in #454 (truncation helpers, metric and scorer reuse, placement, HELMET's per-kind subclasses) are left for a follow-up.

🤖 Generated with Claude Code

jopetty and others added 30 commits August 13, 2026 21:10
Registers helmet_json_kv__{262144,524288,1048576,2097152} tasks (and
helmet_recall__*/helmet_all__* suites) that read the ai2-internal
allenai/helmet-plus dataset off the Hub, extending HELMET's json_kv
recall task past its standard 128k ceiling. Follows the same
task/suite registration pattern already used for RULER.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
helmet-plus now covers the original 4k/8k/16k/32k/64k/128k tiers in
addition to the 256k/512k/1m/2m extension, making it a strict superset
of standard HELMET's json_kv lengths. Task/suite generation already
looped generically over CONTEXT_SIZES, so this only required adding
the six shorter tiers to LENGTH_NAMES.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
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.
Registers helmet_narrativeqa__{4096..131072}, HELMET's third LongQA task and
the first here graded by an LLM judge rather than string overlap.

Ports HELMET's LongQA rubric (scripts/eval_gpt4_longqa.py) onto olmo-eval's
existing LLMJudgeScorer, keeping upstream's judge model and temperature
(gpt-4o-2024-05-13 @ 0.1) so scores stay comparable. HELMET's gpt-4-score is
fluency (0/1) x correctness (0-3); that product is divided by 3 here so the
scorer honors the [0,1] contract its base class documents and doesn't
outweigh proportion-valued metrics in a suite average -- multiply a reported
score by 3 to recover HELMET's number. Verified the parse+score path agrees
with HELMET across 7 responses including trailing-JSON, multiple JSON
objects, missing keys, and malformed output.

The judge is given the bare question via new `judge_question` metadata, not
Instance.question -- the latter is the fully rendered prompt, so using it
would ship a book-length context to the judge on every call. Verified the
built judge prompt is ~2.2k chars and contains no story text.

Loading narrativeqa is the expensive part: HELMET keeps only documents over
131072 reference tokens, which it establishes by tokenizing all 10.5k rows of
the test split. Two shortcuts avoid that without changing which instances are
selected -- an exact character-count lower bound (a document cannot have more
tokens than characters), and stopping once enough rows are found, which is
equivalent because HELMET shuffles before filtering and then takes a prefix.
Loading 3 instances takes ~11s rather than tokenizing the whole split.

Judged tasks change how suites should be run, so following the split in
suites/science.py: per-category suites and helmet_all__* now include
narrativeqa and therefore need a judge configured, while new
helmet_nojudge__* suites are the subset that runs without one.
HELMET scores msmarco_rerank_psg with NDCG@10, which olmo-eval had no metric
for -- it had no ranking metrics at all. This adds the metric ahead of the
task itself, which additionally needs its pre-computed retrieval data hosted
before it can run.

Reimplements the formula rather than taking on pytrec_eval, a compiled C
extension, as a permanent dependency. Determined trec_eval's exact
convention empirically instead of assuming it -- linear gain
(rel / log2(rank+1)), not the exponential 2^rel-1 variant -- then verified
agreement with pytrec_eval across 900 randomized comparisons spanning
partial rankings, over-long rankings containing unjudged ids, and all-zero
relevance: zero mismatches.

The ideal ranking is drawn from every judged document rather than only those
the model returned, so omitting a relevant document costs score instead of
being silently ignored. Accepts relevance judgements as a mapping or as
HELMET's [[doc_id, label], ...] pair list.
Registers helmet_kilt_{nq,triviaqa,hotpotqa,popqa}__{4096..131072}: an
open-domain question plus a stack of retrieved Wikipedia passages. Data comes
from allenai/helmet-plus, whose kilt/manifest.json maps each length tier to
its pre-retrieved file, so no filenames are hardcoded. Capped at standard
HELMET's lengths since retrieval depth is baked into the files.

Adds SubstringExactMatchScorer, which HELMET's RAG metric needs and olmo-eval
lacked. The existing SubstringRecallScorer returns the *fraction* of gold
answers found, which is wrong here: these gold answers are aliases for one
another, so a model answering Natural Questions correctly with one surface
form would score 1/N rather than 1. The new scorer takes the max and applies
HELMET's normalization (lowercase, strip punctuation, drop articles, collapse
whitespace); verified identical to HELMET across 7 cases, where the recall
scorer would have given 0.33-0.67 for fully correct answers.

Two behaviors worth knowing, both faithful to HELMET:

- `limit` caps *questions*, not instances. Each question appears once per
  gold-passage depth -- 6 for nq/triviaqa/popqa (the dep6 in the filenames:
  0.0, 0.2, 0.4, 0.6, 0.8, 0.95) and 3 for hotpotqa -- so scores average over
  where in the context the answer sits, which is the "lost in the middle"
  effect these tasks measure. A limit of 100 therefore yields ~600 nq
  instances. Documented in the loader; confirmed 6/3/6 empirically.
- PopQA is restricted to long-tail entities via log10(s_pop) < 3, encoded in
  HELMET's task name as kilt_popqa_3. Verified this removes 50% of rows
  rather than being a no-op.

RAG joins the suite as its own category, so helmet_all__4096 now spans 13
tasks across recall, rag, longqa and icl. ruff, ty, and 820 tests pass.
Registers helmet_msmarco_rerank_psg__{4096..131072}: a query plus ID-tagged
candidate passages the model must return in relevance order, scored with the
NDCG@10 metric added earlier. Data comes from allenai/helmet-plus via
msmarco/manifest.json; capped at standard HELMET's lengths since candidate
depth is fixed in the pre-retrieved files.

Ports HELMET's parse_rankings. Upstream returns a dict of id -> descending
score for pytrec_eval; this returns the equivalent ranked list, which is what
NDCGScorer consumes. Verified the two agree on 7 cases including bracketed
IDs, duplicate ids (first position wins), no-separator output, and
unparseable text.

Relevance judgements now flow from the loader into instance metadata as
`qrel`, which is where NDCGScorer reads them.

Sanity-checked scoring on real data: a gold-order ranking scores 1.0, its
reverse 0.26, and unparseable output 0.0.

Note re-ranking multiplies instances the same way RAG does -- these files
carry three gold-position variants per query, so a limit of N yields ~3N
instances.

HELMET support now covers 5 of 6 categories (88 tasks): recall, rag, rerank,
longqa, icl. Remaining are the two summarization tasks and ALCE.
Registers helmet_{infbench_sum_eng,multi_lexsum}__{4096..131072}, completing
HELMET's six task categories: 100 tasks now span recall, rag, rerank, longqa,
summ and icl.

Adds HelmetSummJudgeScorer, which unlike the LongQA judge needs three calls
per summary -- fluency, key-point recall, and sentence-level precision --
combined into HELMET's gpt-4-f1 as
fluency * 2 * rec * prec / (rec + prec). Fluency multiplies rather than
averages, so a disfluent summary scores zero however much it covers; that is
deliberate upstream, since degenerate repetition otherwise scores well on
recall. Verified the combination matches HELMET on 5 cases including the
fluency gate and both zero-denominator paths, and that missing or malformed
judge output scores 0.0 rather than raising.

The six rubrics (~55KB, each with worked examples) were extracted
programmatically from eval_gpt4_summ.py rather than retyped, and verified to
round-trip identically -- a paraphrase would silently shift scores. Book
variants grade novels, plain variants grade civil lawsuits.

multi_lexsum reads from allenai/helmet-plus instead of calling load_dataset,
which no longer works: datasets 4.0 dropped script-based loading and the Hub's
parquet conversion has no v20230518 config. The hosted multi_lexsum_val.jsonl
turned out to be the full validation split -- sources, both summary lengths,
and the pre-extracted key points -- so bypassing the broken path loses
nothing and pins the data besides.

Two details that differ from the other long-context tasks: multi_lexsum
reserves 300 tokens of each tier for prompt and buffer where the rest reserve
200, and the precision rubric grades against the expert *long* summary rather
than the short one the model is asked to match. Both follow upstream.

Verified no source text leaks into judge prompts, that the correct rubric
variant is selected per task, and that key points and expert summaries reach
the scorer through instance metadata. All three summarization tasks are
judge-gated, so they appear in helmet_all__* but not helmet_nojudge__*.

ruff, ty, and 820 tests pass.
Registers helmet_alce_{asqa,qampari,asqa_nocite,qampari_nocite}__{4096..131072}
-- 124 HELMET tasks now, covering all seven of HELMET's reported categories.

Scores ALCE's answer-correctness half only:
- str_em (ASQA): the fraction of a question's disambiguated sub-questions the
  response answers, so partial coverage earns partial credit.
- qampari_rec_top5 (QAMPARI): recall over an answer set, capped at five so
  questions with long answer lists don't dominate the average.
Both verified identical to ALCE's eval_alce.py across 6 cases, including
generations carrying inline citations.

Deliberately NOT scored: citation_rec / citation_prec, which measure whether
each claim is supported by the sources it cites. Those need AutoAIS, an 11B
NLI model, wired up as an auxiliary provider -- a separate change. The tasks
are useful without it, just silent on grounding, which is arguably ALCE's more
interesting half.

Scoring runs on a normalized generation (newlines collapsed, chat end-marker
dropped, inline [1] markers stripped) so a well-cited answer isn't penalized
for carrying its citations, matching upstream's preprocessing.

Unlike the RAG tasks, every ALCE tier reads one file -- a fixed 2000-document
pool per question -- and shows a prefix of it, so length is set by how many
documents are displayed. The nocite variants run zero-shot with a larger
generation budget, per HELMET's configs; verified they emit no worked
examples while still showing the full document set.

ruff, ty, and 820 tests pass.
The provider hardcoded AutoModelForCausalLM, so olmo-eval could not run any
encoder-decoder model. This blocks ALCE's citation metrics, which score with
AutoAIS (google/t5_xxl_true_nli_mixture, a T5) -- and vLLM is not an
alternative route: its 0.19.1 model registry has no T5 entry and no true
encoder-decoder support, only multimodal *ForConditionalGeneration models
whose decoders are still causal.

Detects encoder-decoder models from their config rather than adding a config
flag, so nothing needs declaring at the call site and existing causal models
are unaffected. Three touch points:

- pick AutoModelForSeq2SeqLM when config.is_encoder_decoder
- skip the prompt slice in generate(): a causal LM returns prompt +
  continuation, but an encoder-decoder returns only decoder tokens, so
  output_ids[prompt_len:] would eat the answer
- skip the logprob path for encoder-decoder, since it reads logits at
  prompt-relative offsets of one concatenated sequence, which only holds for
  a causal LM. AutoAIS needs no logprobs; encoder-decoder support there would
  require a decoder-side forward pass.

Verified auto-detection returns True for google/t5_xxl_true_nli_mixture and
t5-small, and False for Olmo 3 and gpt2, so the causal path is untouched.

Caveat: the generate path itself is NOT exercised locally -- torch is
Linux/CUDA-gated and absent from the macOS dev environment -- so the
seq2seq branch needs a smoke test on a GPU node before AutoAIS is wired up.
The previous commit widened the transformers surface the provider imports
(AutoConfig, AutoModelForSeq2SeqLM), which broke
test_huggingface_provider_passes_force_download_to_tokenizer_and_model --
it stubs sys.modules["transformers"] with only the two names the old code
used. I pushed that commit before reading the test output; this repairs it.

- extends the stub with the new names, and asserts a causal model is *not*
  routed through the seq2seq class
- adds a test for the new branch: an encoder-decoder config must load via
  AutoModelForSeq2SeqLM and must not touch the causal class
- makes the provider's log line use getattr(auto_class, "__name__", ...);
  a log statement should not raise, and it did against a test double

Full suite: 1996 passed, 26 skipped.
…s, tests

Findings from a full review of the 13-commit HELMET integration, fixed here.

Scoring fidelity (would have shifted reported numbers):

- ICL exact match now uses HELMET's normalization. The generic
  ExactMatchScorer only lowercases and strips, but HELMET's exact_match
  (drqa) also removes punctuation and articles -- so "label: 42." or a quoted
  answer scored 0 here and 1 under HELMET. Realistic outputs, since
  stop-at-newline sampling leaves trailing punctuation intact. Added
  HelmetExactMatchScorer and wired it into the ICL metric; divergence
  demonstrated against upstream's normalization before fixing.

- ROUGE scorers now take the max over the raw and extracted generations,
  matching HELMET's default_post_process. Scoring only the extracted answer
  under-credited any multi-line generation whose answer-prefix parse picked
  the wrong line.

Robustness:

- HelmetLongQAJudgeScorer inherited the base ascore_with_context, whose
  provider path defaults to max_tokens=10 -- sized for letter-grade judges.
  This rubric asks for step-by-step reasoning before a JSON verdict, so any
  provider-wired run would truncate every response and silently score zero.
  Overridden to pass the judge budget, mirroring the summ scorer.

- The KILT loader now samples by streaming over the file instead of parsing
  all of it: the 128k tiers are 1-3GB of JSONL that expand severalfold as
  dicts (upstream avoids this via arrow memory-mapping). Selection verified
  byte-identical to the old path on real nq and popqa files across caps of
  5/50/None, including the popularity-filter interaction.

Tests: the branch's verification lived in throwaway shell commands; none of
it survived as regression protection. Added 44 offline tests covering the
ranking/label parsers (HELMET reference cases), NDCG against pytrec_eval
values, all six new scorers including the fluency gate and malformed-judge
paths, the summ rubric brace-escaping, ICL demo balancing, the streaming
sampler (fixture file), and the task/suite inventory -- 124 tasks, category
counts, context budgets, judged-task exclusions, and the absence of
helmet_all above 128k.

Also refreshed module docstrings that still described the branch as
json_kv-plus-ICL with narrativeqa the only judged task.

Reviewed but left alone: scorer-instance handling (Scorer.__call__ returns
self, so metrics accept instances -- suspected bug, disproven), the choice
scorer's embedded-answer rule, popqa key handling, and the ALCE
preprocessing chain, all verified against upstream during review.

Full suite: 2040 passed, 26 skipped.
A demo run of the judged HELMET tasks crashed at results aggregation --
after all 1800 instances were scored and every judge call paid for -- with
"Object of type function is not JSON serializable". The chain:
TaskConfig.to_dict() -> Metric.to_dict() -> Scorer.to_dict(), whose
dataclasses.asdict includes judge_fn, the live async closure built by
build_openai_judge_fn. compute_task_hash then json.dumps's that dict.

Class-valued scorers serialize as __name__ (why every non-judge task was
fine), and the wildguard judge dodges it because provider_name nulls
judge_fn in __post_init__ -- the HELMET judges are just the first
judge_fn-configured scorers to reach aggregation. SimpleQAJudgeScorer had
the same latent bug.

Fixed with a to_dict override on LLMJudgeScorer that replaces the closure
with a stable "<configured>" marker. That is also more correct for hashing:
a function repr embeds a memory address, so even a serializable form would
have made task hashes differ run to run. No deserialization path needs the
function back (verified: no from_dict in scorers/metrics).

Regression tests: every registered helmet task's config now round-trips
through json.dumps (instantiation touches no data, so the sweep is cheap),
and judge scorer serialization is asserted stable across independent
constructions. Reproduced the crash via the real config path before fixing;
verified the same path serializes after.
…vision, stream sampling

The long-context recall extension (256k-2m json_kv tiers) moves to a
follow-up PR so this one can be reviewed as a port of HELMET at its own
context lengths. The two review requests on the original diff are addressed
here: downloads from allenai/helmet-plus are pinned to a fixed revision, and
JSONL loaders sample without parsing the whole file first. The json_kv
sampler keeps the same selection as the full-load path; the KILT
question-level sampler moves to helmet_loader and is reused for MS MARCO.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
# Conflicts:
#	pyproject.toml
#	src/olmo_eval/common/metrics/__init__.py
#	src/olmo_eval/common/scorers/__init__.py
#	src/olmo_eval/inference/providers/huggingface.py
#	uv.lock
HELMET's pre-retrieved KILT files overshoot their nominal length tier (the
128k files are 142-155k Llama-2 tokens) and HELMET relies on trimming the end
of the passage block at inference time. The KILT loader skipped that step, so
at 128k a sizeable fraction of prompts exceeded a 131072 max_model_len, and
because the in-process vLLM provider submits a whole mixed-task batch in one
call, each overflow also hard-failed every other KILT instance sharing its
batch, including 8k-64k ones.

The loader now measures the rendered prompt with the fixed reference tokenizer
the other long-context loaders use and removes the overflow from the passages
alone, leaving instruction, demos and question intact. The budget is the tier
minus the generation length, matching HELMET's max_length - generation_max_length.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
(cherry picked from commit 8037efd)
A MetricName or bare str primary_metric names one of the task's own metrics.
Leaving it unresolved means the task contributes nothing to a parent suite's
average-of-averages, which then silently falls back to whichever metric name
its children share. HELMET's per-task primary metrics rely on this.

(cherry picked from commit 9972939, base.py hunk only)

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Reverts 6dd12e8, which taught TaskConfig to resolve a named primary
metric. That fix is right but changes the task hash of every existing
RULER task, so it is split out into its own PR. HELMET no longer depends
on it: each task hands TaskConfig its Metric instance directly.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The KILT loader samples questions and keeps each one at all of its
gold-passage depths, but the task also set an instance `limit`, so
prepare_task_items re-sampled the rows and queued many questions at only
some depths. The question cap is now its own `max_questions` setting and
KILT tasks leave `limit` unset. A test runs the real prepare_task_items
over a 300-question x 6-depth stub and checks every queued question
appears at all six depths.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The judge model, temperature and token budget were baked into a
judge_fn closure, which to_dict records only as "<configured>", so two
scorers with different judges shared a task hash. The provider path also
judged at temperature 0.0 while the judge_fn path used HELMET's 0.1.
They are now fields on a shared _HelmetJudgeScorer base: the default
OpenAI judge_fn is built from them, the provider path passes them with
each request, and one _judge helper replaces the two copied dispatch
overrides.

Unparseable or incomplete verdicts still score 0.0, but each output now
carries a judge_result with the raw response(s) and a parse_error flag,
which build_predictions writes to the predictions file. A summarization
instance without key points is flagged as missing_keypoints, and both
summarization loaders warn when rows lack them.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Pins InfiniteBench, NarrativeQA (now named deepmind/narrativeqa), the
banking77 and clinc_oos ICL sources, trec's parquet conversion and the
Llama-2 reference tokenizer to commit SHAs. The tokenizer load is also
cached, since four loaders share it.

HELMET's shots, token budgets, prompt templates and source revisions
lived in HELMET_TASKS and loader constants, so none of them reached
TaskConfig.to_dict and changing one left the task hash unchanged. Adds an
optional TaskConfig.task_settings field, serialized only when set so no
other task's hash changes, and fills it for each HELMET task.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The Hub copy HELMET's nlu ICL tasks read,
xingkunliuxtracta/nlu_evaluation_data, now returns 401, and it was only
reachable through the regenerated refs/convert/parquet branch. Rebuild it
instead from the CSV its original loading script read, in
xliuhw/NLU-Evaluation-Data at 6e495bf0, following that script: drop
"null" annotations, strip entity markup, and label rows
`{scenario}_{intent}` in sorted order. This reproduces the dataset's
25,715 rows and 68 labels in their original order, which the seeded
train/test split depends on.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Upstream's Recall average is json_kv plus ruler_niah_mk_2, ruler_niah_mk_3
and ruler_niah_mv (scripts/collect_results.py). Adds those as
helmet_ruler_* recall tasks at 4k-128k. They read the same pre-generated
RULER files as the ruler_* tasks, but build the prompt as HELMET does,
from its templates with the answer prefix on its own line, and use
HELMET's generation budgets (50/100/50; RULER's niah_mv uses 250-300).
Checked against the real data: every prompt matches HELMET's rendering
at 4k, 16k and 128k.

allenai/ruler_data is now pinned, and the extracted copy is keyed by
revision so moving the pin re-extracts.

Upstream's Cite average excludes the nocite ablations. They stay
registered as tasks but are left out of the helmet_cite suites. Cite
still scores answer correctness only; the citation recall and precision
in upstream's average need AutoAIS.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
jopetty and others added 2 commits October 6, 2026 19:27
`_load_jsonl` was defined four times, plus inline copies in the
Multi-LexSum and InfiniteBench loaders, and the hf_hub_download wrapper
was copied between the RULER and helmet-plus loaders. They now live in
`data/jsonl.py` (load_jsonl, sample_jsonl_rows, sample_jsonl_by_key)
and `data/hub.py` (download_dataset_file, whose revision is required).

Part of allenai#454.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
RulerTask and HelmetTask were near line-for-line copies, and each family
generated a subclass per task name with type(...) and globals()
injection. They now subclass LongContextTask (evals/tasks/common/
long_context.py), which holds the loading, instance, prompt and request
plumbing. Each family adjusts it through render_prompt, instance_id and
scoring_metadata: RULER keeps its prebuilt `input` prompts and row ids,
HELMET adds its scoring fields.

The new registry helper register_configured registers one class under
many names with per-name TaskConfig fields, which replaces both
factories. Each family's stop sequences are now a named constant, so
the difference between them is explicit.

All 216 RULER and HELMET task hashes are unchanged, and so are the
1,825 rendered requests snapshotted from real RULER, HELMET RULER and
HELMET ICL data.

Part of allenai#454.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 68.14753% with 380 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@5ef9cee). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/olmo_eval/data/helmet_infbench_loader.py 26.02% 54 Missing ⚠️
src/olmo_eval/data/helmet_msmarco_loader.py 44.00% 41 Missing and 1 partial ⚠️
src/olmo_eval/data/helmet_alce_loader.py 22.44% 38 Missing ⚠️
src/olmo_eval/data/helmet_icl_loader.py 55.84% 33 Missing and 1 partial ⚠️
src/olmo_eval/evals/tasks/helmet.py 77.92% 25 Missing and 9 partials ⚠️
src/olmo_eval/data/helmet_narrativeqa_loader.py 28.26% 33 Missing ⚠️
src/olmo_eval/data/helmet_multilexsum_loader.py 30.55% 25 Missing ⚠️
src/olmo_eval/data/helmet_kilt_loader.py 68.42% 17 Missing and 7 partials ⚠️
src/olmo_eval/common/scorers/rouge.py 64.00% 14 Missing and 4 partials ⚠️
src/olmo_eval/data/helmet_loader.py 50.00% 15 Missing ⚠️
... and 12 more
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #455   +/-   ##
=======================================
  Coverage        ?   55.83%           
=======================================
  Files           ?      467           
  Lines           ?    40975           
  Branches        ?     6423           
=======================================
  Hits            ?    22877           
  Misses          ?    16745           
  Partials        ?     1353           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
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.

3 participants