← All questions
Retrieval & EmbeddingsMedium· Cross-encoders· Inference Latency· Reranking

Why is a cross-encoder not used for retrieval, and how...

A strong answer provides the arithmetic: 2P (Lq + Lp) FLOPs per pair, which for millions of passages is impossible within a 50ms budget. The bi-encoder is efficient because the passage tower is query-independent and runs offline. The cross-encoder is not discarded; it is moved to a later stage (e.g., depth 100) where it can provide high-precision ranking within a manageable latency window.

Code playground (Python)