The dataset-adapter seam for the honest evaluation harness.
Every eval dataset — LongMemEval now, a license-clean BEIR slice later — is normalised to
a list of Instances so the runner and the ranking metrics are dataset-agnostic. An
adapter's only job is to turn its native format into Instances; nothing downstream
knows or cares which corpus it came from.
An Instance carries everything the runner needs and nothing it doesn't:
memories— retain-ready maps (each with a stable"id", mirrored intometadata["eval_id"]so recall results can be mapped back to their label).relevance— graded gain per memory id (0 irrelevant … n ideal). Scoring reads ids and labels only, never answer text, so a corpus phrase earns nothing.reference_answer/abstention?— for grading reflect (a correct answer, or a correct refusal when the evidence is absent).
Summary
Functions
Stamp each memory's stable "id" into metadata["eval_id"] so recall results (which
echo metadata) can be mapped back to their relevance label. Idempotent.
Inject k distractor memories into each instance, sampled deterministically from the
memories of other instances (relevance 0). This turns an evidence-only split (where
every candidate is relevant, so retrieval is trivial) into a distractor-heavy retrieval
task — the setting the full LongMemEval haystack provides natively. Distractor ids are
namespaced so they never collide with, or accidentally become, a relevant id.
Extract the ranked list of eval ids from a recall response's results.
Types
Functions
Stamp each memory's stable "id" into metadata["eval_id"] so recall results (which
echo metadata) can be mapped back to their relevance label. Idempotent.
@spec pool_distractors([t()], pos_integer(), integer()) :: [t()]
Inject k distractor memories into each instance, sampled deterministically from the
memories of other instances (relevance 0). This turns an evidence-only split (where
every candidate is relevant, so retrieval is trivial) into a distractor-heavy retrieval
task — the setting the full LongMemEval haystack provides natively. Distractor ids are
namespaced so they never collide with, or accidentally become, a relevant id.
Deterministic in seed: no wall-clock or global RNG, so the eval is reproducible.
Extract the ranked list of eval ids from a recall response's results.