Skip to main content
QUICK REVIEW

[论文解读] SNCSE: Contrastive Learning for Unsupervised Sentence Embedding with Soft Negative Samples

Hao Wang, Yangguang Li|arXiv (Cornell University)|Jan 16, 2022
Topic Modeling被引用 4
一句话总结

SNCSE 提出了一种对比学习框架,用于无监督句子嵌入,通过引入句子否定作为软负样本,缓解了模型因混淆文本相似性与语义相似性而产生的特征抑制问题。通过使用双向边缘损失(BML),SNCSE 提升了语义区分能力,在 STS 基准测试中实现了最先进性能,RoBERTa base 模型的平均斯皮尔曼等级相关系数达到 79.23%,RoBERTa large 模型达到 81.77%。

ABSTRACT

Unsupervised sentence embedding aims to obtain the most appropriate embedding for a sentence to reflect its semantic. Contrastive learning has been attracting developing attention. For a sentence, current models utilize diverse data augmentation methods to generate positive samples, while consider other independent sentences as negative samples. Then they adopt InfoNCE loss to pull the embeddings of positive pairs gathered, and push those of negative pairs scattered. Although these models have made great progress on sentence embedding, we argue that they may suffer from feature suppression. The models fail to distinguish and decouple textual similarity and semantic similarity. And they may overestimate the semantic similarity of any pairs with similar textual regardless of the actual semantic difference between them. This is because positive pairs in unsupervised contrastive learning come with similar and even the same textual through data augmentation. To alleviate feature suppression, we propose contrastive learning for unsupervised sentence embedding with soft negative samples (SNCSE). Soft negative samples share highly similar textual but have surely and apparently different semantic with the original samples. Specifically, we take the negation of original sentences as soft negative samples, and propose Bidirectional Margin Loss (BML) to introduce them into traditional contrastive learning framework, which merely involves positive and negative samples. Our experimental results show that SNCSE can obtain state-of-the-art performance on semantic textual similarity (STS) task with average Spearman's correlation coefficient of 78.97% on BERTbase and 79.23% on RoBERTabase. Besides, we adopt rank-based error analysis method to detect the weakness of SNCSE for future study.

研究动机与目标

  • 为解决无监督句子嵌入中的特征抑制问题,即模型因正样本对中存在高文本相似性而高估语义相似性。
  • 引入软负样本——即文本相似度高但语义明显不同的句子——以实现文本相似性与语义相似性的解耦。
  • 提升对比学习在文本相似但语义不同的情况下区分语义差异的能力。
  • 开发一种无需标注数据即可增强语义区分能力的训练框架。

提出的方法

  • SNCSE 使用句子否定作为软负样本,生成具有高文本相似性但语义明显不同的样本对。
  • 提出双向边缘损失(BML),显式建模正样本与软负样本之间的语义差距。
  • 将 BML 集成到标准对比学习设置中,同时使用 InfoNCE 损失处理正样本对和标准负样本对。
  • BML 确保句子的嵌入被拉离其否定句,同时仍被拉向其增强后的正样本版本。
  • 该方法兼容任何预训练编码器(如 BERT 和 RoBERTa),并以无监督方式运行。
  • 通过联合优化 InfoNCE 和 BML 损失,端到端训练模型以优化语义表示。

实验结果

研究问题

  • RQ1将句子否定作为软负样本是否能改善无监督句子嵌入中对文本相似性与语义相似性的解耦?
  • RQ2双向边缘损失(BML)在提升模型区分语义不同但文本相似的句子方面有多有效?
  • RQ3使用软负样本是否能带来语义文本相似性(STS)基准性能的可测量提升?
  • RQ4与现有对比学习方法相比,SNCSE 在多大程度上缓解了特征抑制?
  • RQ5SNCSE 的主要失败模式是什么?它们与词序、拼写错误和否定逻辑等语言现象有何关联?

主要发现

  • SNCSE 在 STS 基准测试中实现了最先进性能,RoBERTa base 模型的平均斯皮尔曼等级相关系数为 79.23%,RoBERTa large 模型为 81.77%。
  • 消融实验表明,BML 损失显著提升了性能,并有助于缓解特征抑制。
  • SNCSE 显著提升了模型区分句子与其否定句的能力,表现为模型能为这类样本对分配更低的相似度分数。
  • 基于排名的错误分析显示,主要失败模式包括拼写错误、隐含否定、文本独立性以及词序变化,这些均源于持续存在的特征抑制问题。
  • 对于文本重叠度低但语义相似度高的样本对,模型低估了其相似性,表明在捕捉表面文本之外的语义意义方面仍存在挑战。
  • 尽管取得进展,SNCSE 在建模词序变化和隐含否定的语义差异方面仍存在困难,凸显了自注意力机制在解耦句法与语义因素方面的局限性。

更好的研究,从现在开始

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

无需绑定信用卡

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