论文标题
SNCSE:无监督的句子与软性负面样本嵌入的对比度学习
SNCSE: Contrastive Learning for Unsupervised Sentence Embedding with Soft Negative Samples
论文作者
论文摘要
嵌入无监督的句子旨在获得最适合句子的嵌入,以反映其语义。对比学习一直在吸引发展的关注。对于句子,当前模型利用各种数据增强方法来生成正样本,而将其他独立句子视为负样本。然后,他们采用infonce损失来拉出聚集的正对的嵌入,并推动散布的负面对的嵌入。尽管这些模型在嵌入句子上取得了长足的进步,但我们认为它们可能会受到特征抑制的困扰。这些模型无法区分和解除文本相似性和语义相似性。而且,无论它们之间的实际语义差异如何,它们都可能高估任何具有相似文本的对的语义相似性。这是因为在无监督的对比学习中,正面对通过数据进行了相似甚至相同的文本。为了减轻特征抑制作用,我们提出了对嵌入软性负面样本(SNCSE)的无监督句子的对比学习。软负样本具有高度相似的文本,但与原始样品的语义肯定具有不同的语义。具体而言,我们将原始句子的否定为软性否定样本,并提出双向边缘损失(BML)将其引入传统的对比学习框架中,这仅涉及正和负样本。我们的实验结果表明,SNCSE可以在语义文本相似性(STS)任务上获得最先进的性能,而Spearman的平均相关系数在Bertbase上为78.97%,Robertabase的平均相关系数为79.23%。此外,我们采用基于等级的错误分析方法来检测SNCSE的弱点,以便将来研究。
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.