Day 81 of 133
Reranking: cross-encoders, Cohere/BGE rerank, MMR
Bi-encoder retrieve + cross-encoder rerank — the two-stage pattern.
DSA · NeetCode 2-D DP
- Distinct SubsequencesDSA · 2-D DP
Interview questions to prep
- State the 2-D DP: indices, recurrence, base case. What's the order of fill?
- Can you reduce 2-D to 1-D by reusing rows or columns? Walk through the dependency direction.
- Top-down with memoization vs bottom-up — which is easier to reason about, and which is faster in practice?
GenAI · Reranking
Interview questions to prep
- Why is a cross-encoder more accurate than a bi-encoder, and why can't we use it for retrieval?
- What's the latency cost of cross-encoder reranking, and how do you keep it under your budget?
Interview questions to prep
- When does adding a reranker actually move the needle?
- Compare hosted (Cohere) vs self-hosted (BGE / monoT5) rerankers — when would you pick each?
Interview questions to prep
- What is MMR, and why does diversity matter in retrieved context?
- How would you tune the MMR diversity λ — what does the user actually feel as it changes?
References & further reading
- Pinecone — Vector Databases Explained ↗Pinecone
- LangChain — RAG concepts ↗LangChain