A teammate proposes fixing RAG quality by switching to a long-context model and just stuffing the top 50 retrieved chunks into the prompt. What's your view on that approach, and how do you decide how much retrieved context to actually pass?

technical-conceptual · Senior level · data-ml

What the interviewer is really asking

Assesses whether the candidate understands that more context is not free — lost-in-the-middle degradation, cost, latency, and distraction from irrelevant chunks — and decides the context budget with reranking and evaluation rather than maximizing chunk count.

What to say

What to avoid

Example answers

Strong: I'd push back. More context isn't free: models attend unevenly across a long window, so a key fact buried in the middle gets missed, and the irrelevant chunks among 50 actively distract the model and can lower quality. On top of that you pay the token cost and latency of a huge prompt on every request, mostly for noise. I'd instead over-retrieve a wide candidate set, rerank with a cross-encoder, and pass only the top few high-precision chunks, placing the strongest near the start and end. Then I'd sweep k on an eval set and pick where answer quality plateaus — usually a handful of chunks beats fifty, and it's cheaper and faster too.

Weak: Long-context models can handle huge prompts now, so passing the top 50 chunks is fine — more context just gives the model more to work with, and if it all fits in the window there's no real downside. I'd go with that since it's simpler than reranking.

Want questions matched to your role? Paste a job title, job description, or CV and get a personalized set, or go Pro to unlock the full bank.