Bi-encoder vs cross-encoder: what's the reranker latency cost?
Understand the idea, explain it in your own words and use the rubric to find your next learning gap.
The idea behind the question
A bi-encoder separately represents queries and documents, allowing indexed retrieval. A cross-encoder scores a query-document pair together and is often used on a smaller candidate set.
Retrieve 30 candidates with an index, then rerank only those before sending a few passages to the generator.
A practical way to learn it
Draw a retrieval/reranking timeline and allocate a hypothetical latency budget. Label it as an estimate.
Open online notepadThe related tool opens separately; your interview answer stays here. Written practice is self-guided, without automatic code grading.
Build an explanation you understand
- State what the concept does in plain language.
- Apply it to the example and make your assumptions explicit.
- Explain a trade-off, failure case and how you would test it.
- Distinguish your actual experience from a proposed approach.
How would you explain it?
Single-question timers reset on refresh. Full mock sessions can resume from this browser.
Strengthen your explanation
Compare reasoning, not identical wording. Reference answers describe a possible approach; replace hypothetical statements with truthful details from your own work.
One way to answer
I would explain why document embeddings can be precomputed for a bi-encoder, while a cross-encoder generally performs additional query-passage inference. The reranker cost depends on candidate count, sequence length, model, hardware and batching. I would measure p50 and p95 latency and quality under representative load instead of quoting a universal millisecond figure. I would compare a smaller candidate set, a smaller reranker or skipping reranking for exact lookups. The final decision is whether its measured quality gain justifies the added latency and cost.
What a strong explanation should cover
Tick only the points your own answer addresses. This is self-assessment, not AI scoring.
0 / 3 points self-reportedWatch out for
- Claiming every reranker has the same latency.
Now go one level deeper
- How would you handle a reranker timeout?
- How would you choose the candidate count?
Further reading
Further-reading links support learning; the reference is Sukoaa-authored, not an official employer answer key.