Abstract
Deep learning models in NLP are vulnerable to small adversarial perturbations. While randomized smoothing offers certified robustness guarantees, existing fixed-rate deletion methods are suboptimal for varying input lengths. We present AdaptDel, a framework that employs adaptive deletion rates tailored to sequence length. By leveraging the inherent redundancy of longer sequences, AdaptDel significantly expands the certified robustness radius—achieving up to 30 orders of magnitude improvement in median certified cardinality—while simultaneously improving inference speed and maintaining competitive accuracy.
Introduction
Deep learning models are notoriously fragile. In NLP, small "adversarial" changes—like swapping a word for a synonym or deleting a character—can flip a model's prediction. Certified robustness aims to provide a mathematical guarantee that a model’s prediction will remain constant within a certain "radius" of the original input.
A popular technique for this is randomized smoothing, where you perturb an input many times (e.g., by deleting random words) and take the majority vote. However, existing methods for text use a fixed deletion rate. This is suboptimal: a short sentence might lose its meaning if 20% of its words are deleted, whereas a long paragraph might remain perfectly clear even with 50% deletion. This "one-size-fits-all" approach leads to weak robustness guarantees for longer, more complex sequences.
Methodology
The authors propose two primary methods to make deletion rates "input-aware":
- AdaptDel: Uses a smooth mathematical function to increase the deletion rate as the input sequence gets longer. The intuition is that longer sequences are more redundant and can tolerate more aggressive smoothing.
- AdaptDel+: A more refined version that bins inputs by length and uses an empirical calibration procedure (specifically a golden section search) to find the optimal deletion rate for each bin.
To make this work, the theory of randomized smoothing was extended to derive new lower and upper bounds for the smoothed classifier’s confidence when the deletion rate is non-constant. The problem of finding the worst-case perturbation was framed as a bounded knapsack problem, allowing for efficient calculation of robustness certificates.
Experimental Evaluation
The researchers evaluated their methods on four diverse NLP tasks using a pre-trained RoBERTa model:
- Yelp: 5-class sentiment analysis (Avg. 134 words).
- IMDB: Binary sentiment analysis (Avg. 231 words).
- SpamAssassin: Spam detection (Avg. 228 words).
- LUN: Unreliable news detection (Avg. 270 words).
Results and Discussion
The core insight of this work is that redundancy is a resource. By applying stronger smoothing to longer, more redundant inputs, AdaptDel achieves much larger "certified regions."
Key Findings:
- Massive Robustness Gains: AdaptDel+ improved the median cardinality of the certified region (the number of possible adversarial edits the model is guaranteed to ignore) by up to 30 orders of magnitude compared to previous state-of-the-art methods like CERT-ED.
- Maintained Accuracy: The "clean accuracy" remained highly competitive, typically staying within 0–2% of fixed-rate baselines.
- Efficiency Gains: Counter-intuitively, adaptive smoothing makes the model 20% to 372% faster during certification. Because longer sequences are deleted more aggressively, the resulting "smoothed" inputs are shorter, reducing the computational load on the transformer model.
Conclusion
AdaptDel demonstrates that input-aware smoothing is a powerful tool for certified robustness in NLP. While currently focused on edit distance, the framework is flexible. Future work could explore adaptive smoothing for semantic perturbations or incorporate linguistic complexity beyond simple sequence length.
Summary updated