Skip to main content
QUICK REVIEW

[论文解读] Smoothed Contrastive Learning for Unsupervised Sentence Embedding

Xing Wu, Chaochen Gao|arXiv (Cornell University)|Sep 9, 2021
Topic Modeling参考文献 19被引用 9
一句话总结

本文提出高斯平滑InfoNCE(GS-InfoNCE),一种简单的平滑策略,通过在对比损失中向负样本对添加随机高斯噪声,提升无监督SimCSE的性能,且无需增加批量大小。该方法在STS-B上将平均Spearman相关系数提升最高达2.85%,在BERT和RoBERTa模型上均表现出一致的性能增益。

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.

研究动机与目标

  • 为解决当批量大小超过阈值时无监督SimCSE性能下降的问题,特别是由假负样本对引起的问题。
  • 通过平滑负样本分布来提升对比学习的稳定性和泛化能力。
  • 在不增加计算成本或批量大小的前提下提升表示质量。
  • 验证高斯噪声作为无监督句子嵌入正则化策略的有效性。

提出的方法

  • 通过向负样本对集合添加多个随机高斯噪声向量,提出改进的InfoNCE损失,即GS-InfoNCE。
  • 使用标准高斯分布采样噪声向量,这些噪声向量作为高置信度的负样本。
  • 在不增加批量大小的前提下扩展负样本集合,有效平滑负样本分布。
  • 将平滑策略应用于InfoNCE损失的分母,以减少过拟合并提升泛化能力。
  • 引入超参数M控制噪声向量的数量,发现在BERT-base上M=3时性能最佳。
  • 在保留原始SimCSE训练流程的基础上,将标准InfoNCE损失替换为GS-InfoNCE。

实验结果

研究问题

  • RQ1引入高斯噪声作为额外负样本对是否能提升无监督句子表示学习?
  • RQ2平滑负样本分布是否能缓解大规模批量大小下的性能下降问题?
  • RQ3GS-InfoNCE的性能对噪声向量数量(M)的敏感度如何?
  • RQ4GS-InfoNCE是否在不同模型架构和数据集上均表现出一致的性能提升?
  • RQ5GS-InfoNCE能否在相同或更小批量大小下取得优于标准SimCSE的结果?

主要发现

  • 在七个STS数据集上,GS-InfoNCE使无监督SimCSE在BERT-base上的平均Spearman相关系数提升1.38%。
  • 在BERT-large上,GS-InfoNCE在相同测试集上实现平均0.55%的性能提升,仅在SICK15和SICK-R上出现轻微下降。
  • 对于RoBERTa-base,该方法带来1.17%的平均性能提升;对于RoBERTa-large,平均提升0.31%。
  • 在STS-B基准上,最大性能增益达到2.85%(BERT-base)。
  • 在BERT-base上,M=3时达到最佳性能,当M>8后收益递减并最终下降。
  • GS-InfoNCE在所有模型配置和测试集上均持续优于原始SimCSE,即使批量大小更小或相等。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

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