Skip to main content
QUICK REVIEW

[Paper Review] Smoothed Contrastive Learning for Unsupervised Sentence Embedding

Xing Wu, Chaochen Gao|arXiv (Cornell University)|Sep 9, 2021
Topic ModelingComputer Science19 references9 citations
TL;DR

This paper proposes Gaussian Smoothed InfoNCE (GS-InfoNCE), a simple smoothing strategy that enhances unsupervised SimCSE by adding random Gaussian noise to negative pairs in the contrastive loss, improving performance without increasing batch size. The method boosts average Spearman correlation by up to 2.85% on STS-B, demonstrating consistent gains across BERT and RoBERTa models.

ABSTRACT

Contrastive learning has been gradually applied to learn high-quality unsupervised sentence embedding. Among the previous un-supervised methods, the latest state-of-the-art method, as far as we know, is unsupervised SimCSE (unsup-SimCSE). Unsup-SimCSE uses the InfoNCE1loss function in the training stage by pulling semantically similar sentences together and pushing apart dis-similar ones.Theoretically, we expect to use larger batches in unsup-SimCSE to get more adequate comparisons among samples and avoid overfitting. However, increasing the batch size does not always lead to improvements, but instead even lead to performance degradation when the batch size exceeds a threshold. Through statistical observation, we find that this is probably due to the introduction of low-confidence negative pairs after in-creasing the batch size. To alleviate this problem, we introduce a simple smoothing strategy upon the InfoNCE loss function, termedGaussian Smoothing InfoNCE (GS-InfoNCE).Specifically, we add random Gaussian noise vectors as negative samples, which act asa smoothing of the negative sample space.Though being simple, the proposed smooth-ing strategy brings substantial improvements to unsup-SimCSE. We evaluate GS-InfoNCEon the standard semantic text similarity (STS)task. GS-InfoNCE outperforms the state-of-the-art unsup-SimCSE by an average Spear-man correlation of 1.38%, 0.72%, 1.17% and0.28% on the base of BERT-base, BERT-large,RoBERTa-base and RoBERTa-large, respectively.

Motivation & Objective

  • To address performance degradation in unsupervised SimCSE when batch size exceeds a threshold due to false-negative pairs.
  • To improve contrastive learning stability and generalization by smoothing the negative sample distribution.
  • To enhance representation quality without increasing computational cost or batch size.
  • To validate the effectiveness of Gaussian noise as a regularization strategy in unsupervised sentence embedding.

Proposed method

  • Introduces a modified InfoNCE loss, GS-InfoNCE, by adding multiple random Gaussian noise vectors to the negative pair set.
  • Uses the standard Gaussian distribution to sample noise vectors, which act as high-confidence negative examples.
  • Extends the negative set without increasing the batch size, effectively smoothing the negative distribution.
  • Applies the smoothing strategy to the denominator of the InfoNCE loss to reduce overfitting and improve generalization.
  • Employs a hyperparameter M to control the number of noise vectors, with optimal performance observed at M=3 for BERT-base.
  • Retains the original SimCSE training pipeline while replacing the standard InfoNCE loss with GS-InfoNCE.

Experimental results

Research questions

  • RQ1Does introducing Gaussian noise as additional negative pairs improve unsupervised sentence representation learning?
  • RQ2Can smoothing the negative sample distribution mitigate performance degradation at large batch sizes?
  • RQ3How sensitive is the performance of GS-InfoNCE to the number of noise vectors (M)?
  • RQ4Does GS-InfoNCE consistently improve performance across different model architectures and datasets?
  • RQ5Can GS-InfoNCE achieve better results than standard SimCSE with the same or smaller batch size?

Key findings

  • GS-InfoNCE improves the average Spearman correlation of unsup-SimCSE by 1.38% on BERT-base across seven STS datasets.
  • On BERT-large, GS-InfoNCE achieves an average improvement of 0.55% across the same test sets, with minor declines on SICK15 and SICK-R.
  • For RoBERTa-base, the method yields a 1.17% average improvement, and for RoBERTa-large, a 0.31% average gain.
  • The maximum performance gain reaches 2.85% on the STS-B benchmark with BERT-base.
  • Optimal performance is achieved at M=3 for BERT-base, with diminishing returns and eventual decline beyond M=8.
  • GS-InfoNCE consistently outperforms the original SimCSE across all model configurations and test sets, even with smaller or equal batch sizes.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.