Abstract
Pre-trained language models (PLMs) are highly effective but remain vulnerable to adversarial attacks, where minor input perturbations like synonym swaps can lead to incorrect predictions. Traditional defenses, such as adversarial training, are computationally expensive and often provide limited protection. This paper introduces PURE (Purified Representation), a simple, parameter-free module that enhances robustness by removing the dominant principal component from token embeddings. By promoting isotropy in the latent space, PURE mitigates the influence of high-frequency noise exploited by adversaries. Experimental results across eight benchmarks demonstrate that PURE significantly reduces the Performance Drop Rate (PDR) while maintaining high efficiency and clean accuracy.
Introduction
Despite their success, models like BERT and RoBERTa are surprisingly fragile. Small, human-imperceptible changes to a sentence can flip model predictions entirely. The authors identify a geometric "weak spot" in these models: their embedding spaces are often anisotropic, meaning they are stretched in specific directions. These dominant directions often capture high-frequency "noise" (such as stopwords) rather than semantic meaning, providing a predictable surface for adversaries to exploit.
Methodology: Purifying the Latent Space
The core of the proposed approach is Instance-level Principal Component Removal (PCR). PURE is a "plug-and-play" module integrated directly into the model's architecture. During fine-tuning, for every instance, the module performs a Singular Value Decomposition (SVD) on the token embeddings to identify and subtract the top principal component.
To maintain computational efficiency, the authors utilize Randomized SVD (rSVD). This stochastic approach not only speeds up the process but also acts as a form of implicit regularization, making the latent space a "moving target" for attackers. Following purification, a parameter-free self-attention mechanism (PFSA) pools the token embeddings into a single sentence-level representation.
As shown in Figure 1, each component of the PURE pipeline contributes to a lower Performance Drop Rate (PDR). While removing the standard pooling layer initially increases vulnerability, the addition of PFSA and PCR modules significantly drives down the PDR from the 81.7 baseline to 58.4.
Experimental Results
The approach was evaluated across eight diverse Natural Language Understanding (NLU) benchmarks, including sentiment analysis (SST2) and commonsense reasoning (CSQA).
Robustness vs. Adversarial Training
A key finding is that PURE achieves "Adversarial Defence without Adversarial Defence." Because it fixes the model's internal geometry rather than training on specific "broken" examples, it avoids the 3-4x computational overhead of traditional adversarial training.
Figure 2 illustrates that PURE (without any data augmentation) consistently outperforms models trained on datasets augmented by popular attack algorithms like TextFooler and TextBugger. While augmented models struggle to maintain low PDR even as the dataset size increases, PURE maintains a superior, stable robustness profile.
Key Insights
- Efficiency: PURE adds only a tiny overhead (~1.2x training time) compared to the massive costs of adversarial training.
- Clean Accuracy: The method maintains "clean" accuracy comparable to standard models, ensuring that robustness does not come at the cost of general performance.
- Transferability: PURE showed superior "natural robustness" when transferred across different datasets, suggesting the geometric purification captures universal linguistic properties.
Conclusion
PURE offers a novel geometric perspective on model robustness. By removing dominant, noisy principal components, it forces models to rely on more stable semantic relationships. Future work may explore the application of PURE to generative tasks and its effectiveness in larger models (>1B parameters) where feature spaces are more complex.
Summary updated