prompting ·
reorder-context-by-relevancePut 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.
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