DiffCSE: Difference-based Contrastive Learning for Sentence Embeddings

Yung-Sung Chuang, Rumen Dangovski, Hongyin Luo, Yang Zhang, Shiyu Chang +5 more
4/21/2022
cs.CL
contrastive-ssl

Official code: voidism/DiffCSE (297 stars, Python, MIT, last commit 2022-10-27).

Abstract

We propose DiffCSE, an unsupervised contrastive learning framework for learning sentence embeddings. DiffCSE learns sentence embeddings that are sensitive to the difference between the original sentence and an edited sentence, where the edited sentence is obtained by stochastically masking out the original sentence and then sampling from a masked language model.

Show full abstract

We show that DiffSCE is an instance of equivariant contrastive learning (Dangovski et al., 2021), which generalizes contrastive learning and learns representations that are insensitive to certain types of augmentations and sensitive to other "harmful" types of augmentations. Our experiments show that DiffCSE achieves state-of-the-art results among unsupervised sentence representation learning methods, outperforming unsupervised SimCSE by 2.3 absolute points on semantic textual similarity tasks.

View on arXivView PDF

Code Implementations(1)

voidism/DiffCSEOfficial100%
MIT

Code for the NAACL 2022 long paper "DiffCSE: Difference-based Contrastive Learning for Sentence Embeddings"

29730Python, Jupyter NotebookApr 13, 20224 years agoMIT
contrastive-learningrepresentation-learningself-supervised-learningsentence-embeddingssentence-similarity+1 more

Similar Papers

Cite this paper

@article{chuang2022diffcse,
  title  = {DiffCSE: Difference-based Contrastive Learning for Sentence Embeddings},
  author = {Yung-Sung Chuang and Rumen Dangovski and Hongyin Luo and Yang Zhang and Shiyu Chang and Marin Soljačić and Shang-Wen Li and Wen-tau Yih and Yoon Kim and James Glass},
  year   = {2022},
  eprint = {2204.10298},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2204.10298}
}

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

Discussion