Skip to content
ML Academy

LLMs, GenAI, RAG, agents, evaluation · insight-0611

Put the strongest evidence at the start of the context, not buried in the middle

Evidence type
empirical finding
Difficulty
easy
Roles
Applied AI, ML engineer
Industries
cross-industry

Summary: situation, action, reason, boundary

  1. Situation

    Context assembly concatenates passages in arbitrary order, for example by document id or ingestion time.

  2. Action

    Order passages by reranker score with the best first, keep the total short, and test position sensitivity by moving the gold passage on a few golden questions.

  3. Reason

    Liu and colleagues found a position effect: accuracy was often highest when relevant information was at the beginning or end of the input and dropped when it sat in the middle, even for long-context models.

  4. Boundary

    Multi-passage RAG prompts, long tool outputs, conversation histories.

Symptom or risk

The model answers from a weaker passage at the top while the decisive one sits in the middle of a long context.

Exceptions

Newer models may show weaker position effects; measure on your model rather than assuming the published curve.

Trade-offs

Strict score ordering can separate passages that only make sense together; keep adjacent chunks of one document together.

Pitfalls

Fixing ordering while the context still holds 40 passages; shortening the context usually matters more.

Lessons and concepts

Claims and their sources