Rag And Retrieval medium
Your retrieval evaluation shows recall@50 of 94% but precision@5 of only 30%. The generator receives the top 5 chunks from the bi-encoder. Which change most directly addresses this gap?
- A Add a cross-encoder reranker over the top 50 candidates and pass only its top 5 to the generator.
- B Pass all 50 first-stage candidates to the generator so the relevant chunks are guaranteed to be included.
- C Re-chunk the corpus into larger 2,000-token chunks so each top-5 result carries more surrounding context.
- D Switch to a higher-dimensional embedding model so that the bi-encoder's top-5 ordering becomes accurate.
Answer: A. Add a cross-encoder reranker over the top 50 candidates and pass only its top 5 to the generator.
High recall@50 with poor precision@5 is the classic sign that the right chunks are found but ranked badly. A **cross-encoder reranker** scores each query and chunk together, which fixes ordering at a cost of tens to a few hundred milliseconds. Passing all 50 chunks multiplies token cost and fills the prompt with distractors. It only makes sense when context is cheap and the model handles noisy context well.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- You must index 100M chunks using a 3,072-dimension embedding in fp32, served from RAM via HNSW. The raw vectors alone take about 1.2 TB before graph overhead. You need to cut memory several-fold while losing at most a point or two of recall@10. Which approach fits?
- A multi-tenant SaaS app stores all tenants in one vector index with a tenant_id field. Queries fetch the top 20 chunks by similarity and then drop chunks from other tenants. Small tenants often get 0-2 results. Why does this happen, and what is the fix?
- Runbooks are split into fixed 300-token chunks with no overlap. When a procedure step starts near the end of one chunk and finishes in the next, answers come back incomplete. What is the lowest-cost fix?
- Your offline eval shows recall@5 of 92% on a labeled set, so the gold passage is in the context for nearly every question. Yet human graders mark 35% of answers wrong, and the wrong answers often ignore or contradict the gold passage. Where should the team invest next?
- Your product requires every RAG answer to include clickable source citations that users can verify. How should those citations be produced?
- A runbook RAG system uses fixed 500-token chunks with no overlap. Users who ask for a multi-step recovery procedure get answers that stop at step 4 of 9, and retrieval logs show the top hit ends mid-procedure. What is the most targeted fix?