# TextDefense: Adversarial Text Detection based on Word Importance Entropy

**Authors:** Lujia Shen, Xuhong Zhang, Shouling Ji, Yuwen Pu, Chunpeng Ge, Xing Yang, Yanghe Feng  
**arXiv:** [2302.05892](https://arxiv.org/abs/2302.05892)  
**Date:** 2023-02-12  
**Summary page:** https://www.summarizepaper.com/en/paper/2302.05892v1/

## Key points

- NLP models are susceptible to adversarially generated text
- Existing defense mechanisms against adversarial attacks in NLP lack a comprehensive approach
- Adversarial attack algorithms primarily disrupt the importance distribution of words in a text
- The authors propose TextDefense, a novel framework for detecting adversarial examples that leverages the target model's capability to defend against attacks without prior knowledge
- TextDefense is agnostic to attack types and outperforms existing methods in extensive testing on different architectures, datasets, and attack methods
- The generalizability of the target model is the leading factor influencing TextDefense's performance
- The authors provide valuable insights into adversarial attacks in NLP and explain the principles behind their defense method
- TextDefense focuses on word importance entropy to address adversarial attacks in NLP applications.

## Summary

In the field of natural language processing (NLP), the use of NLP models has become widespread in various scenarios. However, these models are susceptible to adversarially generated text, just like other deep learning models. To address this vulnerability, researchers have been working on developing defense mechanisms against adversarial attacks. However, existing works lack a comprehensive defense approach as they either focus on specific attack categories or suffer from limitations such as high computation overhead and susceptibility to adaptive attacks. In this paper, the authors conduct an exhaustive investigation into adversarial attack algorithms in NLP. Through empirical studies, they discover that these attack algorithms primarily disrupt the importance distribution of words in a text. They find that a well-trained model can distinguish subtle differences in importance distribution between clean and adversarial texts. Based on this insight, they propose TextDefense, a novel framework for detecting adversarial examples that leverages the target model's capability to defend against attacks without requiring prior knowledge. TextDefense differs from previous approaches by utilizing the target model for detection and being agnostic to attack types. The authors extensively test TextDefense on different architectures, datasets and attack methods and demonstrate its superiority over existing methods. They also identify the generalizability of the target model as the leading factor influencing TextDefense's performance. By analyzing both the properties of the target model and those of adversarial examples, the authors provide valuable insights into adversarial attacks in NLP and explain the principles behind their defense method. Overall, this paper presents an innovative approach to addressing adversarial attacks in NLP by focusing on word importance entropy. The proposed TextDefense framework shows promising results and contributes to advancing the field's understanding of adversarial attacks and defenses in NLP applications.
