Retrieval-Augmented GenerationRAGReranking & Retrieval Fusion

What is a cross-encoder reranker?

A cross-encoder reranker is a model that scores how relevant a retrieved document chunk is to a query by processing the query and chunk together. In RAG, it improves the order of a small candidate set produced by a faster first-stage retriever.

How does it work?

  1. Retrieve candidates: Use vector search, BM25, or hybrid retrieval to find, for example, 20 potentially relevant chunks.
  2. Pair query and chunk: For each candidate, input the original question and the candidate text together into the cross-encoder.
  3. Predict relevance: The model assigns a score to each query–chunk pair. It can attend to interactions between specific words and phrases in both texts.
  4. Sort and select: Rerank the candidates by those scores, then send the best authorized, nonredundant chunks to the LLM.

Question → fast retrieval → query–chunk pair scoring → reranked passages → answer

Practical example

A user asks: “Can I get a refund after 30 days if the item is defective?”

Initial retrieval might rank a *general 30-day return policy* above a *defective-item exception*. A cross-encoder can read the entire question together with each passage and give the exception higher relevance because it addresses the important condition “if the item is defective.”

That does not guarantee correctness; it improves evidence ordering when the model is effective for the domain.

Cross-encoder versus bi-encoder

  • Bi-encoder: Encodes queries and documents separately. Document vectors can be precomputed, making large-scale nearest-neighbor retrieval efficient.
  • Cross-encoder: Evaluates each query–document pair jointly. It often provides more precise relevance judgments but requires a separate model pass for every candidate.

Because document representations cannot generally be independently precomputed for cross-encoder scoring, cross-encoders are normally used after first-stage retrieval, not to scan millions of chunks directly.

Trade-offs and tips

  • Accuracy versus latency: Scoring more candidates may improve ordering but adds computation.
  • Candidate recall: A reranker cannot recover a relevant chunk that was never retrieved.
  • Long passages: Input length limits may truncate important evidence, so chunk size and truncation strategy matter.
  • Score calibration: Scores are often useful for ranking, not universal probabilities that an answer is correct.
  • Security: Enforce tenant and document access restrictions before passing chunk text to a reranking service.

Evaluate the reranker on labeled query–passage pairs using metrics such as nDCG@K, MRR, downstream grounded answer quality, and p95 latency.

Interview takeaway

A cross-encoder reranker jointly reads a query and each retrieved candidate to predict relevance. It is typically slower than vector similarity but can rank a small candidate list more accurately, improving which evidence reaches the RAG generator.

#cross encoder reranker RAG#cross encoder versus bi encoder#reranking query passage pairs#rag#reranking#cross-encoder#retrieval

Learning Sequence

Retrieval-Augmented Generation Curriculum

63% Completed
Up NextRAG

What is LLM-based reranking?

Explore Related Questions

Deepen your understanding across related Retrieval-Augmented Generation topics.

Machinoai Logo
Machinoai

Your edge in the AI era. Deep dives into machine learning concepts, paper explainers, verified industry jobs, and developer tools.

© 2026 Machinoai. All rights reserved.