Lune

ICLR2023Top-tier venue

TextShield: Beyond Successfully Detecting Adversarial Sentences in text classification

Lingfeng Shen, Ze Zhang, Haiyun Jiang, Ying Chen

Abstract

Adversarial attack serves as a major challenge for neural network models in NLP, which precludes the model's deployment in safety-critical applications. A recent line of work, detection-based defense, aims to distinguish adversarial sentences from benign ones. However, the core limitation of previous detection methods is being incapable of giving correct predictions on adversarial sentences unlike defense methods from other paradigms. To solve this issue, this paper proposes TextShield: (1) we discover a link between text attack and saliency information, and then we propose a saliency-based detector, which can effectively detect whether an input sentence is adversarial or not. (2) We design a saliencybased corrector, which converts the detected adversary sentences to benign ones. By combining the saliency-based detector and corrector, TextShield extends the detection-only paradigm to a detection-correction paradigm, thus filling the gap in the existing detection-based defense. Comprehensive experiments show that (a) TextShield consistently achieves higher or comparable performance than state-ofthe-art defense methods across various attacks on different benchmarks. (b) our saliency-based detector outperforms existing detectors for detecting adversarial sentences.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

3 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • The Best Defense is Attack: Repairing Semantics in Textual Adversarial Examples cites Word-level Textual Adversarial Attacking as Combinatorial Optimization
  • The Best Defense is Attack: Repairing Semantics in Textual Adversarial Examples cites Is BERT Really Robust? A Strong Baseline for Natural Language Attack on Text Classification and Entailment
  • Guided Perturbation Sensitivity (GPS): Detecting Adversarial Text via Embedding Stability and Word Importance cites Is BERT Really Robust? A Strong Baseline for Natural Language Attack on Text Classification and Entailment
  • The Trickle-down Impact of Reward Inconsistency on RLHF cites Is BERT Really Robust? A Strong Baseline for Natural Language Attack on Text Classification and Entailment
  • InfoBERT: Improving Robustness of Language Models from An Information Theoretic Perspective cites Word-level Textual Adversarial Attacking as Combinatorial Optimization
  • InfoBERT: Improving Robustness of Language Models from An Information Theoretic Perspective cites Is BERT Really Robust? A Strong Baseline for Natural Language Attack on Text Classification and Entailment
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers3

  1. The Trickle-down Impact of Reward Inconsistency on RLHFLingfeng Shen, Sihao Chen, Linfeng Song, Lifeng Jin et al.ICLR 2024 · 10 citations
  2. The Best Defense is Attack: Repairing Semantics in Textual Adversarial ExamplesHeng Yang, Ke LiEMNLP 2024 · 3 citations
  3. Guided Perturbation Sensitivity (GPS): Detecting Adversarial Text via Embedding Stability and Word ImportanceBryan E. Tuck, Rakesh M. VermaAAAI 2026 · 1 citation

Builds on18

  1. Neural Cleanse: Identifying and Mitigating Backdoor Attacks in Neural NetworksBolun Wang, Yuanshun Yao, Shawn Shan, Huiying Li et al.S&P 2019 · 1,801 citations
  2. Is BERT Really Robust? A Strong Baseline for Natural Language Attack on Text Classification and EntailmentDi Jin, Zhijing Jin, Joey Tianyi Zhou, Peter SzolovitsAAAI 2020 · 1,333 citations
  3. Word-level Textual Adversarial Attacking as Combinatorial OptimizationYuan Zang, Fanchao Qi, Chenghao Yang, Zhiyuan Liu et al.ACL 2020 · 188 citations
  4. InfoBERT: Improving Robustness of Language Models from An Information Theoretic PerspectiveBoxin Wang, Shuohang Wang, Yu Cheng, Zhe Gan et al.ICLR 2021 · 132 citations
  5. Robustness Verification for TransformersZhouxing Shi, Huan Zhang, Kai-Wei Chang, Minlie Huang et al.ICLR 2020 · 131 citations

Related papers

  1. "That Is a Suspicious Reaction!": Interpreting Logits Variation to Detect NLP Adversarial AttacksEdoardo Mosca, Shreyash Agarwal, Javier Rando-Ramirez, Georg GrohACL 2022 · 43 citations
  2. TextShield: Robust Text Classification Based on Multimodal Embedding and Neural Machine TranslationJinfeng Li, Tianyu Du, Shouling Ji, Rong Zhang et al.USENIX Security 2020
  3. Searching for an Effective Defender: Benchmarking Defense against Adversarial Word SubstitutionZongyi Li, Jianhan Xu, Jiehang Zeng, Linyang Li et al.EMNLP 2021 · 46 citations
  4. RedHerring Attack: Testing the Reliability of Attack DetectionJonathan RusertEMNLP 2025
  5. CheckHARD: Checking Hard Labels for Adversarial Text Detection, Prediction Correction, and Perturbed Word SuggestionHoang-Quoc Nguyen-Son, Huy Quang Ung, Seira Hidano, Kazuhide Fukushima et al.EMNLP Findings 2022 · 3 citations
Dusk over the sea between two cliffs drawn in fine vertical lines