# What is Cross-Encoder? Definition & Technical Mechanics

> **Source:** [SPIDITS AI AI Glossary](https://spidits.com/ai-glossary)  
> **Category:** Information Retrieval  
> **Canonical Citation:** [https://spidits.com/ai-glossary/cross-encoder](https://spidits.com/ai-glossary/cross-encoder)

## Definition
A Cross-Encoder is a neural network architecture used in information retrieval that processes the query and the candidate document together as a single input sequence, computing attention across both to produce a highly accurate relevance score.

## Architectural Mechanics & Deep Dive
A cross-encoder is a neural architecture used for high-accuracy text ranking. Unlike bi-encoders, which embed queries and documents separately, a cross-encoder feeds the query and document together into the model simultaneously, allowing self-attention to calculate token-level interactions. While computationally expensive, cross-encoders capture subtle nuances and are highly effective as rerankers in Retrieval-Augmented Generation pipelines.

## Industry Applications & Real-World Use Cases
RAG reranking, document classification, and similarity scoring.

## Frequently Asked Questions

### What is the difference between a Bi-Encoder and a Cross-Encoder?
A Bi-Encoder embeds queries and documents separately (used for fast vector search). A Cross-Encoder embeds them together, which is slow but highly accurate.

### Why not use Cross-Encoders for the initial retrieval phase?
Because processing millions of documents through a Cross-Encoder for every query is too computationally slow. It is only viable for reranking a small candidate set (e.g. top 50).

## Related Terminology
- [bi-encoder](https://spidits.com/ai-glossary/bi-encoder)
- [reranking](https://spidits.com/ai-glossary/reranking)
- [semantic-search](https://spidits.com/ai-glossary/semantic-search)

---
*From the SPIDITS AI Knowledge Base (336+ terms indexed). Explore full technical definitions: [https://spidits.com/ai-glossary](https://spidits.com/ai-glossary)*
