What is the difference between a bi-encoder and a cross-encoder?
LLM Engineer Interview Questions: RAG Pipeline Design, Chunking Strategies, Hybrid Retrieval
Audio flashcard · 0:19Nortren·
What is the difference between a bi-encoder and a cross-encoder?
0:19
A bi-encoder embeds the query and each document independently, then compares with cosine similarity. This is fast because document embeddings can be precomputed. A cross-encoder takes the query and document together as input and outputs a relevance score directly. Cross-encoders are more accurate but cannot precompute, making them suitable for reranking small candidate sets.
sbert.net