← Back to glossary

Cross-Encoder

An architecture that receives a query and document together in the same Transformer pass and produces a relevance score for the pair. Joint attention models fine-grained alignment between both texts, which is valuable when semantically close candidates need precise ordering.

Each new pair requires inference, so documents cannot be fully precomputed for arbitrary queries. Cost grows with candidate count and sequence length, which usually confines the cross-encoder to reranking a shortlist retrieved by BM25, a bi-encoder, or ColBERT. Batching and truncation help latency but may change quality and therefore belong in the evaluation protocol.