179 questions
No questions match those filters.
← All questions
RAGHard· RAG & Retrieval
Your retriever returns 40 chunks and you have a long-co...
This is one of the questions in the full AI/ML interview bank. Pro unlocks all 1789 questions; Premium includes the same bank plus the highest daily Practice limit.
See plansNo. Attention over long contexts isn’t uniform — models attend most reliably to the beginning and end of the context window, and evidence buried in the middle is measurably less likely to actually get used, even when it’s technically “in context.”
The right shape is retrieve-broad, then narrow deliberately:
- Retrieve generously (the 40 chunks) to maximize recall.
- Rerank with a cross-encoder, which scores query-document pairs jointly and is far more precise than the first-pass retriever, down to a small high-precision set — often five to ten chunks.
- Place the strongest evidence at the edges of the final prompt, not buried in the middle.
More context is not more signal; past a point it’s more distraction and more cost, with no quality upside and a real risk the model misses the one chunk that actually answers the question.