mlsanityData to 14 Oct 2026

RTD-Guard: A Black-Box Textual Adversarial Detection Framework via Replacement Token Detection

arXiv 2603.12582 ↗First posted 13 Mar 2026cs.CL cs.CRcited by 0

Not on the map. Why?

Abstract (arXiv)

Textual adversarial attacks pose a serious security threat to Natural Language Processing (NLP) systems by introducing imperceptible perturbations that mislead deep learning models. While adversarial example detection offers a lightweight alternative to robust training, existing methods typically rely on prior knowledge of attacks, white-box access to the victim model, or numerous queries, which severely limits their practical deployment. This paper introduces RTD-Guard, a novel black-box framework for detecting textual adversarial examples. Our key insight is that word-substitution perturbations in adversarial attacks closely resemble the "replaced tokens" that a Replaced Token Detection (RTD) discriminator is pre-trained to identify. Leveraging this, RTD-Guard employs an off-the-shelf RTD discriminator-without fine-tuning-to localize suspicious tokens, masks them, and detects adversarial examples by observing the prediction confidence shift of the victim model before and after intervention. The entire process requires no adversarial data, model tuning, or internal model access, and uses only two black-box queries. Comprehensive experiments on multiple benchmark datasets demonstrate that RTD-Guard effectively detects adversarial texts generated by diverse state-of-the-art attack methods. It surpasses existing detection baselines across multiple metrics, offering a highly efficient, practical, and resource-light defense mechanism-particularly suited for real-world deployment in resource-constrained or privacy-sensitive environments.

Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 26 of its 37 references that are in the map. First posted on arXiv 13 Mar 2026.

Builds on

26 of 37 references.

References · 26

  1. 2017Attention Is All You Needcited by 60,361
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
  3. 2020Language Models are Few-Shot Learnerscited by 32,419
  4. 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,372
  5. 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 3,104
  6. 2019ALBERT: A Lite BERT for Self-supervised Learning of Language Representationscited by 2,790
  7. 2015Character-level Convolutional Networks for Text Classificationcited by 2,330
  8. 2018A Simple Unified Framework for Detecting Out-of-Distribution Samples and Adversarial Attackscited by 1,485
  9. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
  10. 2020Making Pre-trained Language Models Better Few-shot Learnerscited by 1,256
  11. 2020Exploiting Cloze Questions for Few Shot Text Classification and Natural Language Inferencecited by 938
  12. 2023AutoDAN: Generating Stealthy Jailbreak Prompts on Aligned Large Language Modelscited by 785
14 more
  1. 2019Is BERT Really Robust? A Strong Baseline for Natural Language Attack on Text Classification and Entailmentcited by 671
  2. 2018TextBugger: Generating Adversarial Text Against Real-world Applicationscited by 381
  3. 2020BAE: BERT-based Adversarial Examples for Text Classificationcited by 316
  4. 2024AutoDAN-Turbo: A Lifelong Agent for Strategy Self-Exploration to Jailbreak LLMscited by 199
  5. 2021COCO-LM: Correcting and Contrasting Text Sequences for Language Model Pretrainingcited by 126
  6. 2020Reevaluating Adversarial Examples in Natural Languagecited by 85
  7. 2021XLM-E: Cross-lingual Language Model Pre-training via ELECTRAcited by 72
  8. 2019Learning to Discriminate Perturbations for Blocking Adversarial Attacks in Text Classificationcited by 57
  9. 2020Frequency-Guided Word Substitutions for Detecting Textual Adversarial Examplescited by 54
  10. 2020Universal Adversarial Attacks with Natural Triggers for Text Classificationcited by 51
  11. 2021Defending Pre-trained Language Models from Adversarial Word Substitutions Without Performance Sacrificecited by 30
  12. 2022"That Is a Suspicious Reaction!": Interpreting Logits Variation to Detect NLP Adversarial Attackscited by 24
  13. 2019Generating Black-Box Adversarial Examples for Text Classifiers Using a Deep Reinforced Modelcited by 10
  14. 2023TextShield: Beyond Successfully Detecting Adversarial Sentences in Text Classificationcited by 8

Built on by

Not cited yet.