The fine-tuning of pre-trained language models has a great success in many NLP fields. Yet, it is strikingly vulnerable to adversarial examples, e.g., word substitution attacks using only synonyms can easily fool a BERT-based sentiment analysis model. In this paper, we demonstrate that adversarial training, the prevalent defense technique, does not directly fit a conventional fine-tuning scenario, because it suffers severely from catastrophic forgetting: failing to retain the generic and robust linguistic features that have already been captured by the pre-trained model. In this light, we propose Robust Informative Fine-Tuning (RIFT), a novel adversarial fine-tuning method from an information-theoretical perspective. In particular, RIFT encourages an objective model to retain the features learned from the pre-trained model throughout the entire fine-tuning process, whereas a conventional one only uses the pre-trained weights for initialization. Experimental results show that RIFT consistently outperforms the state-of-the-arts on two popular NLP tasks: sentiment analysis and natural language inference, under different attacks across various pre-trained language models.
翻译:培训前语言模型的微调在许多国家语言平台领域取得了巨大成功。 然而,它明显容易受到对抗性例子的影响,例如,仅使用同义词的词替换攻击很容易愚弄基于BERT的情绪分析模型。 在本文中,我们证明,激烈的对抗性培训,即流行的国防技术,并不直接适合常规的微调假设,因为它遭受灾难性的忘记:未能保留预先培训模式已经捕捉到的通用和稳健的语言特征。因此,我们提议采用一种新型的对抗性微调方法(RIFT),即从信息理论角度出发,用新颖的对抗性词替换性微调方法。 特别是,RIFT鼓励一种客观模式,在整个微调过程中保留从预先培训过的模式中学到的特征,而传统模式只使用预先训练过重来进行初始化。实验结果表明,REFT始终超越了两种流行的国家语言平台任务:情绪分析和自然语言推导,在不同语言预选模式下进行不同的攻击。