Adversarial training is traditionally viewed as a defense mechanism against malicious inputs, often at the cost of standard accuracy—a phenomenon known as the "robustness tax." However, recent research reveals it can also act as a powerful regularizer. This paper demonstrates that by using simple, parameter-efficient adapters in Vision Transformers (ViTs), we can co-train on clean and adversarial data to achieve state-of-the-art performance and robustness without complex architectural overhauls.
The Problem: The Cost of Robustness
Deep neural networks are notoriously fragile to adversarial perturbations. Training on these intentionally noisy images (Adversarial Training) improves robustness but typically degrades performance on normal, "clean" images.
Previous works, such as AdvProp, suggested that mitigating this performance hit required "Dual BatchNorm" layers to separate the statistics (mean and variance) of clean and adversarial data. But what about modern architectures like Vision Transformers that do not use BatchNorm? The authors investigate whether separating statistics is truly necessary, or if the same benefits can be achieved using tiny, domain-specific modules called adapters.
The Solution: Adapters and Dual [CLS] Tokens
The researchers treat clean and adversarial images as two distinct domains. Instead of duplicating entire layers, they employ adapters—small sets of domain-specific parameters—while sharing the rest of the network's weights. They explored several adapter types for ViTs, including dual embedders and dual positional embeddings.
The breakthrough came from using Dual [CLS] Tokens. By simply assigning one classification token for clean images and another for adversarial images, the model can switch between a "clean mode" and a "robust mode."
This approach adds a negligible number of parameters (only 768 for a ViT-B model) but matches the performance of dual normalization layers. The [CLS] token acts as a global conditioning signal; by swapping just this one vector, the model's entire internal attention mechanism adapts to handle either clean or noisy data.
Adversarial Model Soups
Building on the dual token approach, the authors introduce Adversarial Model Soups. By linearly interpolating between the clean and adversarial [CLS] tokens during inference (using a weighting factor $\beta$), they create a single model that can slide along the Pareto front of accuracy and robustness. This allows for dynamic trade-offs between clean and robust accuracy without any additional computational cost.
Key Results and Insights
Extensive evaluation on ImageNet-1K and various distribution shift benchmarks (like ImageNet-C, -A, -R, and -Sketch) yielded several impressive results:
- Clean Accuracy Boost: A ViT-B16 trained with this method achieved 83.76% top-1 accuracy on ImageNet, a +1.12% improvement over standard training.
- State-of-the-Art Robustness: The model achieved 49.87% robust accuracy against strong $\ell_\infty$ attacks, setting a new benchmark for ViT-B16 models.
- Superior Generalization: On distribution shift benchmarks, the adapter-based models outperformed Masked Autoencoder (MAE) pre-trained models by an average of +4.00%.
- Extreme Parameter Efficiency: The [CLS] token adapter uses 49x fewer parameters than previous state-of-the-art dual normalization methods.
Interestingly, the shared backbone learns "hybrid features"—new visually distinct filters not found in models trained exclusively on a single domain. This suggests that parameters, rather than batch statistics, are the key to unlocking the benefits of adversarial co-training.
Limitations and Future Work
While the empirical results are highly compelling, the authors note a lack of theoretical explanation for why such a minuscule parameter addition (768 parameters in an 86M parameter model) yields such massive performance gains.
Additionally, the current Adversarial Model Soup requires manual selection of the interpolation weight ($\beta$). Future work could explore automatic selection modules that analyze an input image in real-time and dynamically decide which "soup" of tokens is best suited for that specific sample.
Summary updated