When would you reach for a cross-encoder over a bi-encoder?
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
A cross-encoder scores (query, doc) jointly in one transformer pass; you use it to rerank a small candidate set, never to search the full corpus.
Think of dating apps. The bi-encoder is like writing a one-page profile for every person on the planet, then sorting profiles by how well yours matches at a glance. That is fast but shallow. The cross-encoder is the actual first date: you sit across from one person and pay full attention to the back and forth. Way more accurate, but you only have time for a handful of dates. So you screen with profiles first (bi-encoder retrieves top 50), then go on dates with just the finalists (cross-encoder reranks). The cross-encoder never meets the whole planet.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
6 to 8 min: cross-encoder definition + why O(N) scoring blocks first-stage use + two-stage pattern + latency math + decision rule + 2026 reranker landscape.
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Saying you could use a cross-encoder as a first-stage retriever if you precompute scores. You cannot, the query is new at search time, so every pair must be scored fresh.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.