Batch-Softmax Contrastive Loss for Pairwise Sentence Scoring Tasks
Anton Chernyavskiy, Dmitry Ilvovsky, Pavel Kalinin, Preslav Nakov

TL;DR
This paper introduces a batch-softmax contrastive loss method for fine-tuning transformer models to improve sentence embeddings in pairwise NLP tasks, demonstrating significant performance gains across multiple datasets.
Contribution
It proposes a novel contrastive loss variation tailored for NLP, with detailed analysis and training strategies that enhance sentence pair scoring performance.
Findings
Significant improvements on classification, ranking, and regression tasks.
Data shuffling is crucial for optimal contrastive learning.
Variations in loss calculation impact model performance.
Abstract
The use of contrastive loss for representation learning has become prominent in computer vision, and it is now getting attention in Natural Language Processing (NLP). Here, we explore the idea of using a batch-softmax contrastive loss when fine-tuning large-scale pre-trained transformer models to learn better task-specific sentence embeddings for pairwise sentence scoring tasks. We introduce and study a number of variations in the calculation of the loss as well as in the overall training procedure; in particular, we find that data shuffling can be quite important. Our experimental results show sizable improvements on a number of datasets and pairwise sentence scoring tasks including classification, ranking, and regression. Finally, we offer detailed analysis and discussion, which should be useful for researchers aiming to explore the utility of contrastive loss in NLP.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsMultimodal Machine Learning Applications · Topic Modeling · Natural Language Processing Techniques
