[论文解读] TAVAT: Token-Aware Virtual Adversarial Training for Language Understanding
本文提出了一种名为Token-Aware Virtual Adversarial Training(TA-VAT)的方法,通过使用全局的、基于token的扰动词典进行初始化以及基于token的归一化约束,提升了预训练语言模型的鲁棒性和性能。TA-VAT将BERT在GLUE基准上的得分从78.3提升至80.9,并在文本分类、序列标注和低资源设置下均提升了性能,且无需额外的计算开销。
Gradient-based adversarial training is widely used in improving the robustness of neural networks, while it cannot be easily adapted to natural language processing tasks since the embedding space is discrete. In natural language processing fields, virtual adversarial training is introduced since texts are discrete and cannot be perturbed by gradients directly. Alternatively, virtual adversarial training, which generates perturbations on the embedding space, is introduced in NLP tasks. Despite its success, existing virtual adversarial training methods generate perturbations roughly constrained by Frobenius normalization balls. To craft fine-grained perturbations, we propose a Token-Aware Virtual Adversarial Training method. We introduce a token-level accumulated perturbation vocabulary to initialize the perturbations better and use a token-level normalization ball to constrain these perturbations pertinently. Experiments show that our method improves the performance of pre-trained models such as BERT and ALBERT in various tasks by a considerable margin. The proposed method improves the score of the GLUE benchmark from 78.3 to 80.9 using BERT model and it also enhances the performance of sequence labeling and text classification tasks.
研究动机与目标
- 为解决传统虚拟对抗训练在NLP中使用随机扰动初始化和刚性Frobenius归一化约束的局限性。
- 通过利用累积跨训练样本梯度的全局、基于token的扰动词典,提升扰动质量,实现更一致的初始化。
- 实现细粒度、基于token的扰动约束,使其根据梯度大小自适应调整单个token的重要性。
- 提升模型的泛化能力和鲁棒性,特别是在低资源和序列标注任务中。
- 证明基于token的扰动可带来更好的性能并增强对对抗攻击的抵抗力。
提出的方法
- 提出一个全局扰动词典,通过在所有训练样本中累积基于梯度的扰动,为相同token提供更智能的初始化,而非随机噪声。
- 采用基于token的归一化球,允许高梯度token具有更大的扰动边界,低梯度token则具有更紧的边界,从而实现细粒度、上下文敏感的扰动。
- 在嵌入空间中应用虚拟对抗训练,结合改进的初始化和约束机制,在效率上优于基于替换的方法。
- 将学习到的扰动词典整合到标准微调过程中,使嵌入层能受益于任务和token特定的对抗知识。
- 采用基于梯度的优化过程生成既鲁棒又难以察觉的虚拟对抗样本,避免使用同义词替换。
- 通过GLUE、CoNLL-2003和Ontonotes5.0等标准基准验证方法,并使用Textfooler攻击评估鲁棒性。
实验结果
研究问题
- RQ1全局的、基于token的扰动词典能否改善NLP模型中虚拟对抗扰动的初始化?
- RQ2与句子级别的Frobenius约束相比,应用基于token的归一化约束是否能带来更有效、更细粒度的对抗训练?
- RQ3TA-VAT在低资源和序列标注任务中能多大程度上提升模型性能?
- RQ4TA-VAT是否能增强模型对Textfooler等先进对抗攻击的鲁棒性?
- RQ5特殊token如[CLS]和[SEP]在扰动词典中的有效性中起到何种作用?
主要发现
- TA-VAT将BERT-base在GLUE基准上的得分从78.3提升至80.9,实现了2.6个百分点的绝对提升。
- 对于ALBERT-xxlarge模型,TA-VAT将GLUE得分从89.9提升至90.9,表明在不同模型规模下均具有一致的增益。
- 在CoNLL-2003命名实体识别任务中,TA-VAT提升了模型性能,表明其在分类之外的序列标注任务中也具有效力。
- 当在MNLI数据集的2,000个样本上训练时,TA-VAT的性能增益大于在完整400K数据集上的增益,表明其在低资源设置下具有显著优势。
- 使用TA-VAT训练的模型对Textfooler攻击表现出更高的鲁棒性,攻击准确率达到15.8%(使用2,093次查询),高于BERT在1,134次查询下的13.6%,表明其具备更强的抗御能力。
- 若排除对[CLS]和[SEP]等特殊token的扰动,性能会下降,证实了这些token在扰动机制中的关键作用。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。