Cross-encoders
An embedding model encodes each text on its own, so texts can be embedded in advance and compared cheaply. A cross-encoder instead reads two texts together and outputs a single score for the pair, for example “how well does this passage answer this question?”. Because the model sees both texts at once, it can notice interactions between them that separate embeddings miss. It is usually the better judge of whether two texts mean the same thing.
The cost is that nothing can be precomputed. Every pair needs its own run of the model. The common arrangement is therefore two-stage. Embeddings quickly pick a shortlist of candidates, and a cross-encoder re-ranks only that shortlist.
In Quell
See also
- Embeddings and cosine similarity — the faster first stage.
- Natural language inference — a related kind of pair classifier.
External links
- Sentence Transformers — includes cross-encoder models and documentation.
What links here: Embeddings and cosine similarity, Natural language inference