Defense against Adversarial Attacks in NLP via Dirichlet Neighborhood Ensemble

Yi Zhou, Xiaoqing Zheng, Cho-Jui Hsieh, Kai-wei Chang, Xuanjing Huang
6/20/2020
cs.CLcs.LG

Official code: dugu9sword/dne (17 stars, Python, last commit 2023-06-12).

Abstract

Despite neural networks have achieved prominent performance on many natural language processing (NLP) tasks, they are vulnerable to adversarial examples. In this paper, we propose Dirichlet Neighborhood Ensemble (DNE), a randomized smoothing method for training a robust model to defense substitution-based attacks.

Show full abstract

During training, DNE forms virtual sentences by sampling embedding vectors for each word in an input sentence from a convex hull spanned by the word and its synonyms, and it augments them with the training data. In such a way, the model is robust to adversarial attacks while maintaining the performance on the original clean data. DNE is agnostic to the network architectures and scales to large models for NLP applications. We demonstrate through extensive experimentation that our method consistently outperforms recently proposed defense methods by a significant margin across different network architectures and multiple data sets.

View on arXivView PDF

Code Implementations(1)

dugu9sword/dneOfficial100%

ACL 2021 - Defense against Adversarial Attacks in NLP via Dirichlet Neighborhood Ensemble

173Python, ShellDec 23, 20193 years ago

Similar Papers

Cite this paper

@article{zhou2020defense,
  title  = {Defense against Adversarial Attacks in NLP via Dirichlet Neighborhood Ensemble},
  author = {Yi Zhou and Xiaoqing Zheng and Cho-Jui Hsieh and Kai-wei Chang and Xuanjing Huang},
  year   = {2020},
  eprint = {2006.11627},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2006.11627}
}

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/2006.11627.svg)](https://codeofpaper.com/paper/2006.11627)

Discussion