
Recall/Precision: The Trade-off That Decides Retrieval Quality
Raising top-k always pushes recall up and precision down - that's a mathematical consequence, not a misconfiguration. The real question is which one to optimize first.
Part of: The RAG Pipeline: 5 Decisions That Control Answer Quality
Ask a RAG pipeline to retrieve more chunks and something interesting happens: the odds of catching the one chunk that actually answers the question go up, and the odds that any given retrieved chunk is actually relevant go down. Both are true at the same time, moving in opposite directions, from the exact same knob. That knob is top-k, and treating it as a single number to tune rather than two competing metrics to balance is why so many RAG pipelines either miss answers they should have found or drown the model in irrelevant context.
Recall and precision aren't a single "retrieval quality" score - they're two different questions, and a pipeline can be excellent at one while failing badly at the other.
The Recall/Precision Trade-off Flow
Why Recall and Precision Pull in Opposite Directions
Recall asks: of all the chunks that would actually help answer this question, how many did we retrieve? Precision asks: of everything we retrieved, how much of it was actually useful? Widening top-k can only add chunks, never remove the ones already retrieved - so recall can only go up or stay flat as k increases, while precision, diluted by every additional chunk that isn't relevant, can only go down or stay flat. This isn't a bug in a specific pipeline or embedding model - it's a direct mathematical consequence of how the two metrics are defined relative to k.
Why Recall Has to Win the Argument First
A low-precision retrieval still hands the model the right information, buried in noise it has to filter through - a solvable problem, since modern models are reasonably good at ignoring irrelevant context when the relevant piece is present. A low-recall retrieval hands the model nothing it needs, and there's no fixing that afterward: no reranker can promote a document that was never in the candidate set, and no amount of prompting sophistication makes an LLM invent facts it was never shown. This is the core reason retrieval evaluation work (Pinecone's RAG evaluation series, among others) treats recall as the metric to optimize first - a precision problem costs you some noise; a recall problem costs you the answer.
What a Wider Top-k Actually Costs You
Pushing k up to chase recall isn't free even after recall has already hit its ceiling. Every extra chunk in the context window is extra tokens to embed, extra tokens to pay for at generation time, and extra material the model has to correctly identify as irrelevant instead of using. That last part isn't guaranteed - a large, noisy context increases the chance the model latches onto a plausible-looking but wrong chunk, or blends details from an irrelevant document into an otherwise correct answer. Treat top-k as a budget you spend deliberately, not a dial you max out "to be safe."
Worked Example: Changing Top-k Changes Recall/Precision
Recall has hit its ceiling - every relevant chunk is present. The other 6 are noise, but the model has everything it needs to answer correctly if it can look past that noise.
Reading Your Own Recall/Precision Curve
None of this is useful without a way to measure it on your own documents and your own questions. That requires a small evaluation set with known-correct answers - a set of realistic queries paired with the specific chunks that should be retrieved to answer them - built the same way error analysis builds a failure taxonomy: from real traffic, not invented edge cases. Once that ground truth exists, computing recall@k and precision@k across a range of k values (3, 5, 10, 20...) turns "does retrieval feel good enough" into a curve you can actually read, and turns "let's just set k to 10" into a decision backed by where that curve actually plateaus.
Where Reranking Fits (and Where It Doesn't)
A reranker sits after initial retrieval and reorders a wider candidate set to push the most relevant chunks to the top, so the generation step can use a smaller, higher-precision slice of what was retrieved. This is a genuinely useful pattern - retrieve broadly (high k, favoring recall), then rerank down to a tighter set (favoring precision) before generation - but it only works on documents that made it into the initial candidate set in the first place. A reranker cannot rescue recall; it can only improve precision on top of whatever recall the first retrieval step already achieved. If the initial retrieval's recall is low, a reranker just reorders a set that was already missing the answer.
The Recall/Precision Curve by Top-k
Worked example assuming 4 relevant chunks exist in the corpus for a given query
Recall@k = (relevant chunks in top-k) / (total relevant chunks in the corpus)
Precision@k = (relevant chunks in top-k) / k
The numbers below use round figures to make the pattern clear - they are not measurements from a specific dataset.
Raising k always pushes recall up (or holds it flat once it's maxed out) and pushes precision down - this is a mechanical trade-off, not a misconfiguration to fix.Recall Up, Precision Down
Because low recall can't be fixed downstream - neither reranking nor a better LLM can recover a chunk that was never retrieved - the right order is: raise k until recall on your eval set approaches 100%, then optimize precision, never the other way around.
Picking a Top-k for Your Own Pipeline
There's no single correct top-k, but there is a correct order of operations: measure recall@k across a range of k on your own eval set, find the smallest k where recall approaches its ceiling for your document set and question types, and only then decide whether precision at that k is good enough to generate from directly or needs a reranking step first. Document sets with highly redundant or overlapping content need less k to hit high recall; document sets with sparse, unique coverage per topic often need more. Re-run this measurement whenever the underlying document set or chunking strategy changes, since both shift where the recall curve actually plateaus.
Common Pitfalls in Recall/Precision Tuning
A few mistakes recur here: picking a top-k value once, early in development, and never re-measuring it as the document set grows; treating a precision complaint ("the context looks noisy") as a signal to lower k, when the actual fix is often a reranking step instead; assuming a bigger, more capable LLM can compensate for low recall, when no model can answer from information it was never given; and skipping the eval-set step entirely, tuning k by vibes on a handful of manually inspected queries. Recall and precision are measurable, and the pipelines that get top-k right are the ones that measure instead of guess.