Training Universal Text Encoders with Pair Relevance Classification Loss
Abstract
Finetuning large language models (LLMs) using contrastive learning objectives has become the dominant approach for representation learning in general-purpose text embedding tasks. Our work seeks to enable going beyond strictly positive (or negative) pairs of text, to more fine-grained annotations that can capture the nuances of complex language tasks. We propose training text encoders with a simple pair classification loss that utilizes binary cross-entropy on relevance labels. When compared to the standard softmax-based loss for multi-class classification against multiple text alternatives, we find that training with our proposed loss improves the average score across 56 English language tasks of the Massive Text Embedding Benchmark (MTEB), while finetuning the same Meta-Llama-3-8B-Instruct model on the same mix of open datasets. Furthermore, our models excel in the Pair Classification and the Semantic Textual Similarity benchmarks, outperforming many models that are trained on more extensive data. Finally, thorough experiments using graded relevance data from TREC-DL 2023 during training demonstrate that binary cross-entropy provides generalization improvements that the softmax-based loss fails to achieve.
BibTeX
@misc{tsirigotis2025training,
author = {Christos Tsirigotis and Vaibhav Adlakha and Joao Monteiro and Aaron Courville and Perouz Taslakian},
title = {{Training Universal Text Encoders with Pair Relevance Classification Loss}},
year = {2025},
url = {https://openreview.net/forum?id=hbS1t37PGM},
howpublished = {OpenReview},
note = {Submitted to ICLR 2025},
}Ask Althea to put this paper to the test.