Your team is tuning top-k for the retriever in a production RAG system. What is the strongest reason NOT to just push top-k to its highest possible value?
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
Higher top-k costs more tokens and latency, then hurts faithfulness through lost-in-the-middle attention sag and precision dilution. Recall saturates around 5-15 while costs keep climbing.
Imagine asking a friend a question and handing them a stack of fifty printed pages they have to read before answering. Three of those pages contain the answer; the other forty seven are vaguely related. Your friend now has to find the three useful pages, ignore the rest, and keep their thinking sharp. Most people would do worse than if you had handed them just five pages that included the three good ones. They would take longer, get distracted, and sometimes pick a wrong fact from the noise. RAG works the same way. More retrieved chunks does not mean better answers past a point. Recall plateaus, latency climbs, and the model's attention spreads too thin across mostly irrelevant content.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
3 min: enumerate the three pressures (cost, lost-in-the-middle, precision dilution), explain why recall saturates while faithfulness peaks then drops, and describe the retrieve wide rerank narrow production pattern.
| top-k size | Recall | Latency / cost | Faithfulness | Use pattern |
|---|---|---|---|---|
| top-k = 3 | Often misses borderline cases | Cheapest | High when retrieval is good, brittle when not | Strict latency budgets |
| top-k = 5-10 | Strong recall on most corpora | Modest | Typically peaks here | Common production default |
| top-k = 20-50 | Recall plateau | Notable token cost | Starts declining without rerank | Retrieval pool for reranker |
| top-k = 100+ | Marginal recall gain | High cost and latency | Often worse than top-10 | Only as a reranker candidate pool |
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Pushing top-k to a high number to maximize recall while ignoring the three downstream costs: token cost and latency, lost-in-the-middle attention sag, and precision dilution from marginal chunks.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.