Skip to main content
QUICK REVIEW

[论文解读] Simple Contrastive Representation Adversarial Learning for NLP Tasks

Deshui Miao, Jiaqi Zhang|arXiv (Cornell University)|Nov 26, 2021
Topic Modeling参考文献 47被引用 6
一句话总结

本文提出简单对比对抗学习(SCAL)及其无监督版本(USCAL),通过在嵌入空间中生成困难的对抗性样本作为对比学习的正样本对,从而提升模型的鲁棒性与泛化能力。该方法在GLUE基准上取得最先进性能(相比BERT base提升1.75%),在对抗性NLI任务中也取得最先进结果,对抗训练下ANLI测试集准确率达32.4%,开发集准确率达58.6%。

ABSTRACT

Self-supervised learning approach like contrastive learning is attached great attention in natural language processing. It uses pairs of training data augmentations to build a classification task for an encoder with well representation ability. However, the construction of learning pairs over contrastive learning is much harder in NLP tasks. Previous works generate word-level changes to form pairs, but small transforms may cause notable changes on the meaning of sentences as the discrete and sparse nature of natural language. In this paper, adversarial training is performed to generate challenging and harder learning adversarial examples over the embedding space of NLP as learning pairs. Using contrastive learning improves the generalization ability of adversarial training because contrastive loss can uniform the sample distribution. And at the same time, adversarial training also enhances the robustness of contrastive learning. Two novel frameworks, supervised contrastive adversarial learning (SCAL) and unsupervised SCAL (USCAL), are proposed, which yields learning pairs by utilizing the adversarial training for contrastive learning. The label-based loss of supervised tasks is exploited to generate adversarial examples while unsupervised tasks bring contrastive loss. To validate the effectiveness of the proposed framework, we employ it to Transformer-based models for natural language understanding, sentence semantic textual similarity and adversarial learning tasks. Experimental results on GLUE benchmark tasks show that our fine-tuned supervised method outperforms BERT$_{base}$ over 1.75\%. We also evaluate our unsupervised method on semantic textual similarity (STS) tasks, and our method gets 77.29\% with BERT$_{base}$. The robustness of our approach conducts state-of-the-art results under multiple adversarial datasets on NLI tasks.

研究动机与目标

  • 为解决在NLP对比学习中生成有意义且标签保持不变的正样本对的挑战,其中离散且稀疏的文本使得数据增强困难。
  • 通过将对抗性训练与对比学习结合,利用对抗性样本作为困难正样本对,提升模型的泛化能力与鲁棒性。
  • 提出一个统一框架,整合监督与无监督对比对抗学习,适用于多样化的NLP任务。
  • 验证嵌入空间中的对抗性样本作为对比学习新型数据增强策略的有效性。

提出的方法

  • 通过计算输入嵌入的梯度,并添加微小扰动,生成嵌入空间中的对抗性样本 $ z_i^{adv} $。
  • 该框架使用对比损失,将 $ z_i $ 与 $ z_i^{adv} $ 作为正样本对拉近,同时将不同样本的表示推开。
  • 在监督任务中,SCAL将基于标签的分类损失与对比损失结合,联合优化准确率与表示质量。
  • 在无监督任务中,USCAL仅使用对比损失,无需标签即可学习句子表示。
  • 所有分支共享编码器与分类器权重,以保持一致性并提升训练效率。
  • 该方法应用于基于BERT与RoBERTa的模型,通过基于梯度的扰动执行对抗性训练,生成具有挑战性的正样本对。

实验结果

研究问题

  • RQ1在嵌入空间中生成的对抗性样本能否有效作为NLP对比学习的正样本对?
  • RQ2将对抗性训练与对比学习结合是否能提升下游NLP任务的模型泛化能力与鲁棒性?
  • RQ3所提出的SCAL框架在GLUE与NLI基准上相较于现有对抗性训练与对比学习方法表现如何?
  • RQ4无监督变体USCAL能否有效学习到与监督方法相当的句子表示?

主要发现

  • SCAL在GLUE基准上相比BERT base提升1.75%,表明其在监督NLU任务中具有更强的泛化能力。
  • 在语义文本相似度(STS)任务中,无监督的USCAL方法在BERT base上达到77.29%的准确率,展现出强大的零样本性能。
  • 在对抗性ANLI基准上,SCAL在MNLI+SNLI上训练时,测试集准确率达32.4%,优于FreeLB(27.4%)与InfoBERT(28.2%)超过4个百分点。
  • 在对抗性数据集(MNLI+SNLI+ANLI+FeverNLI)上微调后,SCAL在ANLI开发集上实现58.6%的鲁棒准确率(使用RoBERTa),优于InfoBERT(58.3%)与FreeLB(56.2%)。
  • 该方法在多个对抗性NLI数据集上均保持优异性能,表明其在多样化攻击场景下具备高度鲁棒性。

更好的研究,从现在开始

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

无需绑定信用卡

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