A cross-encoder is a neural ranking model that jointly encodes a query and document, then returns a relevance or similarity score. A Transformer combines both inputs into one representation, allowing the document to be interpreted within the query’s shared semantic context. Cross-encoders are commonly pretrained and can often be used without additional training. section 10.6.2 section 13.8
Unlike a bi-encoder, which embeds queries and documents separately before comparing them, a cross-encoder concatenates the pair and processes it together. This enables more nuanced matching, but requires substantially more computation for every scored pair. section 13.8 section 13.9
Reranking a semantic-search result set
For the query "mountain hike," first retrieve a manageable candidate set with semantic search. Build query-document pairs from the candidates, score them with a cross-encoder, and rerank by those scores. The model can distinguish a document about beginner snow hiking from one specifically relevant to mountain hiking, even though both concern hiking. section 13.8
A practical pipeline uses the cross-encoder after lexical or dense retrieval rather than against the entire index. This preserves its stronger contextual scoring while limiting latency and computation; adding more complex ranking features likewise increases evaluation cost and response time. section 13.9 section 10.6.2

