Skip to content

Add remaining HELMET task categories (RAG, rerank, summ, cite, LongQA judge) - #299

Merged
jopetty merged 9 commits into
allenai:jacksonp/ladderfrom
jopetty:helmet-full-suite-ladder
Aug 17, 2026
Merged

jopetty merged 9 commits into
allenai:jacksonp/ladderfrom
jopetty:helmet-full-suite-ladder

Conversation

@jopetty

@jopetty jopetty commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Completes the HELMET integration started in #287. That PR was merged while GitHub was showing a stale cross-fork head, so only its first 5 commits (ICL + two InfiniteBench LongQA tasks + ROUGE) actually landed — this PR carries the remaining 9, rebased onto current jacksonp/ladder (no conflicts; the intervening #293/#288 touch only ruler files and CI config).

With this merged, all seven HELMET categories are registered — 124 tasks:

category tasks lengths metric
recall json_kv 4k–2m substring recall (already on ladder)
rag kilt_{nq,triviaqa,hotpotqa,popqa} 4k–128k substring exact match
rerank msmarco_rerank_psg 4k–128k NDCG@10
longqa infbench_{qa,choice}_eng (on ladder), narrativeqa 4k–128k ROUGE-L F1 / EM / GPT-4 judge
summ infbench_sum_eng, multi_lexsum 4k–128k GPT-4 judge (fluency-gated F1)
icl 5 datasets (on ladder) 4k–128k HELMET-normalized EM
cite alce_{asqa,qampari} (+nocite) 4k–128k str_em / qampari_rec_top5

Data comes from allenai/helmet-plus (pre-retrieved KILT/MS MARCO/ALCE files, summ keypoints, manifests) — re-hosted unpacked from HELMET's data.tar.gz so consumers fetch one file per task/length.

What's in here beyond tasks

  • LLM-judge scorers for narrativeqa (fluency × correctness / 3) and summarization (3 judge calls — fluency, key-point recall, sentence precision — combined as HELMET's gpt-4-f1). Rubrics extracted verbatim from HELMET (~55KB, round-trip verified). Judged tasks live in helmet_all__*; helmet_nojudge__* excludes them.
  • NDCG@10 — verified against pytrec_eval across 900 randomized cases (linear gain, established empirically) without taking on the compiled dependency.
  • Encoder-decoder support in the HF provider (auto-detected from config), groundwork for AutoAIS citation scoring; the seq2seq generate path still needs a GPU smoke test (torch is CUDA-gated locally).
  • A review pass (final commit) that fixed real scoring-fidelity bugs found by re-auditing everything against upstream: ICL exact match now uses HELMET's punctuation/article normalization ("label: 42." scored 0 before, 1 under HELMET), ROUGE takes max over raw+extracted generations per HELMET's default_post_process, the LongQA judge no longer truncates at 10 tokens on the provider path, and the KILT loader streams its 1–3GB 128k-tier files instead of holding them parsed (selection verified byte-identical).
  • 44 offline tests (tests/evals/tasks/test_helmet.py): parser/scorer reference cases checked against upstream implementations, task inventory and budgets, suite structure.

Reviewer notes

  • RAG/rerank limit caps questions, not instances — each question repeats per gold-passage depth (6× for nq/triviaqa/popqa, 3× for hotpotqa/rerank), HELMET's "lost in the middle" sweep. limit=100 ⇒ ~600 nq instances.
  • ICL prompts render at 0.78–0.85× nominal under Olmo 3 (HELMET calibrated against Llama-2); kept verbatim for comparability, documented in helmet_tasks.py, measurable via scripts/internal/calibrate_helmet_icl_shots.py.
  • ALCE scores answer correctness only; citation grounding (citation_rec/citation_prec) needs AutoAIS (11B NLI model) wired as an auxiliary provider — deliberate follow-up.
  • multi_lexsum reads allenai/helmet-plus directly: its HF loading path is broken under datasets ≥4 and the hosted file is the full validation split.

Full suite: 2040 passed, 26 skipped.

🤖 Generated with Claude Code

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 merged commit 34f87c4 into allenai:jacksonp/ladder Aug 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant