arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2004.08994cs.CL
收藏

大型神经语言模型的对抗训练

Adversarial Training for Large Neural Language Models

Microsoft Research(微软研究院);Microsoft Dynamics 365 AI(微软 Dynamics 365 AI)

Xiaodong Liu, Hao Cheng, Pengcheng He, Weizhu Chen, Yu Wang, Hoifung Poon, Jianfeng Gao

摘要:

泛化和鲁棒性都是设计机器学习方法的关键要求。对抗性训练可以增强鲁棒性,但过去的工作经常发现它会损害泛化。在自然语言处理(NLP)中,预训练大型神经语言模型(如BERT)在各种任务的泛化方面表现出令人印象深刻的增益,并通过对抗性微调进一步改进。然而,这些模型仍然容易受到对抗攻击。在本文中,我们证明了对抗性预训练可以提高泛化能力和鲁棒性。我们提出了一个通用算法ALUM(大型神经语言模型的对抗训练),它通过在嵌入空间中应用扰动来正则化训练目标,从而最大化对抗损失。我们首次全面研究了对抗训练的各个阶段,包括从头开始的预训练,在训练有素的模型上进行持续的预训练,以及针对特定任务的微调。ALUM在常规和对抗场景下,在广泛的NLP任务上获得了比BERT更大的收益。即使是在非常大的文本语料库上训练过的模型,比如RoberTa,ALUM仍然可以从持续的预训练中获得显著的收益,而传统的非对抗性方法则不能。ALUM可以进一步与特定于任务的微调相结合,以获得额外的收益。ALUM代码可在https://github.com/namisan/mt-dnn上公开获得。

英文摘要:

Generalization and robustness are both key desiderata for designing machine learning methods. Adversarial training can enhance robustness, but past work often finds it hurts generalization. In natural language processing (NLP), pre-training large neural language models such as BERT have demonstrated impressive gain in generalization for a variety of tasks, with further improvement from adversarial fine-tuning. However, these models are still vulnerable to adversarial attacks. In this paper, we show that adversarial pre-training can improve both generalization and robustness. We propose a general algorithm ALUM (Adversarial training for large neural LangUage Models), which regularizes the training objective by applying perturbations in the embedding space that maximizes the adversarial loss. We present the first comprehensive study of adversarial training in all stages, including pre-training from scratch, continual pre-training on a well-trained model, and task-specific fine-tuning. ALUM obtains substantial gains over BERT on a wide range of NLP tasks, in both regular and adversarial scenarios. Even for models that have been well trained on extremely large text corpora, such as RoBERTa, ALUM can still produce significant gains from continual pre-training, whereas conventional non-adversarial methods can not. ALUM can be further combined with task-specific fine-tuning to attain additional gains. The ALUM code is publicly available at https://github.com/namisan/mt-dnn.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑