Skip to content
conftrace_
2023 ACL ACL 2023

Similarizing the Influence of Words with Contrastive Learning to Defend Word-level Adversarial Text Attack

AbstractNeural language models are vulnerable to word-level adversarial text attacks, which generate adversarial examples by directly substituting discrete input words. Previous search methods for word-level attacks assume that the information in the important words is more influential on prediction than unimportant words. In this paper, motivated by this assumption, we propose a self-supervised regularization method for Similarizing the Influence of Words with Contrastive Learning (SIWCon) that encourages the model to learn sentence representations in which words of varying importance have a more uniform influence on prediction. Experiments show that SIWCon is compatible with various training methods and effectively improves model robustness against various unforeseen adversarial attacks. The effectiveness of SIWCon is also intuitively shown through qualitative analysis and visualization of the loss landscape, sentence representation, and changes in model confidence.

🌉 Interdisciplinary Bridge - Artificial Intelligence and Natural Language Processing

More from ACL 2023

All ACL 2023 papers →