reorder-context-by-relevance TEC-0018Put important material first or last
Order retrieved documents so the most relevant sit at the start and end of the prompt.
Because recall is best at the edges of the context, rank retrieved passages by relevance and place the top ones first and last, weakest in the middle. Also truncate aggressively: fewer, better passages beat many.
Contexts: Retrieval-augmented QA, Long document
Does it work?
contested1 supporting · 2 contesting sources · last moved 2026-09-07
Efficacy claims — what this technique actually moves, under which conditions, and whether that has been contested.
Needs: documents or an index to retrieve from
Cost: low
Fails when:
- Which passage matters is not known before the model reads them, or the skew sits in the representation so that reordering does not remove it. This claim is contested on exactly that point. (helps)
- mechanismsingle papercontestedWhere a passage sits in a long input changes how much the model uses it — accuracy is highest when the needed information is at the very start or the very end and lowest when it is in the middle — so ordering retrieved passages to put the most relevant ones first is a real lever on accuracy.
- supports Lost in the Middle: How Language Models Use Long Contexts (2023)
- contests Large Language Models in Resolving Contextual Knowledge Conflicts (2026)
- contests The new rules of context engineering for Claude 5 generation models (2026)
Code
- https://github.com/nelson-liu/lost-in-the-middle — Evaluation code and data to measure position sensitivity for your own model.verified 2026-09-02
Sources
Whether a technique works is a claim. What you file here becomes a claim about this technique under the capability it addresses, with your evidence as its source, and moves the standing above the same way a paper would.