Skip to main content
QUICK REVIEW

[论文解读] SimCSE: Simple Contrastive Learning of Sentence Embeddings

Tianyu Gao, Xingcheng Yao|arXiv (Cornell University)|Apr 18, 2021
Topic Modeling参考文献 56被引用 34
一句话总结

SimCSE 引入了一个简单的对比学习框架,用于通用句子嵌入;在无监督训练中使用 dropout 作为噪声,在有监督训练中使用自然语言推断(NLI)对,在 STS 任务上达到最先进的效果。

ABSTRACT

This paper presents SimCSE, a simple contrastive learning framework that greatly advances state-of-the-art sentence embeddings. We first describe an unsupervised approach, which takes an input sentence and predicts itself in a contrastive objective, with only standard dropout used as noise. This simple method works surprisingly well, performing on par with previous supervised counterparts. We find that dropout acts as minimal data augmentation, and removing it leads to a representation collapse. Then, we propose a supervised approach, which incorporates annotated pairs from natural language inference datasets into our contrastive learning framework by using "entailment" pairs as positives and "contradiction" pairs as hard negatives. We evaluate SimCSE on standard semantic textual similarity (STS) tasks, and our unsupervised and supervised models using BERT base achieve an average of 76.3% and 81.6% Spearman's correlation respectively, a 4.2% and 2.2% improvement compared to the previous best results. We also show -- both theoretically and empirically -- that the contrastive learning objective regularizes pre-trained embeddings' anisotropic space to be more uniform, and it better aligns positive pairs when supervised signals are available.

研究动机与目标

  • 用一个简单的对比目标来激发和改进通用句子嵌入。
  • 展示 dropout 提供的增强是最小的,并在无监督训练中防止表示崩溃。
  • 证明来自 NLI 的正样本和困难负样本可以提升有监督的句子嵌入。
  • 在 STS 任务和迁移任务上进行定量评估,以建立最先进的性能。

提出的方法

  • 使用带有批内负样本和温度参数的对比损失,从预训练编码器学习句子嵌入。
  • 无监督:对同一句子应用两种不同的 dropout 掩码来生成正样本,并将同一批次中的其他句子视为负样本(不进行额外的数据增强)。
  • 有监督:从 NLI 数据集中的蕴含对形成正样本,并在对比目标内将矛盾对用作困难负样本;在有无额外中性样本作为负样本的情况下均进行评估。

实验结果

研究问题

  • RQ1一个简单的对比目标配合最小的数据增强,是否能够产生强大的无监督句子嵌入?
  • RQ2将来自 NLI 的正样本对与困难负样本结合,是否比先前的方法提升有监督的句子嵌入?
  • RQ3嵌入的对齐性和均一性与在 SimCSE 中观察到的性能提升之间有何关系?

主要发现

  • 使用 dropout 的无监督 SimCSE 在 STS 性能上表现强劲,在使用 BERT-base 时超过了许多先前的有监督方法。
  • 在 STS 任务上,使用 BERT-base 的无监督 SimCSE 的平均 Spearman 相关系数为 76.3%,相比之前的最佳结果提升 4.2%。
  • 使用 SNLI+MNLI 的蕴含正样本和来自矛盾对的困难负样本的有监督 SimCSE,使 STS 性能在 BERT-base 上平均达到 81.6%,比无监督版本提升 2.2%。
  • 将 NLI 数据集用作监督对于学习句子嵌入特别有效,并且加入困难负样本进一步提高结果(例如,STS-B 上在 BERT-base 的从 84.9% 提升到 86.2%)。
  • 对比目标对嵌入空间进行正则化,拉平奇异值谱并改善均匀性,这与有监督信号带来的对齐提升互补。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。