Extreme Miscalibration and the Illusion of Adversarial Robustness

Vyas Raina, Samson Tan, Volkan Cevher, Aditya Rawal, Sheng Zha, George Karypis

TL;DR

Natural Language Processing (NLP) models often appear robust to adversarial attacks simply because they are extremely over- or under-confident, a phenomenon the authors call the Illusion of Robustness (IOR). By applying test-time temperature scaling to "re-calibrate" these models, the authors reveal their true vulnerabilities and propose a novel high-temperature training method to achieve genuine, verifiable robustness.

What Problem Does This Paper Address?

Deep learning models for NLP are notoriously fragile; small, human-imperceptible changes to text (adversarial attacks) can easily flip a model's prediction. While researchers use Adversarial Training (AT) to defend these models, this paper identifies a dangerous pitfall: obfuscated gradients.

In computer vision, it's well-known that certain defenses don't actually move the decision boundary; they just make the gradients so noisy or flat that an attacker's search algorithm gets lost. This paper proves that a similar effect happens in NLP due to extreme miscalibration. When a model is forced to be near 100% confident (overconfident) or near-random (underconfident), the mathematical "signal" an attacker uses to find weaknesses disappears. This creates a "false sense of security" where a model looks robust in evaluations but remains fundamentally vulnerable.

Methods

The authors explore three main areas:

  1. Inducing the Illusion: They demonstrate that both explicit logit scaling (setting a very low or high temperature $T$ at inference) and implicit training choices (like global gradient normalization) can trigger IOR.
  2. Piercing the Illusion: To reveal a model's true robustness, they introduce two test-time mitigation strategies:
  3. Naive Temperature Calibration: Finding a temperature that minimizes Negative Log Likelihood (NLL) on a clean validation set.
  4. Adversarial Temperature Optimization: A more aggressive approach using the Brent-Dekker method to find the specific temperature that makes the model most vulnerable to a specific attack.
  5. Genuine Robustness via High-Temperature Training: Instead of scaling temperature down to hide vulnerabilities, they propose scaling it up ($T > 1$) during training. This forces the model to push class logits further apart to minimize loss, effectively increasing the "class margin" in a way that is harder for adversaries to circumvent.

Datasets

The study evaluates models across six standard NLP classification benchmarks:

  • Rotten Tomatoes (rt): Binary sentiment classification.
  • Twitter Emotions: 6-class emotion detection.
  • AGNews: 4-class news topic classification.
  • GLUE Tasks: Including CoLA (linguistic acceptability), QNLI (question-answering NLI), and MRPC (paraphrase detection).

Key Insights and Ideas

  • The U-Shaped Vulnerability Curve: As shown in Figure 1, models with "normal" confidence levels are easily attacked. However, as confidence approaches extreme overconfidence (~100%) or underconfidence (~50% for binary tasks), the apparent accuracy on adversarial examples spikes.

    Figure 1: Accuracy on adversarial examples from out- of-the-box adversarial attack for models with different average predicted class confidence, Ep(x)[Pˆθ(ˆc|x)]. Ex- tremely overconfident and underconfident models show increased robustness. We reveal that this increased ro- bustness is merely an illusion of robustness.
  • Implementation Matters: Common training "tricks" like gradient normalization, often used to stabilize training, can accidentally induce IOR by causing extreme overconfidence.

  • Calibration as an Evaluation Standard: The authors argue that no robustness claim in NLP should be accepted unless the model is first subjected to test-time temperature scaling to ensure the gains aren't just an illusion.
  • Baking in Robustness: High-temperature training acts as a form of regularization that flattens the loss landscape, making the model's decision boundaries more stable and genuinely harder to cross.

Key Results

  • Exposing the Fake Robustness: Highly overconfident models (like those using ddi-at or ↑conf) appeared to have adversarial accuracies as high as 67%. However, after applying naive calibration (cal), this "robustness" evaporated, dropping accuracy back down to baseline levels (~20-30%).
  • High-Temperature Gains: Training with $T=200$ (combined with gradient normalization) consistently improved genuine robustness. For the baseline* model on the Rotten Tomatoes dataset, adversarial accuracy against the bae attack rose from 32.40% to 35.83% after high-temperature training, with even larger gains seen against other attack types.
Table 4: Results of High-Temperature Training (⊕T) combined with various AT methods.

Limitations and Future Work

  • Model Scope: The experiments focused on encoder-based Transformers (BERT, RoBERTa, DeBERTa). The authors note that investigating IOR in massive decoder-only Large Language Models (LLMs) is a critical next step.
  • Temperature Schedules: The study used a constant temperature during training. The authors suggest that varying the temperature (a "schedule") throughout the training process might yield even better results.
  • Computational Cost: While naive calibration is fast, the more effective "Adversarial Temperature Optimization" is computationally expensive and might be difficult to scale for very large models or datasets.

Summary updated

BibTeX
@inproceedings{raina2024extreme,
  author = {Vyas Raina and Samson Tan and Volkan Cevher and Aditya Rawal and Sheng Zha and George Karypis},
  title = {{Extreme Miscalibration and the Illusion of Adversarial Robustness}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.acl-long.137},
}
Figure