Skip to main content
Interactive 3D/Reranking: Cross-Encoder vs Bi-Encoder
Reranker Model
N Docs
Docs8
Recall@1
Before: 100%
Latency Penalty
~22ms per query
Worth it for top-K retrieval
Why rerank?
Bi-encoder: fast, precomputed. Cross-encoder: joint encoding captures deep interaction - higher quality but O(n) calls.

Reranking: Cross-Encoder vs Bi-Encoder - Interactive Visualization

Bi-encoders encode query and document separately and compare via cosine similarity - fast but imprecise. Cross-encoders jointly encode both and produce a relevance score - slower but much more accurate. Reranking applies a cross-encoder to the top-K bi-encoder results, getting the best of both. This demo shows how reranking reorders results and improves Recall@1.

  • Bi-encoder stage: query and document embeddings computed independently at millisecond speed
  • Cross-encoder reranking: joint encoding of query+document pairs produces finer relevance scores
  • Recall@1 comparison: see the jump in top result accuracy after applying a reranker
  • Latency breakdown: retrieval vs reranking time shown separately to quantify the cost

Part of the EngineersOfAI Interactive 3D - free interactive visualizations covering every major concept in machine learning and AI engineering. Hover any element for a plain-English explanation. No code required.