AI Engineering · Retrieval Rag
Free preview: the first 2 parts of this 16-part lesson.
Already bought the course? Sign in to read the whole lesson.
this lesson is part of
AI Engineering
Unlock this lesson and the 199 other paid lessons
$49 once, by PayPal
See the AI Engineering courseread the rest of this lesson in
AI Engineering
Unlock this lesson and the 199 other paid lessons
$49 once, by PayPal
See the AI Engineering coursein Retrieval Rag
This lesson is part of the AI Engineering course. Unlock the full course, a separate one-time payment, for lifetime access.
One-time payment by card or PayPal
Get Lifetime AccessOne-time payment: UPI, card or netbanking
Get Lifetime AccessFoundation lessons of this course are free, no payment needed. Try them now
0.005. That is the recall@10 of the answer-bearing chunk at one million chunks, under the distractor model you will run a few slides from now, for a query whose recall was 1.000 at a hundred thousand. Not a gradual erosion. A tenfold corpus growth took that query family from perfect to effectively zero, while the retriever kept returning ten results with cosine scores above 0.8 on every single call.
The chapter opener showed you this cliff exists, mapped its symptoms, and made the case that no vendor swap repeals it. This lesson does the part an introduction could not: it reduces the whole failure to one equation, then works down the list of engineering fixes that hold recall at ten million chunks, and prices each one. By the end you will be able to answer the three questions that actually come up in a scaling review. Which fix does my traffic call for? Where in the pipeline does it belong? What does it cost per million queries?
The mechanism takes one sentence to restate: k is fixed while the corpus grows, so the chunk that answers the question competes against an ever-larger crowd of semantically similar, factually wrong neighbors for the same few seats. Everything after this slide is attacking the terms of that sentence, in order of payoff, with real architecture.
Start with the equation, because it is the map for everything that follows. Lambda is the expected number of chunks that outscore the answer for a given query. The answer makes the top k exactly when fewer than k chunks beat it, and lambda factors cleanly into the corpus size N times a per-query beat probability p.

That factorization is the entire strategy. You have exactly two ways to keep lambda below k as the corpus grows. Shrink N, so fewer chunks are even in the race, which you do before any vector math runs through filtering, partitioning, and coarse routing. Or shrink p, so the answer wins its race more often, which you do by cleaning the corpus, adding a lexical signal, and sharpening the ranking. There is a third lever, raising k itself, but it does not shrink lambda, it buys more seats, and it pays for those seats in reranker compute on every query. That is why it is the last resort on the map, not the first.
The value of the equation is that it turns a vague symptom into a specific choice. A tenant-scoped workload wants N shrunk by partitioning. A corpus full of mirrored exports wants p shrunk by deduplication. An identifier query wants p shrunk by a lexical path. Only when neither factor can move any further do you spend compute on a wider k. The rest of this lesson walks the levers in that order, because the cheap ones are also the durable ones, and a system that partitions and filters well often never needs the expensive one at all.