Natural Language Adversarial Defense through Synonym Encoding

Xiaosen Wang, Hao Jin, Yichen Yang, Kun He
9/15/2019
cs.CLcs.LG

No official code found. Best implementation: xiaosen-wang/SEM (7 stars, Python, last commit 2020-08-08).

Abstract

In the area of natural language processing, deep learning models are recently known to be vulnerable to various types of adversarial perturbations, but relatively few works are done on the defense side. Especially, there exists few effective defense method against the successful synonym substitution based attacks that preserve the syntactic structure and semantic information of the original text while fooling the deep learning models.

Show full abstract

We contribute in this direction and propose a novel adversarial defense method called Synonym Encoding Method (SEM). Specifically, SEM inserts an encoder before the input layer of the target model to map each cluster of synonyms to a unique encoding and trains the model to eliminate possible adversarial perturbations without modifying the network architecture or adding extra data. Extensive experiments demonstrate that SEM can effectively defend the current synonym substitution based attacks and block the transferability of adversarial examples. SEM is also easy and efficient to scale to large models and big datasets.

View on arXivView PDF

Code Implementations(1)

xiaosen-wang/SEMCommunity100%

Code for Natural Language Adversarial Attacks and Defenses in Word Level

75PythonAug 8, 20206 years ago

Similar Papers

Cite this paper

@article{wang2019natural,
  title  = {Natural Language Adversarial Defense through Synonym Encoding},
  author = {Xiaosen Wang and Hao Jin and Yichen Yang and Kun He},
  year   = {2019},
  eprint = {1909.06723},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1909.06723}
}

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

Discussion