Can Cross Encoders Produce Useful Sentence Embeddings?

Haritha Ananthakrishnan, Julian Dolby, Harsha Kokel, Horst Samulowitz, Kavitha Srinivas
2/5/2025
cs.CLcs.IR

No confident code implementation found for this paper.

Abstract

Cross encoders (CEs) are trained with sentence pairs to detect relatedness. As CEs require sentence pairs at inference, the prevailing view is that they can only be used as re-rankers in information retrieval pipelines.

Show full abstract

Dual encoders (DEs) are instead used to embed sentences, where sentence pairs are encoded by two separate encoders with shared weights at training, and a loss function that ensures the pair's embeddings lie close in vector space if the sentences are related. DEs however, require much larger datasets to train, and are less accurate than CEs. We report a curious finding that embeddings from earlier layers of CEs can in fact be used within an information retrieval pipeline. We show how to exploit CEs to distill a lighter-weight DE, with a 5.15x speedup in inference time.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{ananthakrishnan2025cross,
  title  = {Can Cross Encoders Produce Useful Sentence Embeddings?},
  author = {Haritha Ananthakrishnan and Julian Dolby and Harsha Kokel and Horst Samulowitz and Kavitha Srinivas},
  year   = {2025},
  eprint = {2502.03552},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2502.03552v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2502.03552.svg)](https://codeofpaper.com/paper/2502.03552)

Discussion