Skip to content

Add HELMET task suite: all seven categories at 4k-128k - #281

Merged
gregorybchris merged 47 commits into
allenai:mainfrom
jopetty:helmet-plus-recall
Oct 30, 2026
Merged

gregorybchris merged 47 commits into
allenai:mainfrom
jopetty:helmet-plus-recall

Conversation

@jopetty

@jopetty jopetty commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Update (2026-10-06): addressed the 9/29 review. The KILT tasks now cap questions with max_questions and leave the runner's instance limit unset, so every question is scored at all of its depths. The judge model, temperature and token budget are scorer fields that reach the task hash. Judge parse failures are recorded in each prediction's judge_result. Every source is pinned to a commit, and nlu, whose Hub copy is gone, is rebuilt from its source CSV. HELMET's shots, budgets, templates and source revisions are serialized into the task hash through a new optional TaskConfig.task_settings field. The primary-metric fix has moved to #453, which changes the hash of the 78 RULER tasks. HELMET no longer depends on it, because each task passes its Metric instance directly. The Recall and Cite averages now match upstream: Recall adds HELMET's three RULER NIAH tasks, and Cite leaves out the _nocite ablations. Merged current main.

Scope change (2026-09-03): per review, this PR is now the port of HELMET at its own 4k–128k context lengths. The long-context recall extension (256k–2m json_kv tiers) has been split out to a follow-up PR based on this branch.

Adds support for HELMET (ICLR 2025), the long-context benchmark: 138 tasks across all seven categories at HELMET's standard 4k–128k lengths.

category tasks primary metric
recall json_kv, ruler_niah_{mk_2,mk_3,mv} substring recall
rag kilt_{nq,triviaqa,hotpotqa,popqa} substring exact match
rerank msmarco_rerank_psg NDCG@10
longqa infbench_{qa,choice}_eng, narrativeqa ROUGE-L F1 / EM / GPT-4 judge
summ infbench_sum_eng, multi_lexsum GPT-4 judge (fluency-gated F1)
icl trec_{coarse,fine}, banking77, clinic150, nlu HELMET-normalized EM
cite alce_{asqa,qampari} (_nocite ablations registered but not averaged) str_em / qampari_rec_top5

Suites: helmet_{category}__{size}, helmet_all__{size} (mean over category averages), and helmet_nojudge__{size}, which excludes the three LLM-judged tasks, following the science:judge/science:nojudge split.

Data: allenai/helmet-plus on the Hub hosts HELMET's pre-retrieved KILT, MS MARCO and ALCE files. They are re-hosted unpacked from its 10GB data.tar.gz, so consumers fetch per-task files. It also hosts the summarization keypoints, the json_kv tiers, and per-directory manifests, so loaders never hardcode filenames. The json_kv tiers are regenerated with HELMET's own generate_json_kv_data.py (same generator and parameters, calibrated against the Olmo 3 tokenizer). They match HELMET's distribution but not its exact instances. LongQA and ICL sources load from the Hub directly. Three ICL datasets are repointed because datasets ≥4 dropped script loading. trec and banking77 load from parquet mirrors. nlu's Hub copy is no longer available, so it is rebuilt from the CSV its original loading script read (xliuhw/NLU-Evaluation-Data), using that script's logic. That reproduces its 25,715 rows and 68 labels in their original order. Split sizes and label counts were checked against HELMET's hardcoded values. Every source is pinned to a commit SHA: helmet-plus, ruler_data, InfiniteBench, NarrativeQA, banking77, clinc_oos, trec's parquet conversion, the nlu source CSV, and the Llama-2 reference tokenizer used for truncation. helmet-plus is private to AI2, so these tasks are internal.

Task identity: each HELMET task serializes its resolved config into TaskConfig.task_settings. That covers shots, token budgets, question caps, prompt templates and pinned source revisions, so changing any of them changes the task hash. The field is new and optional, and it is only emitted when set, so no other task's hash changes. The judged tasks also serialize their judge model, temperature and token budget.

Metric infrastructure added:

  • ROUGE-L F1/recall, byte-identical to HELMET's calculate_metrics.
  • NDCG@10, verified against pytrec_eval on 900 randomized cases without taking the compiled dependency.
  • HELMET's LongQA and 3-call summarization judges, with the rubrics extracted verbatim (~55KB).
  • Substring and HELMET-normalized exact-match scorers.
  • ALCE answer-correctness scorers.
  • Encoder-decoder support in the HF provider (auto-detected). This is groundwork for AutoAIS citation scoring, which is a deliberate follow-up; ALCE here scores answer correctness only.

A judge response that can't be parsed scores 0.0, and its prediction carries judge_result.parse_error and the raw response. HELMET instead drops such responses from the average, so failures can be counted and excluded after the fact.

Parity target: this PR targets upstream princeton-nlp HELMET, not oe-eval. Scorers and parsers are verified against the upstream implementations case by case (tests/evals/tasks/test_helmet.py). Every category average has the same tasks as upstream's collect_results.py. Recall's RULER tasks read the same pre-generated files as the ruler_* tasks and render prompts the way upstream does: every prompt was checked against the real data at 4k, 16k and 128k. They also use upstream's generation budgets. Known differences from upstream:

  • Cite category. Upstream's Cite average also includes citation_rec and citation_prec, which need AutoAIS, an 11B T5 NLI model. Here Cite averages answer correctness only. The category membership matches upstream: alce_asqa and alce_qampari, without the _nocite ablations.
  • ICL shot counts are HELMET's own. They render at 0.78–0.85× nominal length under Olmo 3 and are kept for comparability; scripts/internal/calibrate_helmet_icl_shots.py measures this.
  • Judged scores. The judged tasks' gpt-4-score is normalized to [0,1]; multiply by 3 to recover HELMET's number.
  • Chat template. For use_chat_template tasks this drops the Answer: prefix, but requests still go out as COMPLETION. Upstream applies the tokenizer's chat template. ruler.py has the same gap.

Differences from oe-eval (oe_eval/tasks/oe_eval_tasks/helmet.py), as listed in the 9/29 review. Most come from following upstream:

oe-eval this PR
lengths 8k–128k 4k–128k
ICL limit 100 500 (upstream)
stop sequences \n, Ċ, ĊĊ, <0x0A> \n
judge gpt-4o-mini-2024-07-18, 0–3 scale gpt-4o-2024-05-13 at 0.1 (upstream), normalized to [0,1]
qampari metric qampari_f1 qampari_rec_top5 (upstream)
truncation model tokenizer + Llama-2 reference Llama-2 reference only
chat template applied prefix dropped, COMPLETION request

Caveats for reviewers:

  • RAG max_questions caps questions, not instances. Each question repeats once per gold-passage depth (HELMET's "lost in the middle" sweep), so 100 questions ⇒ ~600 nq instances. Passing limit caps instances like any other task, at the cost of the depth sweep.
  • The JSONL loaders (json_kv, KILT, MS MARCO) sample by line without parsing the whole file, and select the same rows as a full load.
  • The HF provider's seq2seq generate path needs a GPU smoke test (torch is CUDA-gated off the dev machine).

🤖 Generated with Claude Code

jopetty and others added 2 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]>
@jopetty
jopetty requested a review from undfined August 14, 2026 02:36
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.

@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.

Two requests but looks good!

  • Do we want to pass a fixed revision?
  • The loader decodes and processes the entire JSONL file before applying max_samples similar to RULER-plus case. We should try to stream and sample this instead of loading the entire dataset and sampling with max_samples.

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.
@jopetty jopetty changed the title Add HELMET-plus long-context recall tasks (up to 2m tokens) Add HELMET task suite: all seven categories, recall extended to 2m tokens Aug 17, 2026
@jopetty

jopetty commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

Heads up for anyone who reviewed earlier: this PR just grew from the recall-only extension (2 commits) to the full HELMET integration (16 commits) — the original recall commits are unchanged at the base of the branch. Title and description updated to match. The same content is also flowing to jacksonp/ladder via #287 (merged, first tranche) and #299 (open, remainder).

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.
@YashasSamaga

Copy link
Copy Markdown
Contributor

Let's split this into two PRs: (i) port HELMET as-is from oe-eval, (ii) a separate PR for context extensions that we'll deal with later. For (i), it would help to verify parity with oe-eval.

…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]>
@jopetty jopetty changed the title Add HELMET task suite: all seven categories, recall extended to 2m tokens Add HELMET task suite: all seven categories at 4k-128k Sep 3, 2026
jopetty and others added 3 commits September 22, 2026 12:35
# 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]>
Conflicts:
- llm_judge.py: take main's LLMJudgeScorer.to_dict, which describes
  judge_fn by name and judge_config instead of a "<configured>" marker.
  HELMET judges build their judge_fn with build_openai_judge_fn, so
  their model, temperature and max tokens now appear under judge_fn;
  the to_dict test checks those instead of the marker.
- uv.lock: main's lock relocked with uv 0.12.0, adding only rouge-score.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@YashasSamaga

Copy link
Copy Markdown
Contributor

Parity. The target is upstream HELMET, not oe-eval. The description now says so and lists the differences from both. Checking against upstream's collect_results.py turned up two category differences, and both are now fixed (54ca69e):

Would it be possible to benchmark a public HF model with known HELMET numbers to confirm parity?

@gregorybchris

Copy link
Copy Markdown
Collaborator

This review was generated by an agent following REVIEW_GUIDE.md. It is not from a human reviewer. Reply in the PR thread and a maintainer will follow up.

This is a re-review of head 9b82aa2a against current main (6abc7f46, 22 commits ahead of this branch's merge base). Good progress since 9/29: the KILT depth sweep, the pins, the split-out primary-metric change and the _nocite membership are all fixed, and the port merges cleanly into current main. Two issues should be fixed before merge. Since this branched, main has also added shared code this PR should now use, mainly JudgedTask (#475) and the ruler-plus pattern (#276). Reusing it would remove roughly 500–650 of the ~3.4k new source lines and fix several behavior gaps along the way.

What was checked. On a trial merge with current main (Python 3.13, uv run --frozen --no-group vllm):

  • ruff check, ruff format --check and ty check src/ all pass.
  • The 60 tests in test_helmet.py and test_force_download.py pass in about 1.4s. They still pass with the HF offline env vars set, an empty HF_HOME and dead HTTP proxies, so they need no network, GPU or private data.
  • The full unit suite takes about 24s both with and without the PR, so the added CI time is within noise.
  • olmo-eval tasks -f helmet lists 138 tasks, and there are 60 HELMET suites.
  • A mock run of six specs at 4096 (ruler_niah_mk_2, json_kv, icl_banking77, msmarco_rerank_psg, alce_asqa, kilt_nq) with -o limit=2 scored 12/12.

Upstream comparisons are against princeton-nlp/HELMET at aeadacc6. Not checked: the infbench, narrativeqa and multi_lexsum data paths (large downloads), any real-model or judge run, and the msmarco qid question in Nit 10 (needs the private data).

The findings are ranked below:

  • Blocking 1–2 affect failure visibility and which instances are measured.
  • Non-blocking 1–7 are reuse and task identity.
  • Non-blocking 8–14 are scope, parity details and tests.

Blocking

  1. Judge failures score 0.0. See src/olmo_eval/common/scorers/helmet_judge.py:149, :174, :251, :284 and :299.

    • What happens:
      • An unparseable LongQA or summarization verdict returns 0.0.
      • A summarization instance with no key points returns 0.0 without calling the judge (:281-284).
      • The judge is called once, with no retry.
    • Count scoring failures against the failure budget instead of as zeros #492 changed the rule after this branched. A scorer that cannot decide now raises, and the runner leaves that output unscored and counts it against the failure budget (AGENTS.md "Failures aren't scores"; CONTRIBUTING "Failures and scoring"). The current REVIEW_GUIDE.md text that says "return 0.0" predates Count scoring failures against the failure budget instead of as zeros #492.
    • Upstream also does not score these as 0. eval_gpt4_longqa.py sets s=None and leaves them out of the average, and eval_gpt4_summ.py uses continue.
    • Missing key points are a data error. Today the loaders only log a warning (helmet_infbench_loader.py:233-244, helmet_multilexsum_loader.py:119-123).
    • The tests at tests/evals/tasks/test_helmet.py:563-604 assert the 0.0 behavior.
    • Please do the following:
      • Retry unparseable replies with judge_with_retries, record judge_result with the raw responses, then raise JudgeParseError. Moving to JudgedTask (Non-blocking 1) gives you all of this.
      • Raise at load time when key points are missing.
      • Rewrite the four judge-failure tests on the model of tests/evals/tasks/test_multichallenge.py:190 (test_an_unparseable_reply_is_retried_not_scored), driven through task.score_responses.
      • Update the docstrings at helmet_judge.py:127-130 and :199-204, and the PR description.
  2. Multi-LexSum is scored on a different set of cases from upstream. See src/olmo_eval/data/helmet_multilexsum_loader.py:76-96.

    • Upstream load_multi_lexsum keeps only cases whose joined sources are at least 65,536 Llama-2 tokens: test_data = filter_length(test_data, 65536, "context"). This loader has no filter, so short cases are scored at every length.
    • Two more differences:
      • The demos here are the last 2 validation rows, the same for every instance (:79-90). Upstream draws 2 train summaries per instance with train_data.shuffle(seed=demo_seed(x["id"], seed)).
      • Instance sampling uses random.Random(seed).shuffle (:92-96). Upstream uses test_data.shuffle(seed=seed).select(...), so a different 100 cases are chosen.
    • None of these is in the PR's known-differences list, and the task carries the parity name.
    • Please apply the 65,536-token filter with the reference tokenizer and match upstream's selection. If the train-split demos can't be reproduced, list that as a documented deviation or move it to a variant.

Non-blocking

  1. Could the judged tasks move onto JudgedTask (src/olmo_eval/evals/tasks/common/judge.py:211-490)?

    • HLE, MultiChallenge, MT-Bench and Arena-Hard all use it. helmet_judge.py:78-299 subclasses the older LLMJudgeScorer instead.
    • The HelmetSummJudgeScorer stubs out format_judge_prompt and parse_judge_response (:234-240), which shows it is on the wrong base class.
    • The gaps this causes today:
      • No required_secrets = ("OPENAI_API_KEY",). A Beaker launch of narrativeqa, infbench_sum_eng or multi_lexsum won't mount the key.
      • The standard overrides don't take effect. -o judge_model=... and OLMO_EVAL_JUDGE change to_dict(), but gpt-4o-2024-05-13 still judges, so the hash names a judge that never ran. On main these go through TaskConfig.judge_model and judge_max_tokens (base.py:171-175, serialized at :316-332).
      • The three summarization calls run one after another (helmet_judge.py:288-292). _judge_together runs them concurrently.
      • The judge sees raw output.text, <think> traces included (:215). JudgedTask passes visible_response.
      • No run-wide judge semaphore and no JudgedScoreMetric (judge.py:107-153), so there is no truncation_rate or missing-response warning.
    • Suggested shape:
      • Add a HelmetJudgedTask(HelmetTask, JudgedTask) with judge_model, judge_max_tokens and judge_scorer_name as class attributes.
      • LongQA makes one _judge_output(..., parse=...) call.
      • Summarization runs three _judge_output calls through _judge_together.
      • Use JudgedScoreMetric(name="gpt4_f1", score_key="gpt4_f1") in place of AccuracyMetric(scorer=HelmetSummJudgeScorer(...)) (helmet.py:501-514).
      • What remains is the prompts, the JSON parser and the F1 combine.
    • One real gap. JudgedTask._get_judge_fn hard-codes temperature=0.0 (judge.py:277), and HELMET uses 0.1. Should we add an optional TaskConfig.judge_temperature, serialized only when set, with HELMET as its first consumer? The alternative is to document temperature 0 as a deviation.
    • Judge token budget. HELMET_JUDGE_MAX_TOKENS = 1024 (helmet_judge.py:32). Upstream uses 2048 for LongQA (the OpenAIModel default) and 4096 for summarization. The shorter budget cuts the judge's reasoning and raises the parse-failure rate. Please match upstream.
    • Where the files go. On main, single-benchmark judges sit with their task (MT-Bench prompts in evals/tasks/mt_bench.py:143-200), and long constant tables go in evals/tasks/constants/. Could helmet_judge.py and the 55 KB helmet_summ_prompts.py move out of common/scorers/ into an evals/tasks/helmet/ package (as bfcl/ and ctc_suite/ are) or evals/tasks/constants/helmet.py?
  2. Could HelmetTask subclass RulerTask, as RulerPlusTask does? See src/olmo_eval/evals/tasks/helmet.py:73-198.

    • It matches ruler.py:72-256 almost line for line:
      • __init__'s prefix strip and rsplit("__")
      • the template dict in _load_data
      • the instances property (helmet.py:111-124 vs ruler.py:135-152)
      • process_doc's prepend_text and metadata, request_type, format_request (helmet.py:183-195 vs ruler.py:209-242) and extract_answer
    • _make_helmet_task_class (helmet.py:568-599) is make_ruler_task_class (ruler.py:259-303) with a few extra attributes.
    • RulerPlusTask(RulerTask) (ruler_plus.py:33-105) overrides only _tasks_registry, _name_prefix, _load_data and process_doc, and passes base_cls= to make_ruler_task_class.
    • The same approach here, with the factory generalized to take metrics, primary_metric, stop_sequences and extra attributes, saves about 80–100 lines.
    • It also forces a deliberate choice on stop sequences. RULER uses ("\n", "Ċ", "ĊĊ", "<0x0A>") (ruler.py:284) and HELMET uses ("\n",) (helmet.py:581).
    • prompt_template is returned by all eight loaders and stored at helmet.py:106, but nothing reads it. Please drop it.
  3. Some scorers and metrics duplicate existing code.

    • SubstringExactMatchScorer (src/olmo_eval/common/scorers/substring.py:60-93) is the same algorithm as RulerQAScorer (evals/tasks/ruler.py:39-69). ruler.py:31-36 _normalize_answer is a verbatim copy of _squad_normalize_answer (common/scorers/base.py:165-178).
      • Could RulerQAScorer become a subclass that keeps its class name, so RULER hashes don't move?
      • Could _squad_normalize_answer become public? This PR imports the private name in substring.py, alce.py:20 and helmet.py:23.
    • RougeLF1Metric and RougeLRecallMetric (common/metrics/rouge.py) and NDCGMetric (common/metrics/retrieval.py) each have a compute that is byte-for-byte AccuracyMetric.compute (common/metrics/base.py:130-141). Please use AccuracyMetric(name="rougeL_f1", scorer=RougeLF1Scorer()) and AccuracyMetric(name="ndcg_at_10", scorer=NDCGScorer()), as the PR already does for icl, kilt, alce and the judges, and delete both metric files.
    • RougeLRecallScorer (common/scorers/rouge.py:94-115) and RougeLRecallMetric have no consumer. Please remove them.
    • Gold-answer collection appears four times: rouge.py:30-48 _reference_answers, substring.py:79-87, helmet.py:292-297 and helmet.py:321-328. Could this be one public helper in common/scorers/base.py?
    • HelmetExactMatchScorer (helmet.py:274-300) could sit beside SubstringExactMatchScorer and share that helper. Extending ExactMatchFlexScorer instead would move its hashes.
    • json_kv is scored with RecallMetric/SubstringRecallScorer (helmet.py:472-474), which only lowercases. Upstream uses normalized substring_exact_match, which this PR already has as SubstringExactMatchScorer. The comment there says the two are equivalent, and they aren't. Please switch.
    • InfbenchChoiceScorer (helmet.py:303-344) is justified. HELMET accepts B. text substrings, which MultipleChoiceScorer doesn't. Could the docstring say so, since AGENTS.md lists it as a common duplicate?
    • parse_rankings (helmet_msmarco_loader.py:38-68) is answer extraction inside a data loader. Could it move to the task module or evals/extract/?
  4. The nine loaders share a lot of copy-paste.

    • JSONL readers. There are six, and five are new. helmet_loader.py:67-83 is verbatim ruler_loader.py:68-84. The others are helmet_kilt_loader.py:63-70, helmet_msmarco_loader.py:76-83, and inline in helmet_multilexsum_loader.py:69-74 and helmet_infbench_loader.py:208-213. One shared load_jsonl would cover all of them.
    • Manifest lookup plus "unknown task/length" error. There are four copies: helmet_loader.py:55-64,182-186, helmet_kilt_loader.py:57-60,150-156, helmet_alce_loader.py:32-34,57-63 and helmet_msmarco_loader.py:71-73,123-125.
    • Per-instance seed hash and demo de-duplication. Each is duplicated between helmet_kilt_loader.py:81-97 and helmet_msmarco_loader.py:153-165.
    • Reference tokenizer and truncation. _load_reference_tokenizer and _truncate_context (helmet_infbench_loader.py:118-136) are private names imported by kilt (:40), narrativeqa (:19-24) and multilexsum (:20-25). The truncation cache setup is repeated three times (infbench :215-230, narrativeqa :121-131, multilexsum :98-108). Could the tokenizer constants, TRUNCATION_POSTFIX and a public truncate_contexts move into helmet_loader.py?
    • Pinned Hub download. helmet_loader.py:31-52 duplicates ruler_plus_loader.py:50-93. Ruler-plus also turns a missing private repo into a PermissionError with an HF_TOKEN hint, and offers a local-directory override. allenai/helmet-plus is private too, so a shared download_pinned_dataset_file would give HELMET both.
    • Row sampling. There are four sampling methods across the loaders. They mostly mirror upstream, so a one-line upstream citation on each is enough.
    • Together this saves about 130–160 lines.
  5. TaskConfig.task_settings changes the hash but never changes the run. See src/olmo_eval/evals/tasks/common/base.py:194-197 and :335-336, and helmet.py:534-565.

    • The field is serialized only when set, and both directions are tested (test_helmet.py:609-640). That part is right.
    • But HelmetTask reads HELMET_TASKS[task_name] (helmet.py:81-89), not self.config.task_settings. So -o task_settings=... changes the hash without changing the run, and a code change can change the run without changing the hash.
    • The same is true of num_fewshot, fewshot_seed and split. All three are serialized, and HELMET ignores them.
    • It hashes keys that aren't part of the measurement. With helmet_alce_asqa_nocite__4096 -o limit=5, task_settings.helmet.limit serializes as 100. The suite flags tag, ablation and judged are hashed too, so editing a suite flag moves every HELMET hash.
    • Templates are captured by grabbing module globals whose names contain "TEMPLATE" (helmet.py:559-564). That misses:
      • TRUNCATION_POSTFIX
      • msmarco's _passage_template() strings
      • the "For example: … Now, read the following story" demo wrappers (helmet_infbench_loader.py:201, helmet_narrativeqa_loader.py:115-118, helmet_multilexsum_loader.py:86-88)
      • the json_kv demo joiner
      • MIN_DOCUMENT_TOKENS
      • the "\n" joiner in format_request
    • Please do the following:
      • Read the resolved settings from self.config.task_settings so there is one source of truth.
      • Whitelist the keys that affect the measurement (shots, token budgets, max_questions, thresholds, subset).
      • List the prompt constants explicitly.
      • Include the upstream HELMET commit.
      • Reject or honor num_fewshot, fewshot_seed and split overrides.
      • Add tests that a suite-flag change keeps the hash and a change to TRUNCATION_POSTFIX moves it.
    • This is the first generic field of its kind on TaskConfig. Could the PR description explain why the existing mechanisms aren't enough: DataSource(revision=), scorer dataclass fields, and dedicated optional fields like judge_*?
  6. Only KILT is trimmed to fit within the context length.

    • Upstream model_utils.tokenize trims every task's context to max_length - generation_max_length. Here only KILT is trimmed (helmet_kilt_loader.py:100-115), using Llama-2.
    • json_kv, msmarco, ALCE, ICL and RULER aren't bounded. At 131072, depending on the model's tokenizer, prompt plus max_gen_toks can exceed a 128k model's context (AGENTS.md common mistakes).
    • Could these use fit_max_tokens_to_context or a trim, with a test at 131072? I couldn't measure the actual overflow.
  7. Deterministic scorers return 0.0 when they can't decide. This happens in:

    • src/olmo_eval/common/scorers/alce.py:63-65 and :87-89
    • common/scorers/retrieval.py:24-26 and :39-40 (no qrels)
    • common/scorers/rouge.py:83-84 and :107-108
    • common/scorers/substring.py:85-90
    • evals/tasks/helmet.py:292-296 and :322-327

    Each returns 0.0 when gold or reference metadata is missing. That is a data error, so please raise instead (same rule as Blocking 1).

  8. Encoder-decoder support in the HF provider has no consumer. See src/olmo_eval/inference/providers/huggingface.py:345-378 and :587-599.

    • Nothing in this PR uses it. AutoAIS is "not wired up" (helmet.py:426-428, :494-495).
    • It adds an AutoConfig.from_pretrained call to every HF text-model load.
    • logprobs() isn't gated on is_encoder_decoder, and AutoConfig loads with tokenizer_kwargs. Both are carried over from 9/29.
    • The generate path is untested. The only new test checks auto-class selection, and it sits in tests/providers/test_force_download.py.
    • Could this move to the AutoAIS PR, per "add hooks only with their first consumer"?
  9. The ruler_loader.py pin changes existing tasks. See src/olmo_eval/data/ruler_loader.py:20-21 and :48-60.

    • Pinning RULER_DATA_REVISION re-keys the cache directory, which forces every existing ruler_* user to download again.
    • b2d1d948 is the current HEAD of allenai/ruler_data, so data and hashes are unchanged and no result-compatibility entry is needed.
    • It is still a separate behavior change to existing specs. Could it be its own PR?
    • The same goes for rouge-score in pyproject.toml/uv.lock. The diff is small and clean, and the import is lazy. AGENTS.md still asks for dependency changes in a separate PR, or a justification in the description.
  10. Parity gaps not in the known-differences list.

    • helmet_kilt_loader.py:190-192 and helmet_msmarco_loader.py:152-156 shuffle demos with random.Random(h). Upstream uses Dataset.shuffle(seed=h), a numpy permutation, so different demos are drawn. The comment at helmet_kilt_loader.py:84-86 says the draw matches HELMET; it doesn't.
    • helmet_narrativeqa_loader.py:106-118 uses one fixed demo set. Upstream seeds per instance with demo_seed(document id + question, seed). The comment "HELMET shuffles the demo pool without a seed" is incorrect.
    • helmet_alce_loader.py:85-102 has two differences:
      • One demo draw is shared by every instance. Upstream draws per instance from the global RNG, which eval.py:42 seeds, so the comment "varies run to run" is also wrong.
      • Instances are sampled with random.Random, where upstream uses Dataset.shuffle(seed).
    • parse_judge_json (helmet_judge.py:63-75) lacks upstream's ```json fallback from eval_gpt4_summ.py.
    • The infbench sum_eng demo drops upstream's .strip() (helmet_infbench_loader.py:95).
    • The comment at helmet.py:132-134 says dropping the Answer: prefix matches how HELMET runs its chat tasks. Upstream applies the chat template instead. The PR description states this correctly, so please fix the comment.

    For each gap, please either match upstream or add it to the documented deviations.

  11. No upstream commit cited and no real-model trial.

    • CONTRIBUTING's reference-parity section asks for the reference revision. No HELMET commit appears in the code or the description.
    • Could you add it to helmet.py's docstring and the description?
    • Could you also run a small real-model trial with Beaker experiment IDs, showing a few category averages next to HELMET's published numbers for the same model? Run it with --no-upload while the PR is open.
    • The HF seq2seq path also still needs its GPU smoke test, unless it moves out per item 8.
  12. Private data and secrets. allenai/helmet-plus is private.

    • The launcher copies HF_TOKEN only when a task declares it (launch/beaker/secrets.py:7-9).
    • Please declare required_secrets with HF_TOKEN, plus OPENAI_API_KEY for the judged tasks (item 1).
  13. Several of the riskiest paths have no tests. The test cost is fine: about 1s, offline. Untested:

    • All four truncation paths: infbench _truncate_context, KILT _truncate_prompt_context (stubbed out in the only KILT test), narrativeqa _iter_long_documents, and multi_lexsum truncation.
    • sample_jsonl_rows.
    • Five of the eight loaders.
    • process_doc's metadata routing for qa_pairs, qampari_answers, keypoints and qrel.

    Suggested additions, each under 50ms, using a fake whitespace tokenizer that returns input_ids and offset_mapping:

    • An infbench loader test with a 4-row Dataset. Assert the truncation postfix and cut point, that an MC answer becomes [letter, "letter. text"], that demos exclude the row's own id, and the key-point attachment, including the missing case.
    • A KILT trim test asserting that passages are cut from the end and that the instruction, demos and question survive. Alternatively, stop stubbing _truncate_prompt_context in the existing test.
    • A narrativeqa _iter_long_documents test asserting that the character-length shortcut skips tokenization and that iteration stops after needed rows.
    • A sample_jsonl_rows equivalence test mirroring the existing sample_jsonl_by_key test, with blank lines.
    • Tiny manifest fixtures for the msmarco, ALCE and multi_lexsum loaders, driven through get_task(...).instances and the primary scorer.
    • The judge tests from Blocking 1.
    • The task_settings tests from item 5.

    Suggested cuts and merges:

    • Drop test_summ_prompts_format_cleanly and test_summ_judge_selects_rubric_variant_by_task once the judge tests go through score_responses.
    • Merge test_judge_scorer_to_dict_is_stable_and_serializable and test_judge_settings_change_the_serialized_scorer.
    • Replace test_helmet_task_inventory, test_helmet_context_budgets_match_helmet and test_helmet_task_config_details with one rule-based test. They restate constants (138, 24, the banking77 shot list). Check rules instead:
      • every base task has all six sizes
      • max_context_tokens == size - reserve - max_gen_toks for every LongQA and summarization task
      • the judged set equals helmet_all minus helmet_nojudge
    • Route the eight _parse_labeled_output cases through task.extract_answer(LMOutput(...)) for one ICL, one KILT and one infbench task.
    • Drop the equality line at test_helmet.py:502, which compares two dumps of the same object.

    Net CI change: under +0.5s, and loader coverage goes from 3 of 8 to 8 of 8.

  14. Leftovers from the >128k design.

    • src/olmo_eval/data/helmet_tasks.py:
      • The docstring at :7-9 says tasks "declare their own context_sizes", but every task uses STANDARD_CONTEXT_SIZES.
      • CONTEXT_SIZES at :27-28 is a pointless alias.
      • The .get("context_sizes", CONTEXT_SIZES) fallback at :261 never applies.
      • The "can't be stretched" comments at :130-132 and :145-146 refer to the old design.
    • src/olmo_eval/evals/suites/helmet.py: the docstring at :15-19 describes the old design, and if len(category_suites) > 1 at :90 is always true.
    • helmet_loader.py:58 and :174 use "256k" and "2m" as examples.
    • The infbench, kilt, msmarco and alce module docstrings still say "stops at standard HELMET's 128k".

Nits

  • Nit: Docstrings with hard-coded counts (AGENTS.md): "seven categories" (helmet.py:1, helmet_tasks.py:1), "ICL contributes five tasks" (suites/helmet.py:13), "351 rows over 69 stories" (helmet_infbench_loader.py:218), "10.5k-row" (helmet_narrativeqa_loader.py:46), "5452 training examples" (helmet_tasks.py:48), "~55KB", and "100 questions ⇒ ~600" and "1-3 GB" (kilt).
  • Nit: Comments about work not done yet: "not wired up yet" (helmet.py:426-428, :494-495), and the AutoAIS note in tests/providers/test_force_download.py.
  • Nit: scripts/internal/calibrate_helmet_icl_shots.py fits new shot counts and never renders HELMET's _ICL_SHOTS. So the ratio column at :108 is about 1.0 by construction and can't measure the shortfall that its docstring and helmet_tasks.py:45-46 describe. Fix that, or drop the script and the cross-reference.
  • Nit: extract_answer is identical in HelmetInfbenchTask (helmet.py:266-271), HelmetNarrativeQaTask (:362-364) and HelmetKiltTask (:388-392).
  • Nit: helmet_kilt_loader.py:135 says max_samples caps instances, but it caps questions, as the module docstring at :22-31 says.
  • Nit: helmet_narrativeqa_loader.py:49-51 calls "tokens ≤ characters" an exact bound. Llama's byte fallback breaks it for non-ASCII text. It has no practical effect on NarrativeQA.
  • Nit: Unused logger in helmet_alce_loader.py:24, helmet_loader.py:25 and helmet_narrativeqa_loader.py:26. import math (helmet_kilt_loader.py:165) and import random (helmet_multilexsum_loader.py:66) sit inside functions.
  • Nit: Loose types: _TASK_METRICS: dict[str, tuple] (helmet.py:475), metadata: dict (:146), a # type: ignore at :120, process_doc typed Instance | None though it never returns None, and _load_splits (helmet_icl_loader.py:169) with no return type.
  • Nit: LMOutput.text is typed str, so the output.text is None / or "" guards in SubstringExactMatchScorer, InfbenchChoiceScorer, AlceStrEmScorer and HelmetMsMarcoTask are dead.
  • Nit: msmarco samples by qid (sample_jsonl_by_key) and also applies limit=100. If the dep3 file repeats a query, the runner re-samples rows and breaks the grouping up, as happened with KILT. I couldn't check this without the data.
  • Nit: Still open from 9/29: display formats for the new metric names (they render "raw"), no strip_thinking, full-dataset loads for InfiniteBench and NarrativeQA, and dead code (reference_tokenizer params, task_name, the dict branch at helmet_alce_loader.py:70, and the qrels mapping branch).
  • Nit: The tests have about 15 imports inside test functions, and use asyncio.run where recent ports use pytest.mark.anyio. The module docstring still mentions "the one loader test".

Status of the 9/29 review

Item Status
B1 KILT depth sweep Addressed
B2 primary-metric hash Addressed by splitting it into #453
B3 judge identity Partially addressed. Scorer fields serialize, but TaskConfig.judge_* and -o judge_model are ignored (Non-blocking 1)
B4 judge failure visibility Partially addressed. Raw responses are recorded, but scores are still 0.0 (Blocking 1)
B5 pins and settings in the hash Pins addressed. Settings partially: task_settings only feeds the hash (Non-blocking 5)
NB2 encoder-decoder Not addressed (Non-blocking 8)
NB3 whole-dataset loads Not addressed
NB4 display format Not addressed
NB5 strip_thinking Not addressed
NB6 private-dataset docs Partially addressed. No secrets declared (Non-blocking 12)
Duplication Deferred to #454. Since JudgedTask and the ruler-plus pattern are now on main, I'd suggest doing Non-blocking 1–4 here rather than deferring them

Before merge

Please fix Blocking 1 (judge failures raise and are retried, not scored 0.0) and Blocking 2 (Multi-LexSum length filter and selection), with tests for both. I'd also strongly encourage Non-blocking 1, 2 and 5 in this PR. Moving onto JudgedTask fixes Blocking 1, the missing secret and the ignored judge overrides together, and task_settings should drive the run before it becomes a hashing pattern other tasks copy.

If you defer the rest, please file follow-up issues and link them here:

  • the remaining duplication (Non-blocking 3–4)
  • context trimming (6)
  • parity gaps (10)
  • the HF encoder-decoder support (8), to land with AutoAIS

Once those are done and CI is green, you're free to merge.

LongQA, summarization and cite set use_chat_template, as upstream HELMET
does, but format_request still sent a bare completion. The flag only
dropped the "Answer:" prefix, so those tasks got neither the chat
template nor the prefix. On Llama-3.1-8B-Instruct at 8k, InfBench QA
spent its 10-token budget writing "Answer:" and scored 0.0 against the
paper's 21.9. These tasks now send one user message, which the server
wraps in the chat template like upstream's apply_chat_template with
add_generation_prompt=True.

The judged tasks (narrativeqa and both summarization tasks) also now
declare OPENAI_API_KEY in required_secrets, so a Beaker launch mounts
the key or fails at preflight rather than after generation.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@jopetty

jopetty commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor Author

Results for comparison between HELMET (published results) and HELMET+ on Llama-3.1-8B-Instruct on 8k, 16k and 32k splits:

Category 8k ours 8k paper Δ 16k ours 16k paper Δ 32k ours 32k paper Δ
Recall 100.0 100.0 +0.0 99.5 100.0 −0.5 97.9 99.7 −1.8
RAG 68.3 70.8 −2.5 66.5 68.8 −2.3 64.5 66.5 −2.0
Re-rank 64.1 67.0 −2.9 53.0 51.7 +1.3 42.5 43.4 −0.9
Cite (correctness) 32.8 36.8 −4.0 32.7 30.4 +2.3 25.8 21.2 +4.6
ICL 71.5 71.3 +0.2 76.3 76.4 −0.1 78.7 77.9 +0.8
LongQA (QA + MC) 27.0 26.9 +0.0 33.5 34.1 −0.6 43.4 42.5 +0.8
Avg of 6 categories 60.6 62.1 −1.5 60.2 60.2 +0.0 58.8 58.5 +0.2

Beaker runs:

jopetty and others added 3 commits October 28, 2026 16:59
# Conflicts:
#	src/olmo_eval/common/scorers/__init__.py
#	uv.lock
Judge: NarrativeQA, InfBench Sum and Multi-LexSum now grade through the
shared JudgedTask. A judge reply that never parses is retried and then
left unscored instead of scoring 0.0; -o judge_model and OLMO_EVAL_JUDGE
change the judge that runs; the three summarization rubrics are judged
concurrently; and the judge sees the visible response. Judge budgets match
upstream (2048 tokens for LongQA, 4096 for summarization), the
summarization parser gains upstream's fenced-JSON fallback, and the LongQA
judge sees upstream's parse_output answer. The judge and its prompts move
under evals/tasks, next to the tasks they grade.

Multi-LexSum: keep only validation cases whose joined sources reach
65,536 reference tokens, take validation rows in the v20230518 release's
dev.json order, sample them as Dataset.shuffle(seed) does, and draw each
instance's two demos from the train split with upstream's per-instance
demo_seed. dev.json and train.json are read from allenai/multi_lexsum at a
pinned revision, which joins the task settings with the length floor.

Missing key points in either summarization dataset now fail at load time.
The judge tests run through score_responses with a scripted judge, and the
Multi-LexSum loader is tested against Dataset.shuffle on fixture data.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
TaskConfig.judge_temperature sets the judge's sampling temperature. It is
serialized only when set, so the hash of every task judging at the default
temperature of 0 is unchanged; JudgeSettings carries it, with_config and
grade_with_config_judge apply it, and -o judge_temperature=<t> parses as a
float. HELMET's judged tasks set it to upstream's 0.1.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@jopetty

jopetty commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor Author

Both blocking items are fixed in 08d9f8a, along with a merge of current main (94195ea, which includes #512) and a few of the non-blocking items.

Blocking 1: judge failures

NarrativeQA, InfBench Sum and Multi-LexSum now go through JudgedTask (evals/tasks/helmet_judge.py):

  • A judge reply that doesn't parse is retried. If it still fails, the raw reply and parse_error are recorded and the output is left unscored, not scored 0.0. Upstream also leaves these out of the average.
  • Missing key points now raise an error when the data loads, in both the InfBench and Multi-LexSum loaders. The scoring path also refuses an instance without them.
  • required_secrets = ("OPENAI_API_KEY",) now comes from JudgedTask.
  • -o judge_model=... and OLMO_EVAL_JUDGE now change the judge that actually runs. The 18 judged HELMET specs show up under with_judge_env in task_hashes.json.
  • The three summarization rubrics are judged concurrently with _judge_together.
  • The judge sees visible_response, so <think> text is removed.
  • Scores use JudgedScoreMetric, and truncation_rate is reported. Summarization also reports gpt4_recall, gpt4_precision and gpt4_fluency, matching upstream's averaged metrics.
  • Judge token budgets now match upstream: 2048 for LongQA and 4096 for summarization.
  • The summarization parser now has upstream's fenced ```json fallback, and the LongQA judge sees upstream's parse_output answer.
  • On temperature, I took your first suggestion. TaskConfig.judge_temperature is optional and only serialized when set, so no existing hash changes. JudgeSettings, with_config and grade_with_config_judge all carry it, and -o judge_temperature=<t> sets it. HELMET sets it to 0.1. The remaining documented differences: the shared client sends no top-p (upstream uses 0.9) and no seed (upstream uses 42), and it retries replies that don't parse.
  • The judge and the summarization prompts moved under evals/tasks/: helmet_judge.py and constants/helmet_summ_prompts.py.
  • The judge-failure tests now go through task.score_responses with a scripted judge, following the MultiChallenge tests. They cover retry-then-success, an output left unscored after the last retry, missing key points, and judge overrides reaching the judge that runs.

Blocking 2: Multi-LexSum selection

load_multi_lexsum_dataset now follows upstream's load_multi_lexsum step by step:

  • It keeps only validation cases whose joined sources are at least 65,536 tokens with the reference tokenizer, applied at every context length. Text that is too short in UTF-8 bytes to reach the floor is skipped without tokenizing. A test checks the byte bound against the tokenizer.
  • It takes validation rows in the order of the v20230518 release's dev.json and samples them with Dataset.shuffle(seed)'s permutation.
  • Each instance gets 2 example summaries from the train split, chosen with upstream's per-instance demo_seed.
  • dev.json and train.json (about 20 MB together) are read from allenai/multi_lexsum at 055f5fa5. The validation sources still come from helmet-plus, so the 2.2 GB sources.json isn't needed. The pin and the length floor are in task_settings.
  • Tests on fixture data check the selection, order and demos against Dataset.shuffle, and check truncation and the errors for incomplete data.

Also addressed

  • The upstream reference (princeton-nlp/HELMET@aeadacc6) is cited in the helmet.py docstring (item 11).
  • The chat-template comment in process_doc is corrected (item 10).
  • The "~55KB" count is gone from the prompts docstring.
  • 47581e4 sends the chat-format tasks (LongQA, summarization, cite) as a single user turn through the chat template, as upstream does. This fixed InfBench QA scoring 0 in our parity smoke run.

Parity

The 8k, 16k, and 32k results are in my comment above, and they're within about 1.5 points of the paper's average.

Validation

  • ruff check, ruff format --check and pytest tests/ --ignore=tests/integration pass locally: 4593 passed, 35 skipped.
  • On CI, Lint and Type Check have passed, and the tests are still running.

jopetty and others added 2 commits October 28, 2026 17:37
HelmetTask now subclasses RulerTask, as RulerPlusTask does, and inherits
its variant lookup, instance cache, completion request and raw-text
answers; it overrides only data loading, prompt rendering and metadata,
and the chat request for its chat-format categories. The HELMET factory
goes through make_ruler_task_class, which now takes metrics, a primary
metric, stop sequences, mixin bases and extra class attributes.

HELMET keeps ("\n",) as its stop sequence: upstream's vLLM and API
backends stop on newline strings, and as a stop string the newline covers
the byte-level spellings in RULER's list. The unused prompt_template is
dropped from the HELMET loaders. No task hash changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The task settings now record only what a run measures, and the run reads
them from config.task_settings rather than HELMET_TASKS, so one record
both drives the run and identifies it:

- helmet: a whitelist of the measured HELMET_TASKS keys (length tier,
  shots, token budgets, question cap, thresholds, data subset, chat
  format). Suite flags, the task class and values that are already
  TaskConfig fields (limit, generation budget, stops) are left out, so a
  suite change or -o limit no longer moves or misreports the hash.
- constants: each loader's MEASURED_CONSTANTS, which lists every piece of
  prompt text it renders -- templates, demo wrappers and separators, the
  truncation notice -- and its selection thresholds. Text that was built
  inline is now a named constant, with the rendered prompts unchanged.
  The completion prompt's answer-prefix separator is listed too;
  RulerTask now reads it from a class attribute.
- sources and upstream: the pinned revisions and the HELMET commit.

An override of the code-fixed parts, unknown or missing HELMET keys, or
num_fewshot, fewshot_seed or split, which HELMET has no use for, is
refused. Every HELMET hash moves; no other spec's does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@jopetty

jopetty commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

NB2: HelmetTask now subclasses RulerTask (8860014)

  • HelmetTask(RulerTask) follows the RulerPlusTask pattern. It overrides _tasks_registry, _name_prefix, _load_data and process_doc, plus request_type and format_request. Those last two handle the chat-template branch and otherwise defer to super(). Everything else is inherited: __init__, instances, the metadata skeleton and extract_answer.
  • make_ruler_task_class is now the one factory. It takes class_prefix, limit, metrics, primary_metric, stop_sequences, extra_bases and attrs. _make_helmet_task_class is a thin call into it, and the judged tasks pass their JudgedTask mixin through extra_bases.
  • The newline between the prompt and the answer prefix is now a RulerTask attribute, so both tasks render it from the same code.
  • Stop sequences are now a named argument rather than copied code. RULER keeps RULER_STOP_SEQUENCES, and HELMET passes ("\n",) to match upstream.

NB5: task_settings now drives the run (76b984a)

  • HelmetTask reads every measured value from self.settings, which comes from config.task_settings, instead of from HELMET_TASKS. That includes length tier, shots, token budgets, max_questions, chat template and sub-task.
  • An override the task can't honor is refused with a ValueError rather than silently hashed. That covers -o task_settings=... that doesn't match the task's own settings, and non-default num_fewshot, fewshot_seed or split.
  • The hash now covers only what the run measures:
    • A whitelist of measured keys, so limit and the suite flags (tag, ablation, judged) are left out.
    • The upstream commit (princeton-nlp/HELMET@aeadacc6) and the data sources.
    • Each loader's MEASURED_CONSTANTS.
  • The constants are explicit instead of grepped from module globals. They include TRUNCATION_POSTFIX, msmarco's passage templates and the "For example: … Now, read the following story" demo wrappers.
  • prompt_template is gone from the loaders' return values, so templates come only from the hashed constants.
  • Tests cover each direction: a constant change moves the hash, suite flags and limit don't, the run reads its settings from the config, and bad overrides are refused. task_hashes.json is regenerated, and only HELMET specs changed.

@YashasSamaga YashasSamaga 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.

1. Base models are sent chat requests

LongQA, summarization and cite set use_chat_template: True in their task settings (helmet_tasks.py:138,185,196,213,231,244), so HelmetTask.request_type always returns RequestType.CHAT for them. Upstream treats this as a run-level flag. Its configs set it for instruct models (they name Llama-3.1-8B-Instruct), and the README says to turn it off for base models:

--use_chat_template False # only if you are using non-instruction-tuned models, otherwise use the default.

With the flag off, upstream sends prompt_template as a completion, ending in the answer prefix (\n\nSummary:, \n\nAnswer:, or \nAnswer: for NarrativeQA). eval.py then prepends that prefix to the output before parsing.

Our runs predate 47581e4, so these tasks went out as completions with neither a chat template nor the prefix. On base models this breaks the tasks. At 16K, OLMicro-2.7B returned an empty string on 88 of 100 InfBench summaries (median 1 token: end-of-text right after "Now summarize the book.") and on 31 of 100 Multi-LexSum cases. On NarrativeQA it writes its own "Answer:" and then keeps inventing follow-up Q&A, which the judge marks disfluent. Since 47581e4, a base model would get a chat request instead. That's either a template it never trained on, or a vLLM error if the tokenizer has none.

Suggested fix: a run-level way to turn use_chat_template off, e.g. an override or a __base variant. It would send prompt_template as a completion and prepend the answer prefix to the output, as upstream does.

2. Prompts are never truncated with the evaluated model's tokenizer

Upstream truncates twice. truncate_llama2 cuts the documents to the nominal length in Llama-2 tokens, and the port does the same. Then, before generation, tokenize() in model_utils.py cuts again with the evaluated model's own tokenizer:

if tokenized_input.input_ids.size(1) > max_length - generation_max_length - buffer:
    truncate_length = tokenized_input.input_ids.size(1) - (max_length - generation_max_length - buffer)
    ...
    new_context = sample["context"][:context_tokens["offset_mapping"][0][-truncate_length][0]]

It drops the end of the context and keeps the instructions and question. The port only has the first step. KILT's second trim (helmet_kilt_loader.py:116) is measured in Llama-2 tokens, and MS MARCO has none. So any model whose tokenizer splits text into more tokens than Llama-2's overflows at its longest length, and vLLM rejects the prompt. What we saw:

  • Overflows for Qwen3 at 32K, SmolLM2 at 8K, Falcon-H1 at 128K, and Olmo-3-7B at 64K. Olmo-3-7B shares the Olmo tokenizer, and still about 6–7% of its 64K instances overflow.
  • A rejected prompt fails its whole batch, and batches mix lengths, so short tasks fail too. In Qwen3-4B, 85 batch errors took down 366 instances, including 19 of 100 json_kv__4096, where no prompt overflows.
  • 23 of 36 external models failed all four attempts on FailureBudgetExceeded. Only models with headroom pass: Qwen3.5 (trained to 262K) and Llama-3.2-1B get all 21 tasks at every length.

Suggested fix: port upstream's model-side cut. Truncate the end of the context to max_model_len - max_gen_toks tokens of the model's own tokenizer, at request time, ideally recording how many instances were cut per task.

3. The default judge has been retired

gpt-4o-2024-05-13 now fails on every call:

Error code: 404 - The model `gpt-4o-2024-05-13` has been deprecated

We ran with gpt-4o-2024-08-06.

4. Cite has only half its metrics

Upstream's Cite category averages six numbers, including citation_rec and citation_prec from the google/t5_xxl_true_nli_mixture NLI model (eval_alce.py, collect_results.py). The port has str_em and qampari_rec_top5 only (helmet.py:514: "needs AutoAIS and is not wired up yet"). So Cite, and therefore the overall HELMET score, isn't comparable with published numbers. Is wiring up AutoAIS planned for this PR? If not, the suite should probably name the category or the overall score as partial.

@gregorybchris gregorybchris left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This review was generated by an agent following REVIEW_GUIDE.md. It is not from a human reviewer. Reply in the PR thread and a maintainer will follow up.

Both blocking items from 10/26 are fixed, and so are Non-blocking 1, 2 and 5, as described. Nothing blocking remains. Before merge, I'd like one run of the judged tasks, since the parity runs skipped exactly the code the two blockers were about, and a note on where the table's Cite numbers come from.

What was checked (head 76b984a2, which is up to date with main at 94195eab):

  • CI is green. Locally, ruff check, ruff format --check and ty check src/ pass, and pytest tests/ --ignore=tests/integration gives 4560 passed and 36 skipped.
  • task_hashes.json only gains entries. No existing hash moves, so the RulerTask rebase left every RULER hash unchanged.
  • I compared load_multi_lexsum_dataset with upstream load_multi_lexsum at aeadacc6, step by step. It matches: the short-summary filter, the 65,536-token floor with BOS counted, the Dataset.shuffle(seed) permutation, and per-instance train demos from demo_seed. The pinned dev.json and train.json resolve on the Hub without a token.
  • I checked the judged tasks against the judge and scoring rules from #475, #492, #499, #477 and #512. They build on JudgedTask and ask through Judge.ask with the run's limiter. A reply that never parses leaves the output unscored and counts against the failure budget. judge_result keeps every raw reply, including the other rubrics' replies when one rubric fails. Truncated outputs are still judged, and truncation_rate is reported. judged = True applies OLMO_EVAL_JUDGE, and the 18 judged specs are pinned under with_judge_env. The judge goes through build_openai_judge_fn, so judge timing and the OpenRouter fallback come for free. The custom metrics see the same filtered responses as AccuracyMetric. The two gaps are Non-blocking 6 and 7.
  • The LongQA judge's prompt, correct_answers rendering, parse_output, model and temperature match eval_gpt4_longqa.py. Dividing gpt4_score by 3 matches the 100/3 scaling in collect_results.py.
  • I instantiated the three judged tasks. They resolve to gpt-4o-2024-05-13 at temperature 0.1, with budgets of 2048 (LongQA) and 4096 (summarization), and they declare OPENAI_API_KEY. JudgedTask comes first in the MRO, but it supplies only score_responses and extract_answer, so HelmetTask still builds the chat request.
  • The parity table holds for this head. All three runs used 47581e48, which predates c1f2a29e, 88600143 and 76b984a2. I rendered all 54 helmet_nojudge specs at 8k, 16k and 32k at both commits with stubbed loaders. Loader arguments, request type, prompt assembly, sampling parameters, metrics and limits are identical. The loader diffs between the two commits only move strings into named constants. The 8k log shows every category as Success with 5500/5500 scored, and its numbers match the table.

Not checked: any judged task on real data or with a real judge (Non-blocking 1), and the private helmet-plus files.

Non-blocking

  1. The judged tasks have never run.

    • narrativeqa, infbench_sum_eng and multi_lexsum are the code both blockers were about. Since the fix, they have run only on fixtures.
    • The parity runs used helmet_nojudge. So the table has no Summ row, and its LongQA row leaves out narrativeqa.
    • Only a real run can show three things:
      • The hosted multi_lexsum_val.jsonl covers every dev.json case that has a short summary. If not, the loader raises at load time.
      • The judge's parse rate with gpt-4o-2024-05-13 at these budgets.
      • Whether gpt4_f1 and gpt4_score land near the paper.
    • Could you run the three judged tasks at 8k for Llama-3.1-8B-Instruct with --no-upload? Please post the Summ row, LongQA with narrativeqa included, and the unscored-output counts. At the default limit of 100, that is about 700 judge calls.
  2. Where do the table's Cite numbers come from?

    • Upstream's Cite category (custom_avgs in scripts/collect_results.py) averages six metrics. Four of them are citation_rec and citation_prec, which need AutoAIS.
    • If the "paper" column is str_em and qampari_rec_top5 taken from upstream's per-dataset results, the comparison is fair. Please say so under the table.
    • If it is the paper's Cite category score, the two columns measure different things. The same question applies to "Avg of 6 categories" next to the paper's seven-category average.
    • Separately, helmet_cite__* and helmet_all__* average different metrics from upstream's Cite and overall scores. Neither the suite docstrings nor the description says so. Please name this deviation in both places.
  3. RAG is 2.0 to 2.5 points low at all three lengths.

    • The other categories land on both sides of zero, while RAG is low every time.
    • The three lengths share questions, so one cause is more likely than three separate draws.
    • One known difference is the demo draw:
      • Upstream load_qa (data.py:101-102) calls demos.shuffle(seed=h), a numpy permutation.
      • helmet_kilt_loader.py:207 calls random.Random(h).shuffle, so each question gets different demos.
    • This PR already has shuffled_indices in helmet_multilexsum_loader.py:102, which reproduces Dataset.shuffle. Could KILT use it, and could the RAG row be rerun? This is the open part of 10/26 Non-blocking 10.
  4. The rest of 10/26 Non-blocking 10 is still open.

    • helmet_narrativeqa_loader.py:124-126 uses one demo set for every instance. Upstream seeds each instance with demo_seed(document id + question, seed) (data.py:208). The comment there says HELMET "shuffles the demo pool without a seed", and that is not what upstream does.
    • MS MARCO (helmet_msmarco_loader.py:167) and ALCE (helmet_alce_loader.py:102, :115) still use random.Random where upstream uses Dataset.shuffle.
    • For each one, please either match upstream or list it as a documented deviation.
  5. HF_TOKEN is still not declared (10/26 Non-blocking 12).

    • allenai/helmet-plus is private, and no HELMET task lists HF_TOKEN in required_secrets.
    • The parity runs worked for two reasons: Llama-3.1 is gated, and the workspace holds jacksonp_HF_TOKEN.
    • A launch with an ungated model, in a workspace with no <user>_HF_TOKEN, would get a 401 at data load.
  6. The deterministic scorers still return 0.0 when they can't decide (10/26 Non-blocking 7).

    • Since #492, the rule is that a scorer returns 0 for a wrong or unparseable answer and raises when it cannot decide (CONTRIBUTING "Failures and scoring", AGENTS.md "Failures aren't scores"). The runner then leaves the output unscored and counts it against the failure budget.
    • These return 0.0 when the gold data is missing. That is a data error, not a wrong answer:
      • common/scorers/alce.py:64-65 (no qa_pairs) and :88-89 (no qampari_answers)
      • common/scorers/retrieval.py:24-25 and :39-40 (no qrels)
      • common/scorers/rouge.py:83-84 and :107-108 (no references)
      • common/scorers/substring.py:85-90 (no gold)
      • HelmetExactMatchScorer and InfbenchChoiceScorer (evals/tasks/helmet.py:319-320, :349-350)
    • The loaders always set these today, so this doesn't change current scores. It decides what a bad data file does: today it lowers the score with nothing recorded. Please raise in these branches and keep 0.0 for an empty or wrong prediction. A test per scorer that the missing-gold case leaves the output unscored through score_responses would cover it.
  7. judge_temperature doesn't follow the default-model rule from #512.

    • #512 made a task's default reasoning effort go with its default model. Once OLMO_EVAL_JUDGE or -o judge_model names another model, the default effort is dropped. HELMET's temperature of 0.1 stays instead. I checked on helmet_multi_lexsum__8192:
      • OLMO_EVAL_JUDGE=gpt-5.5-2026-04-23:medium gives judge_temperature=0.1.
      • -o judge_model=o3-2025-04-16 gives judge_temperature=0.1.
    • Reasoning models reject a non-default temperature, and build_openai_judge_fn then stops sending it. So the hash records 0.1 for a judge that never received it.
    • Could JudgeSettings.with_config and the OLMO_EVAL_JUDGE path treat a class-default temperature like the default effort? It would then be dropped when the model changes, unless -o judge_temperature is also given. This needs a test in each direction.

Nits

  • Nit: The judge_temperature addition to CONTRIBUTING.md (line 158) runs past the file's line width. Please rewrap the bullet.
  • Nit: The comment at helmet.py:493 still says RecallMetric's substring scorer "is equivalent" to upstream's substring_exact_match for json_kv. It only lowercases (10/26 Non-blocking 3).
  • Nit: >128k leftovers are still there (10/26 Non-blocking 14): helmet_tasks.py:7 "declares its own context_sizes", the CONTEXT_SIZES alias at :28, and the "256k"/"2m" examples at helmet_loader.py:58 and :188.

Status of the 10/26 review

Item Status
B1 Judge failures score 0.0 Fixed
B2 Multi-LexSum selection Fixed. Matches upstream step by step
NB1 Move to JudgedTask Done
NB2 Build on RulerTask Done. RULER hashes unchanged
NB3 Scorer and metric duplication Open
NB4 Loader copy-paste Open
NB5 task_settings drives the run Done. Requests are unchanged from the parity commit
NB6 Context trimming outside KILT Open
NB7 Deterministic scorers return 0.0 on missing gold Open (item 6)
NB8 HF encoder-decoder support Open, and still in this PR
NB9 RULER pin and rouge-score in this PR Open
NB10 Parity gaps Partly fixed. Multi-LexSum and the judge's fenced fallback are done; KILT, MS MARCO, ALCE and NarrativeQA demos are open (items 3 and 4)
NB11 Upstream commit and real-model trial Done for the non-judged tasks. Judged tasks are open (item 1)
NB12 Secrets OPENAI_API_KEY is done. HF_TOKEN is open (item 5)
NB13 Loader and truncation tests Partly done. Multi-LexSum and the judges are covered; the infbench, MS MARCO, ALCE and NarrativeQA loaders and sample_jsonl_rows are not
NB14 >128k leftovers Partly done (see Nits)

Before merge

Please post the judged-task run from item 1 and clarify the Cite column from item 2. Please also fix items 6 and 7. They are the two places where the PR doesn't yet follow the scoring and judge rules from #492 and #512, and both are small. Items 3 to 5 are each small too, and I'd encourage doing them here. Item 3 could close the one consistent gap in the table.

If you defer the rest, please file follow-up issues and link them here. The description links none yet:

  • duplication (NB3, NB4)
  • context trimming (NB6)
  • scorers that return 0.0 on missing gold (NB7)
  • the HF encoder-decoder support, to land with AutoAIS (NB8)
  • any parity gaps from items 3 and 4 that you don't fix here

Once those are done and CI is green, you're free to merge.

@gregorybchris
gregorybchris self-requested a review October 29, 2026 17:09
@gregorybchris

Copy link
Copy Markdown
Collaborator

@jopetty Yashas had some good points that would be good to change before merging.

  1. Could you add a :base variant so that we support not just post-training evals?
  2. The eval prompts need to be truncated to work with the evaluated model's context limits. I think this is fine because the original HELMET repo does it
  3. Yashas did a sweep over judges and we agreed that gpt-5.4-2026-03-05 would be fine to use here. Could you change it?
  4. This PR doesn't implement the citation metrics for cite. From Yashas' agent:

Upstream's Cite averages citation_rec and citation_prec (AutoAIS with t5_xxl_true_nli_mixture) along with str_em and qampari_rec_top5. The port has only the latter two, so Cite and the overall score aren't comparable with published HELMET.

jopetty and others added 6 commits October 30, 2026 12:55
# Conflicts:
#	src/olmo_eval/evals/tasks/common/base.py
OpenAI retired gpt-4o-2024-05-13, so HELMET's judged tasks now default
to gpt-5.4-2026-03-05, the judge picked in Yashas's sweep. Like the rest
of the gpt-5 series it rejects a non-default temperature, so HELMET no
longer sets one.

A task's default judge temperature now goes with its default model, as
the default reasoning effort does: OLMO_EVAL_JUDGE or -o judge_model
naming another model drops it unless -o judge_temperature sets one, and
JudgeSettings.with_config does the same. Only the 36 judged HELMET specs
change hash.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Upstream treats use_chat_template as a run-level flag and asks for it to
be off for base models. The :base variant turns it off in task_settings,
so LongQA, summarization and cite go out the way upstream sends them
then: a completion of the user template, a newline or blank line, and
the answer prefix. InfBench, Multi-LexSum and ALCE put a blank line
before the prefix, as their upstream prompt_template does, and record
that separator in their measured constants.

Upstream also prepends the answer prefix to each completion before
parsing, which decides what LongQA's parser and the summarization judge
see. For the chat-format tasks run as completions, HelmetTask now puts
the prefix back in strip_thinking_traces, which runners call before
scoring, and keeps the generation in original_text. The completion-format
categories keep scoring the bare output their parity runs validated, and
their :base variant is the task itself.

Every HELMET suite gets a :base twin made of its tasks' :base variants.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…indow

HELMET's loaders truncate documents to the tier length in Llama-2
tokens, but upstream also cuts again before generating (tokenize in
model_utils.py): with the evaluated model's own tokenizer, it removes
the end of the context until the prompt fits the tier less the
generation budget. Without that second cut, any model whose tokenizer
splits text more finely than Llama-2's overflows its window at its
longest tier, and the server rejects the request.

LMRequest gains an optional ContextFit naming the text in the prompt
that may be cut, with a prompt-token budget. The vLLM server provider
counts the prompt as it will render it, chat template included, against
the smaller of that budget and the room the window leaves for
max_tokens, and removes the overflow from the end of the text using the
model's local tokenizer's offsets, recounting up to three times since a
cut can shift tokens at its edge. It records how many tokens it cut in
each output's metadata.

HelmetTask records where the document sits in each rendered prompt and
names it as the ContextFit, with upstream's budget of the tier less
max_gen_toks. Every HELMET task reports context_truncation_rate, the
share of instances whose context was cut, read from the outputs so the
judged tasks report it too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
HELMET's Cite score averages six numbers: str_em, citation_rec and
citation_prec for ASQA, and qampari_rec_top5, citation_rec and
citation_prec for QAMPARI. The citation metrics come from AutoAIS, which
asks google/t5_xxl_true_nli_mixture whether each claim's cited documents
entail it. Without them Cite, and so the overall HELMET score, could not
be compared with published numbers.

AutoAisScorer ports compute_autoais from HELMET's eval_alce.py: NLTK
sentences of at least five characters (QAMPARI: comma-separated items
prefixed with the question), at most three citations per claim, a claim
with no citation or one past the shown documents not entailed, and
upstream's per-citation precision check. It calls the NLI model through
an auxiliary provider named "autoais", records both scores and every
NLI call on the output, and raises when a call fails. CitationMetric
reads the scores and, like upstream, leaves out outputs with no claims;
each Cite task's primary cite_score is the mean of its three metrics,
so the category average is upstream's six-number mean. ALCE instances
keep the documents their citations point to.

vLLM cannot serve T5, so the model runs in the HF provider, using the
encoder-decoder support already in this PR. The inference manager can
now start an hf auxiliary provider: it sets a GPU aside and the scoring
process loads the model there, via a new device argument; the provider
serializes its async calls, since generate is not thread-safe. The
helmet harness preset serves the model, pinned to its Hub commit, in
bf16 as upstream loads it. The Cite tasks record it as judge_model, and
the runner's pre-generation provider check now covers any context
scorer that names a provider, so a run without it fails before
generating. helmet_alce_*:no_autoais scores answer correctness alone for
runs without the GPU; the nocite ablations keep answer correctness
only, as upstream scores them without --citations.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The AutoAIS smoke run scored every instance, but its predictions held
neither the citation scores and NLI calls nor how many context tokens
each request lost: prediction files keep only known output-metadata
keys. AutoAisScorer now records under judge_result, the key the other
judged tasks use, and build_predictions keeps context_cut_tokens.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@jopetty

jopetty commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

From Claude:

1. :base variant (cd7bd9a)
Every HELMET task and suite has a :base twin, e.g. helmet_all__8192:base, which turns use_chat_template off as upstream's --use_chat_template False does. LongQA, summarization and cite then go out as upstream's completion prompt: the user template, then \n or \n\n as each upstream prompt_template uses, then the answer prefix. As in upstream's eval.py, the prefix is put back on each output before parsing and judging. The raw generation is kept in original_text. The categories that already run as completions don't change, and their :base shares the task's hash.

2. Truncation with the evaluated model's tokenizer (f9488cf, e9c9356)
HELMET requests now name their document context in a new LMRequest.context_fit. The vLLM server provider counts the rendered prompt, chat template included. The limit is the smaller of upstream's budget (tier − max_gen_toks) and the window − max_tokens. If the prompt is over, the provider cuts the overflow from the end of the context using the model tokenizer's offsets, as upstream's tokenize() does. Tasks report context_truncation_rate, and predictions record context_cut_tokens. Only the vLLM server provider implements this so far.

Smoke run: Qwen3-4B-Instruct-2507 with max_model_len=32768, all 18 judge-free tasks at 32k, 25 instances each (01M66CB95DB2CJZQJATF385A35). Every instance scored, with no overflows or failed batches. Only json_kv needed the cut: its dense UUIDs run long in Qwen's tokenizer, so every instance was truncated (recall 52). Nothing else was cut.

3. Judge: gpt-5.4-2026-03-05 (c8425fa)
HELMET no longer sets a judge temperature, since gpt-5 models reject non-default ones. This also covers item 7 from 10/28: a task's default judge_temperature now belongs to its default model, and is dropped when OLMO_EVAL_JUDGE or -o judge_model names another model, unless -o judge_temperature sets one. The CONTRIBUTING line-width nit is fixed too.

4. AutoAIS for Cite (8e333fc, e9c9356)
AutoAisScorer ports compute_autoais:

  • NLTK sentences of at least 5 characters, or for QAMPARI, list items with the question prepended
  • at most 3 citations per claim
  • upstream's per-citation precision check

The NLI calls are saved under judge_result, and a failed call leaves the output unscored. Each Cite task's primary cite_score is the mean of its answer metric, citation_rec and citation_prec, so helmet_cite__* is upstream's six-number Cite average.

The NLI model is google/t5_xxl_true_nli_mixture, pinned, in bf16. It runs through the HF provider's encoder-decoder support, which gives 10/28 NB8 its consumer. The inference manager can now start an hf auxiliary provider on a GPU of its own, and -H helmet serves it as autoais. Cite requires it by default: the runner's provider check fails a run without it before generating. helmet_alce_*:no_autoais scores correctness alone. Documented deviations: citations are checked against the shown documents rather than upstream's 2,000-document pool, and T5 uses its fast tokenizer.

Smoke run: Llama-3.1-8B-Instruct, 8k, 25 instances per task, all scored (01M66DD710G7RMYEB5GZZ8E00R):

ASQA ours ASQA paper QAMPARI ours QAMPARI paper
Correctness 48.1 45.2 20.8 28.4
Citation recall 58.8 61.3 12.1 14.6
Citation precision 47.9 52.1 12.6 16.4
Cite score 51.6 52.9 15.2 19.8

That's a Cite average of 33.4 against the paper's 36.3, within the noise of 25 instances.

@gregorybchris
gregorybchris merged commit 747508d into allenai:main Oct 30, 2026
8 checks 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.

6 participants