prompting · reorder-context-by-relevance

Put 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.

Addresses: Losing information in long inputs

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

Sources