Introduction
Large Language Models (LLMs) have demonstrated remarkable capabilities across various NLP tasks but remain susceptible to adversarial attacks. Minor, often imperceptible perturbations—such as synonym replacement—can drastically alter model predictions. ROIC-DM addresses this "glass jaw" by repurposing diffusion models, typically used for generation, as inherently robust classifiers.
Methodology: Classification as Denoising
ROIC-DM introduces a novel paradigm where classification is treated as a reverse diffusion process. Unlike traditional text purification methods that attempt to "clean" the input text, ROIC-DM applies diffusion to the categorical labels themselves.
The framework consists of three primary components:
- Diffusion on Labels: Gaussian noise is added to label vectors during the forward phase.
- Reverse Process Classification: The model starts with pure noise and iteratively denoises it to recover the correct label, conditioned on the input text $x$.
- The Advisor Mechanism: A fine-tuned language model (e.g., BERT) acts as an "advisor," providing soft-label probability distributions. This auxiliary information guides the noise estimator $f_\theta$, enhancing both efficiency and accuracy.
Experimental Evaluation
The model was evaluated on three benchmarks: AG NEWS (news classification), SST-2 (sentiment analysis), and MRPC (paraphrase detection). Robustness was tested against two potent adversarial attacks: TextFooler and BERT-Attack.
Key Results
ROIC-DM achieves a significant breakthrough in Accuracy under Attack (Aua%) while maintaining high performance on clean data.
As shown in the results, on the AG NEWS dataset, a standard BERT model's accuracy drops to 20.5% under TextFooler. In contrast, ROIC-DM maintains 78.7% accuracy. Notably, the framework often improves clean accuracy; for instance, reaching 95.1% on AG NEWS compared to BERT's 94.0%.
Discussion and Insights
The inherent robustness of ROIC-DM stems from the diffusion model's training objective: recovering signal from noise. By learning the entire data distribution rather than just a decision boundary, the model becomes significantly harder to deceive. Furthermore, the "Advisor" mechanism proves that LLMs are highly effective as auxiliary information sources in adversarial environments, even if they are vulnerable as standalone decision-makers.
Limitations and Future Work
The primary trade-off for this robustness is inference speed. Because diffusion is an iterative process (requiring up to $T=1000$ steps), predictions are slower than standard single-pass transformers. Future research will focus on optimizing sampling efficiency and extending this framework to more complex hybrid tasks.
Summary updated