Batch-Softmax Contrastive Loss for Pairwise Sentence Scoring Tasks

5Citations
Citations of this article
36Readers
Mendeley users who have this article in their library.

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 pretrained 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 a special 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.

Cite

CITATION STYLE

APA

Chernyavskiy, A., Ilvovsky, D., Kalinin, P., & Nakov, P. (2022). Batch-Softmax Contrastive Loss for Pairwise Sentence Scoring Tasks. In NAACL 2022 - 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Proceedings of the Conference (pp. 116–126). Association for Computational Linguistics (ACL). https://doi.org/10.18653/v1/2022.naacl-main.9

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free