Cross-encoder
A cross-encoder is a model that reads a query and a document together in one pass and outputs a relevance score. It is more accurate than comparing separate embeddings, but too slow to run over a whole collection.
Also called: bi-encoder, cross encoder
By Divya Sharma · Checked Nov 15, 2026 · How we review
The term matters most when choosing between two ways of using a transformer for search.
Bi-encoder vs cross-encoder
A bi-encoder encodes the query and each document separately into embeddings. Document vectors can be computed once and stored in a vector database, and a search is a quick vector comparison. This is how vector search works.
A cross-encoder feeds the query and a document into the model as one input, so every word of the query can attend to every word of the document. It produces a score, not a reusable vector. Nothing can be precomputed, so scoring a million documents means a million model calls.
The Sentence-BERT paper puts numbers on this: finding the most similar pair among 10,000 sentences took about 65 hours with a BERT cross-encoder, against about 5 seconds with its bi-encoder.
How they are combined
The usual pattern is retrieve and rerank: a bi-encoder or BM25 finds a few dozen candidates, then a cross-encoder rescores them. This is what most reranking models do, including mxbai-rerank v2.
Middle ground
Late interaction models such as ColBERT encode query and document separately but keep many vectors per text and compare them in a cheap final step, landing between the two approaches in cost and accuracy.
Related terms
- Reranking
- Reranking is a second search step that takes a short list of candidate documents and reorders them by relevance to the query, using a more accurate but slower model than the first search.
- Late interaction (ColBERT)
- Late interaction is a retrieval method, introduced by ColBERT, that encodes the query and each document separately into one vector per token, then scores a match by comparing those token vectors in a cheap final step.
- Embedding
- An embedding is a list of numbers (a vector) that represents a piece of text, an image or other data, produced so that items with similar meaning end up with vectors close together.
- Vector search
- Vector search finds items by comparing their embeddings to the embedding of a query and returning the closest ones, so results match on meaning rather than on shared keywords.
- Hybrid search
- Hybrid search runs a keyword search and a vector search on the same query and merges the two ranked lists, so results can match on exact words as well as on meaning.