25 side-by-side comparisons of the concepts interviewers ask about most. Understand the tradeoffs, know when to use what, and never confuse the two again.
Bi-encoders precompute embeddings and search fast; cross-encoders score query and document together for higher quality. Production usually runs bi-encoders for retrieval and cross-encoders as a reranker on top.
Fixed-size chunking is simple; semantic chunks at meaning boundaries; recursive respects the document's own structure. Recursive is the modern default for anything hierarchical (headings, code).
Long context lets the model see everything; RAG selects what it should see. Long context is convenient but not free: cost scales, and quality falls off past the middle of the window.
Reach for RAG when knowledge changes or must be cited; fine-tune when you need the model to change how it behaves, not what it knows.
Retrievers fetch a shortlist fast; rerankers score the shortlist accurately. Production RAG uses both. A bi-encoder retrieves the top 100, a cross-encoder reranks to the top 5.
Use semantic search when users phrase things their own way; keep keyword search when exact terms like codes and IDs must match. Most production systems run both.