How Should Pre-Trained Language Models Be Fine-Tuned Towards Adversarial Robustness?

Xinhsuai Dong, Luu Anh Tuan, Min Lin, Shuicheng Yan, Hanwang Zhang
12/22/2021
cs.CLcs.LG

Official code: dongxinshuai/RIFT-NeurIPS2021 (11 stars, Python, MIT, last commit 2022-03-06).

Abstract

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations(1)

MIT
112Python, ShellOct 24, 20214 years agoMIT

Similar Papers

Cite this paper

@article{dong2021should,
  title  = {How Should Pre-Trained Language Models Be Fine-Tuned Towards Adversarial Robustness?},
  author = {Xinhsuai Dong and Luu Anh Tuan and Min Lin and Shuicheng Yan and Hanwang Zhang},
  year   = {2021},
  eprint = {2112.11668},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2112.11668}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2112.11668.svg)](https://codeofpaper.com/paper/2112.11668)

Discussion