Skip to content

fix(benchmarks): correct LoCoMo category label mapping (official 1=single-hop, 2=temporal, 3=multi-hop) - #1222

Merged
ajianaz merged 1 commit into
developfrom
fix/locomo-category-labels
Sep 10, 2026
Merged

ajianaz merged 1 commit into
developfrom
fix/locomo-category-labels

Conversation

@ajianaz

@ajianaz ajianaz commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

What

Corrects the LoCoMo category label mapping in benchmarks/locomo/:

  • scripts/convert_locomo.py: CATEGORY_NAMES now follows the official upstream LoCoMo numbering — 1: single-hop, 2: temporal, 3: multi-hop, 4: open-domain. It previously carried a rotated map (1: multi-hop, 2: single-hop, 3: temporal).
  • results/{default,vector,fts5}-1536.jsonl: question_type relabeled in place (695/1536 rows each). Retrieval results, retrieved session ids, and metrics are untouched.
  • RESULTS.md: per-category tables and the accompanying narrative recomputed from the same committed artifacts, plus a dated correction note.

Why

The committed converter mislabeled 699/1536 evaluable QA (45%). Verified against three independent sources:

  1. Upstream locomo10.json (snap-research): category counts 282 / 321 / 96 / 841 — matching the Agent Memory Benchmark harness docstring (1 → single-hop, 2 → temporal, 3 → multi-hop, category 5 adversarial excluded) and contradicting the old in-repo map.
  2. Raw question text: category 2 is exclusively "When did... / How long did..." (temporal); category 3 involves cross-session synthesis with no dates (multi-hop).
  3. A fresh conversion run with the fixed map shows zero drift in questions, answers, and gold session ids — only labels change.

Overall numbers are unaffected (labels never enter any metric): fusion any@5 0.840, strict@5 0.716, any@10 0.939, strict@10 0.850 — identical before and after. What changes is attribution: the weakest category is multi-hop (any@5 0.630, n=92), not temporal; the previous "temporal is weakest, consistent with LongMemEval-S" reading was an artifact of the rotated labels. LoCoMo temporal is single-evidence date lookup and retrieves fine (0.816 any@5).

Testing

  • python scripts/convert_locomo.py --data locomo10.json --out <fresh> reproduces 1,536 evaluable QA; per-question diff vs the previously committed conversion: 0 differences in question/answer/answer_session_ids (only question_type differs, per the corrected map).
  • Recomputed the full fusion strategy table from results/default-1536.jsonl after relabeling: overall strict@5 (binary) 0.716, coverage@5 0.776 — byte-identical to the pre-fix headline.
  • Category counts post-fix: single-hop 282, temporal 321, multi-hop 96, open-domain 841 (matches upstream exactly).
  • Semantic spot check (raw upstream questions, seed 11): category 1 samples are single-fact lookups ("What video games does Nate play?"), category 2 samples are all date questions ("When did Jolene adopt her snake Susie?"), category 3 samples are cross-session synthesis ("Which major holiday season coincides with Evan's wedding?").

Note: local cora review flagged the corrected CATEGORY_NAMES line as swapping multi-hop/temporal IDs; that is the pre-fix state it was trained/configured to catch. The raw-question semantic check above is the deciding evidence that the new mapping is the official one.

…ngle-hop, 2=temporal, 3=multi-hop)

convert_locomo.py carried a rotated CATEGORY_NAMES map: categories 1/2/3 were
labeled multi-hop/single-hop/temporal instead of the official upstream mapping
(single-hop/temporal/multi-hop, verified against snap-research/locomo10.json
counts 282/321/96/841 and the AMB harness docstring). 699/1536 QA carried a
wrong question_type label. Labels never enter any metric, so all overall
numbers are unchanged; the three committed jsonl artifacts are relabeled in
place (question_type only, retrieval results untouched, verified zero drift
against a fresh conversion) and the RESULTS.md per-category tables + narrative
are recomputed. Key narrative correction: the weakest category is multi-hop
(any@5 0.630, n=92), not temporal; the old 'temporal is weakest, consistent
with LongMemEval-S' reading was an artifact of the rotated labels.
@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

❌ Blocked — critical issues found.

🔴 Error (2)

  • benchmarks/locomo/results/vector-1536.jsonl:1 — Every question_type was rewritten with the rotated mapping: e.g. conv-26_q0 changed "single-hop"→"temporal" (numeric category 2, should be "multi-hop") and conv-41_q39 changed "temporal"→"multi-hop" (numeric category 3, should be "temporal"). Metric values are untouched, but any aggregation keyed on question_type (e.g. mean recall for "temporal") now averages over the wrong question set.
  • benchmarks/locomo/scripts/convert_locomo.py:30 — The new mapping assigns 2→"temporal" and 3→"multi-hop", but the LoCoMo dataset defines category 2 as multi-hop and category 3 as temporal (official ordering: 1 single-hop, 2 multi-hop, 3 temporal, 4 open-domain, 5 adversarial). The old code had categories 1/2 swapped with 3 correct; this change fixes category 1 but introduces a new 2↔3 swap, so the rotation is only partially corrected. Every numeric-category-2 and -3 question will be mislabeled downstream, silently corrupting per-category metric aggregation.

Review powered by cora-code · BYOK · MIT

@ajianaz

ajianaz commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator Author

Re: Cora review — verified false positive (evidence below)

The review compares the new labels against the rotated pre-fix mapping, which is exactly the bug this PR corrects. Verification against raw upstream locomo10.json (snap-research), all re-runnable:

1. The two cited examples — both confirm the NEW labels:

  • conv-26_q0 — raw question: "When did Caroline go to the LGBTQ support group?", gold answer: "7 May 2023", upstream category int = 2. A DATE question = temporal (the new label). The bot claims it should be "multi-hop" — that is the old rotated map speaking.
  • conv-41_q39 — raw question: "Around which US holiday did Maria get into a car accident?", upstream category int = 3 = multi-hop (cross-session synthesis: accident events × holiday calendar). The bot claims "temporal".

2. Category-count identity: upstream counts are 282 single-hop / 321 temporal / 96 multi-hop / 841 open-domain — matching both the snap-research dataset and the Agent Memory Benchmark harness docstring (1 → single-hop, 2 → temporal, 3 → multi-hop, category 5 adversarial excluded). The old in-repo map contradicted both.

3. Zero drift: a fresh conversion with the fixed map produces byte-identical questions, answers, and gold answer_session_ids for all 1,536 QA — only question_type changes. Metric values are untouched; overall numbers recompute identically (any@5 0.840, strict@5 0.716).

4. Semantic sanity: raw category 2 questions are exclusively "When did... / How long did..."; raw category 3 questions are cross-session synthesis with no dates ("Which major holiday season coincides with Evan's wedding?").

Given the above, treating this review block as a false positive and proceeding — the CI Cora Review gate (5m12s run on the actual diff) passed.

@ajianaz
ajianaz merged commit 42d1e66 into develop Sep 10, 2026
17 checks passed
@ajianaz
ajianaz deleted the fix/locomo-category-labels branch October 13, 2026 00:57
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