Contrastive Learning of Sentence Embeddings from Scratch

Junlei Zhang, Zhenzhong Lan, Junxian He
5/24/2023
cs.CL

No official code found. Best implementation: hkust-nlp/SynCSE (40 stars, MIT, last commit 2023-06-09).

Abstract

Contrastive learning has been the dominant approach to train state-of-the-art sentence embeddings. Previous studies have typically learned sentence embeddings either through the use of human-annotated natural language inference (NLI) data or via large-scale unlabeled sentences in an unsupervised manner. However, even in the case of unlabeled data, their acquisition presents challenges in certain domains due to various reasons. To address these issues, we present SynCSE, a contrastive learning framework that trains sentence embeddings with synthesized data. Specifically, we explore utilizing large language models to synthesize the required data samples for contrastive learning, including (1) producing positive and negative annotations given unlabeled sentences (SynCSE-partial), and (2) generating sentences along with their corresponding annotations from scratch (SynCSE-scratch). Experimental results on sentence similarity and reranking tasks indicate that both SynCSE-partial and SynCSE-scratch greatly outperform unsupervised baselines, and SynCSE-partial even achieves comparable performance to the supervised models in most settings.

View on arXivView PDF

Code Implementations(1)

hkust-nlp/SynCSECommunity100%
MIT

This is the official implementation of the paper: "Contrastive Learning of Sentence Embeddings from Scratch"

408Shell, PythonMay 22, 20233 years agoMIT

Similar Papers

Cite this paper

@article{zhang2023contrastive,
  title  = {Contrastive Learning of Sentence Embeddings from Scratch},
  author = {Junlei Zhang and Zhenzhong Lan and Junxian He},
  year   = {2023},
  eprint = {2305.15077},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2305.15077v2}
}

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/2305.15077.svg)](https://codeofpaper.com/paper/2305.15077)

Discussion