RAG reranking explained: why vector similarity fails and how cross-encoders fix it

Vector similarity compresses complex documents into a single dot product, missing nuances and negations. Adding a second-stage cross-encoder reranker solves retrieval precision.

JobsDart Editorial4 min read

Key takeaways

  • Vector search uses bi-encoders which compress text into independent static embeddings, losing subtle token-level interactions and syntactic negation.
  • Rerankers use cross-encoders that process both the user query and candidate document simultaneously through self-attention layers.
  • A two-stage retrieval pipeline combines high-recall vector search (retrieving top 50-100 candidates) with high-precision reranking (returning top 3-5 to the LLM).
  • Modern rerankers like Cohere Rerank 3.5, BGE-Reranker-v2, and ColBERT late-interaction models increase Hit Rate by 20% to 35%.
  • Reranking adds 30ms-80ms of latency per query, but dramatically reduces prompt token costs and hallucination rates.

Bi-encoders vs Cross-encoders explained

To understand why rerankers outperform raw vector search, developers must understand the fundamental difference between Bi-Encoders and Cross-Encoders.

Architectural Comparison: Bi-Encoder vs Cross-Encoder
DimensionBi-Encoder (Vector Search)Cross-Encoder (Reranker)
Input HandlingQuery and Document encoded separately into vectorsQuery and Document concatenated into single transformer input
Attention ScopeSelf-attention within query only, within doc onlyFull cross-attention between all query tokens and doc tokens
Computation CostPre-computed offline; fast dot-product at runtimeComputed in real-time for each query-document pair
Latency5ms - 15ms across millions of documents30ms - 80ms across 50-100 candidates
PrecisionModerate (broad thematic match)Extremely high (fine-grained relevance score 0.0 to 1.0)

How two-stage retrieval works in practice

A two-stage retrieval pipeline combines the complementary strengths of bi-encoders (speed and scale) and cross-encoders (deep semantic precision).

In Stage 1 (Candidate Generation), a hybrid search engine retrieves a wide candidate pool—typically between 50 and 100 documents—using a mix of vector similarity and BM25 keyword matching. This stage prioritizes high recall over precision.

In Stage 2 (Precision Scoring), cross-encoder reranking scores every candidate against the original user query, computing a relevance score. The pipeline sorts candidates by this score, strips away low-scoring distractors, and sends only the top 3 to 5 pristine chunks to the LLM prompt.

ColBERT and late-interaction reranking

For high-throughput systems where full cross-encoder scoring is too computationally expensive, ColBERT (Contextualized Late Interaction over BERT) offers an elegant intermediate solution.

ColBERT computes token-level vector representations for both the query and document, storing multiple vectors per chunk. At search time, it computes the maximum similarity (MaxSim) across token pairs.

This allows ColBERT to retain token-level cross-attention expressiveness while operating orders of magnitude faster than traditional cross-encoders, making it ideal for sub-50ms enterprise retrieval workloads.

  • Late interaction preserves token-level contextual representations without full cross-transformer cost.
  • MaxSim operators rapidly aggregate pairwise token matches across indexed document passages.
  • Delivers 95% of cross-encoder accuracy at a fraction of the computational overhead.

Benchmarking the latency and cost trade-off

Developers often ask: is reranking worth the additional latency? In production benchmarks across enterprise knowledge bases, passing 50 candidates through a modern reranker adds between 35ms and 65ms of latency.

However, because rerankers eliminate irrelevant context, you can safely decrease the final context window size from 10 chunks down to 3 chunks. This saves 2,000+ input tokens per prompt, accelerating LLM generation time and reducing overall end-to-end latency.

Frequently asked questions

What is the ideal candidate pool size to send to a reranker?

Between 30 and 100 documents is standard. Reranking fewer than 20 candidates risks missing items excluded by the first stage, while reranking more than 150 candidates introduces diminishing returns and unnecessary latency.

Can I use an LLM instead of a dedicated cross-encoder for reranking?

While frontier LLMs can rerank documents via zero-shot prompting, dedicated cross-encoder models (like BGE-Reranker or Cohere Rerank) are 20x faster, dramatically cheaper, and outperform LLM prompts on standard benchmarks.

Does reranking replace hybrid search?

No. Reranking complements hybrid search. Hybrid search gathers the top candidate pool from both vector and keyword indexes, and the reranker unifies and rescores them with deep cross-attention.

Further reading

Check this against your own resume

Scan your CV against a real job description, or build a parse-safe one from scratch. Your first scan costs nothing.

Keep reading

Referenced in these guides

All career guides