Tougher Text, Smarter Models: Raising the Bar for Adversarial Defence Benchmarks

Yang Wang, Chenghua Lin

Abstract

Deep learning models for Natural Language Processing (NLP) remain highly vulnerable to adversarial attacks—small, human-imperceptible perturbations that can trigger incorrect predictions. Current defense research is often hampered by narrow benchmarks and computationally expensive training methods. This paper introduces a comprehensive evaluation suite spanning diverse tasks, including commonsense reasoning and natural language inference. Furthermore, we propose TTSO++, a lightweight defense mechanism utilizing entropy-based temperature scaling. TTSO++ significantly enhances model robustness with negligible computational overhead, outperforming traditional adversarial training across multiple state-of-the-art encoder models.

Introduction

Despite the rapid advancement of Transformer-based architectures, NLP models are notoriously fragile. A simple synonym replacement or a minor grammatical shift can completely flip a model's output. While various defenses have been proposed, the field lacks a standardized and rigorous framework for evaluation. Many existing studies rely on outdated models or focus exclusively on simple sentiment analysis tasks, which do not reflect the complexity of modern NLP applications.

Moreover, the prevailing defense strategy—adversarial training—is often impractical. By generating and incorporating adversarial examples during training, these methods can increase computational costs by 4x to 10x and frequently fail to generalize to unseen attack types. This paper addresses these gaps by providing a diverse benchmark and a novel, efficient defense strategy.

A New Benchmark for Textual Robustness

To move beyond the limitations of current evaluations, we expanded the testing suite to include six diverse datasets that challenge models across different cognitive dimensions:

  • Sentiment Analysis: SST2 and MR (Binary classification of movie reviews).
  • Paraphrase Identification: MRPC (Determining semantic equivalence between sentence pairs).
  • Natural Language Inference (NLI): SciTail (Logical entailment).
  • Commonsense Reasoning: SIQA and CSQA (Tasks requiring social and general world knowledge).

These datasets were tested against a range of state-of-the-art models, including BERT, RoBERTa, DeBERTa, and the BGE-M3 embedding model. This variety ensures that defenses are evaluated not just on their ability to handle word-level swaps, but on their capacity to maintain logical consistency under pressure.

TTSO++: Entropy-Based Dynamic Defense

We propose TTSO++, a variant of training-time temperature scaling designed to be "synonym-agnostic" and "structure-free." Unlike defenses that require knowledge of how an attacker generates perturbations, TTSO++ focuses on model calibration through entropy-based dynamic confidence adjustment.

The Mechanism

TTSO++ adjusts the model's output distribution based on its internal uncertainty:

  • High Entropy (Uncertainty): If the model is uncertain about an input, TTSO++ applies a lower temperature to "sharpen" the distribution, forcing a more decisive prediction.
  • Low Entropy (Overconfidence): If the model is overconfident, TTSO++ applies a higher temperature to "smooth" the distribution.

This approach directly combats the Illusion of Robustness (IOR). IOR occurs when highly miscalibrated, overconfident models appear hard to attack because their predicted probabilities remain static even when the input is perturbed. By recalibrating the model, TTSO++ reveals and then reinforces "true" robustness.

Experimental Results

Our evaluation demonstrates that TTSO++ consistently achieves the highest Accuracy Under Attack (AUA) and the lowest Attack Success Rate (ASR) across nearly all tested models and datasets.

Performance Highlights

  • Robustness Gains: On the SST2 dataset using a BERT-base model, TTSO++ achieved an AUA of 43.27% against the TextFooler attack. In contrast, a standard model achieved only 6.59%, and traditional adversarial training methods hovered between 8% and 10%.
  • Efficiency: While adversarial training methods like PGD significantly slow down training, TTSO++ adds a negligible overhead of only 1.1x.
  • Generalization: TTSO++ proved exceptionally effective on complex commonsense reasoning tasks (SIQA/CSQA), where traditional token-level defenses often fail to provide any meaningful improvement.

Discussion and Future Work

One of the most striking findings of our research is that simple regularization and calibration techniques can be more effective than complex adversarial training in the discrete domain of text. Furthermore, our results indicate that while generative Large Language Models (LLMs) like Llama-3 or Phi-3 are powerful, they currently underperform compared to smaller, discriminative encoder models on these specific classification benchmarks. This suggests that optimizing encoders remains a critical frontier for robustness research.

Future work will explore the translation of these defense mechanisms to decoder-only LLM architectures and investigate more complex dynamic scaling schedules, such as curriculum-based scaling that evolves throughout the training process.

Conclusion

By raising the bar for how we measure textual robustness, this paper highlights the limitations of current defense paradigms. TTSO++ offers a path forward: a defense that is not only more effective than traditional methods but also significantly more efficient, making robust NLP models accessible without the need for massive computational budgets.

Summary updated

BibTeX
@inproceedings{wang2025tougher,
  author = {Yang Wang and Chenghua Lin},
  title = {{Tougher Text, Smarter Models: Raising the Bar for Adversarial Defence Benchmarks}},
  booktitle = {International Conference on Computational Linguistics},
  year = {2025},
}
Figure