Skip to content
Eval Suites50

Lost in the middle and how to test evidence position

Sources checked 2 min read · By the Eval Suites editors

In brief

Lost in the middle describes a drop in performance when relevant evidence sits deep inside a long input. Test your model by moving the same evidence between the beginning, middle and end of a fixed set of passages. Require the right answer and the passage ID that supports it.

Keep the evidence constant as you change its position

Liu and colleagues moved the relevant document within a multi-document question-answering prompt. Several of the tested models did better when the document sat near an edge than when it sat in the middle. The same paper tested placing the query before and after the context. That helped the synthetic key–value task much more than the multi-document task.[1]

Hold the model, question, passage set, prompt wrapper and output limit fixed within each comparison. Rotate the other passages too. With only one ordering per position, the correct passage might always sit next to a tempting old answer in the middle. Use the same rotations for each position and verify the actual input after truncation. If the evidence is absent, record a packing failure.

Build the Bluebell Seed Library position fixture

Ask “When does the East desk close on Thursday under the current notice? Return the closing time and passage ID.” In this fictional fixture, the answer is 6 PM with east-current. The archived East notice and current West notice supply plausible wrong answers. Every rotation contains the same five passages. Within each rotation, only the slot occupied by east-current changes.

Generate 12 offline prompts with counterbalanced distractor order
distractors = [
    ('east-archived', 'Archived East desk notice. Thursday closes at 5 PM.'),
    ('west-current', 'Current West desk notice. Thursday closes at 7 PM.'),
    ('returns', 'Seed returns use the box next to the East desk.'),
    ('weekend', 'The East desk opens at 10 AM on Saturday.'),
]
evidence = ('east-current', 'Current East desk notice. Thursday closes at 6 PM.')
cases = {}
for rotation in range(len(distractors)):
    neighbors = distractors[rotation:] + distractors[:rotation]
    for position, index in [('first', 0), ('middle', 2), ('last', 4)]:
        order = neighbors[:index] + [evidence] + neighbors[index:]
        cases[position, rotation] = order

assert len(cases) == 12
for (position, rotation), passages in cases.items():
    assert set(passages) == set(distractors + [evidence])
    assert passages.index(evidence) == {'first': 0, 'middle': 2, 'last': 4}[position]

The fixture establishes the expected answer and passage positions. It makes no model calls. To use it for your application, replace the short passages with realistic documents and run each order through the same formatter. Confirm that the evidence stays in the intended part of the tokenized input. If a case requires two sources, add a condition where they are far apart. RULER explicitly tests tasks beyond finding one literal value, including multi-hop tracing and aggregation.[2]

Read the failures by position and source

Illustrative grader outcomes for the Bluebell fixture
Returned resultVerdictWhat to inspect
6 PM with east-currentPassCorrect answer and source
6 PM with west-currentFailCitation mapping or guessing
5 PM with east-archivedFailThe answer used a superseded record
Declines with evidence presentFailPrompt, evidence use or formatter

Report passes over total attempts for each position and retain the paired case IDs. Include an evidence-only control and a version with no current East notice. In the no-evidence version, a correct response says the current closing time cannot be determined. If the evidence-only case fails, fix the task wording or scorer first. If only the middle cases fail and the rendered inputs contain east-current, try a shorter context or a different packing policy on the same cases.

If the model uses the wrong passage across positions, trace the answer and supporting evidence with the RAG triad's worked example.

Related suites

Related reading

Sources

  1. 1. Lost in the Middle: How Language Models Use Long Contexts · Transactions of the Association for Computational Linguistics · Paper · Sources checked
  2. 2. RULER: What's the Real Context Size of Your Long-Context Language Models? · Conference on Language Modeling · Paper · Sources checked