Skip to content
Middle0 views

What is a cross-encoder?

Practice

AI answer

A cross-encoder is a ranking model that takes a pair of texts at the same time—for example, a query and a document—and scores their relevance. Unlike a bi-encoder, which generates separate vectors for the query and documents in advance, a cross-encoder processes both texts together and can account more precisely for how they interact. It is therefore often used to rerank a small set of candidates after a fast embedding-based search. The drawback is that each pair must be scored separately, making this approach more expensive and slower for a large corpus.