Skip to main content
QUICK REVIEW

[Paper Review] S-SimCSE: Sampled Sub-networks for Contrastive Learning of Sentence Embedding

Junlei Zhang, Zhenzhong Lan|arXiv (Cornell University)|Nov 23, 2021
Topic ModelingComputer Science10 references5 citations
TL;DR

This paper proposes S-SimCSE, a contrastive learning method for sentence embeddings that samples dropout rates from a distribution during training to encourage sub-networks of different expected scales to learn similar representations for the same sentence. By dynamically varying dropout rates per forward pass and using sentence-wise mask sampling, S-SimCSE improves performance over SimCSE by over 1% on BERT-base across multiple STS benchmarks.

ABSTRACT

Contrastive learning has been studied for improving the performance of learning sentence embeddings. The current state-of-the-art method is the SimCSE, which takes dropout as the data augmentation method and feeds a pre-trained transformer encoder the same input sentence twice. The corresponding outputs, two sentence embeddings derived from the same sentence with different dropout masks, can be used to build a positive pair. A network being applied with a dropout mask can be regarded as a sub-network of itsef, whose expected scale is determined by the dropout rate. In this paper, we push sub-networks with different expected scales learn similar embedding for the same sentence. SimCSE failed to do so because they fixed the dropout rate to a tuned hyperparameter. We achieve this by sampling dropout rate from a distribution eatch forward process. As this method may make optimization harder, we also propose a simple sentence-wise mask strategy to sample more sub-networks. We evaluated the proposed S-SimCSE on several popular semantic text similarity datasets. Experimental results show that S-SimCSE outperforms the state-of-the-art SimCSE more than $1\%$ on BERT$_{base}$

Motivation & Objective

  • To improve sentence embedding quality by enabling sub-networks with varying expected scales to learn similar representations for the same input sentence.
  • To address the limitation of SimCSE, which uses a fixed dropout rate and thus limits diversity in sub-network sampling.
  • To enhance optimization stability and representation diversity by introducing sentence-wise dropout rate sampling.
  • To achieve state-of-the-art performance on semantic textual similarity (STS) tasks using only unsupervised pre-training.

Proposed method

  • Dynamically sample two dropout rates from a predefined distribution (e.g., uniform) for each forward pass, rather than using a fixed rate as in SimCSE.
  • Apply these sampled dropout rates to the same input sentence twice, generating two distinct sub-networks with different expected scales.
  • Use the resulting embeddings from these sub-networks as a positive pair in contrastive learning, encouraging them to be semantically similar.
  • Introduce a sentence-wise mask strategy that samples a new dropout rate for each sentence in a batch, increasing the number of sub-networks and improving optimization.
  • Train using a contrastive loss with temperature-scaled cosine similarity between positive pairs and negative pairs from the same batch.
  • Leverage pre-trained transformer encoders (e.g., BERT, RoBERTa) and apply dropout only before fully connected layers, as in standard transformer architectures.

Experimental results

Research questions

  • RQ1Can sampling dropout rates from a distribution during training improve the robustness and generalization of sentence embeddings?
  • RQ2Does varying the expected scale of sub-networks through dynamic dropout rates lead to better semantic representation learning than fixed-rate dropout?
  • RQ3Can sentence-wise dropout rate sampling improve optimization stability and representation diversity in contrastive learning?
  • RQ4How does the proposed method compare to SimCSE in terms of performance on standard STS benchmarks?

Key findings

  • S-SimCSE outperforms SimCSE by 1.03% on average across 7 STS tasks when using BERT-base, achieving an average Spearman correlation of 76.92%.
  • On BERT-large, S-SimCSE achieves a 1.12% improvement over SimCSE, reaching an average Spearman correlation of 79.27%.
  • The sentence-wise dropout mask strategy (w/ sd) further improves performance, with a maximum Spearman score of 77.35 on BERT-base and 79.42 on BERT-large.
  • S-SimCSE maintains strong performance across multiple architectures, including RoBERTa-base, where it achieves a 77.08% average Spearman correlation, outperforming SimCSE's 76.87%.
  • The method consistently improves performance across all 7 STS benchmark datasets, demonstrating robustness and generalization.

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.