Introduction
Attention mechanisms have become the cornerstone of modern Natural Language Processing (NLP), enabling models to dynamically weigh the importance of different tokens within a sequence. However, these mechanisms are frequently plagued by "attention bias," where models learn to over-rely on high-frequency words with strong inherent polarities (e.g., "excellent" or "bad") while neglecting the nuanced contextual cues that actually determine meaning. This paper introduces a novel framework designed to mitigate this bias through a self-supervised approach that uses word-level perturbation to identify truly influential tokens.
The Problem: Spurious Correlations and OOD Issues
Attention bias occurs when a model develops spurious correlations between specific words and labels, often ignoring logical connectors or adversative conjunctions (like "but," "not," or "however") that can flip the sentiment of a sentence. For instance, in a review stating, "The film was better as a video installation than a museum piece, but free to leave," a biased model might fixate on the positive connotations of "better" and "free," failing to recognize the negative sentiment conveyed by the overall structure.
Existing methods to address this typically involve human-annotated importance maps—which are expensive and unscalable—or "masking" techniques. Masking involves deleting words to observe the change in output; however, this creates "out-of-distribution" (OOD) problems. By presenting the model with fragmented, unnatural sentences it was not trained to process, masking often yields unreliable importance scores.
Methodology
The researchers propose a two-stage framework: Word-based Concurrent Perturbation (WBCP) and Perturbation-based Self-supervised Attention (PBSA).
1. Word-based Concurrent Perturbation (WBCP)
Instead of removing words entirely, WBCP applies Gaussian noise to every word embedding simultaneously. The goal is to determine the maximum amount of noise each word can tolerate before the model’s internal state or final prediction changes. The underlying logic is intuitive: if a word can withstand significant noise without affecting the output, it is likely irrelevant. Conversely, if a minor perturbation alters the prediction, that word is a critical keyword for the specific context.
2. Perturbation-based Self-supervised Attention (PBSA)
The noise-tolerance levels derived from WBCP are converted into a probability distribution that serves as a "gold standard" importance map. During the training phase, the model is guided by this map via a KL-Divergence loss function. This penalizes the model when its internal attention weights deviate from the importance scores established by the perturbation process. Because this process is self-supervised, it requires no manual labeling and is model-agnostic, making it compatible with LSTMs, BERT, DeBERTa, and other attention-based architectures.
Experimental Evaluation
The effectiveness of PBSA was tested across 10 diverse datasets, including:
- Sentence Classification: SST2, TREC, MR, CR, SUBJ, and MPQA.
- Document Categorization: IMDB.
- Aspect-based Sentiment Analysis (ABSA): REST, LAPTOP, and TWITTER.
Key Results
The PBSA method demonstrated consistent improvements across all benchmarks:
- Baseline Enhancements: On the Att-BiLSTM baseline, PBSA increased average accuracy from 82.20% to 83.65%.
- Transformer Performance: Even for large-scale pre-trained models like BERT-base and ELECTRA, PBSA provided a steady performance lift (averaging 0.83% for BERT and 0.66% for ELECTRA).
- Low-Resource Robustness: The method proved particularly effective in data-scarce environments. When trained on only 1% or 5% of available data, the performance gap between the baseline and the PBSA-enhanced model widened, suggesting that the perturbation signal provides a valuable inductive bias that helps models generalize faster.
Discussion and Insights
One of the most significant findings was the qualitative shift in model focus. Visualization of attention heatmaps revealed that PBSA-trained models moved away from generic high-frequency words and toward logical connectors like "but." This suggests that the perturbation process successfully teaches the model to respect the structural pivots of a sentence.
Furthermore, by using continuous perturbation rather than discrete masking, the input remains within the expected data distribution. This "soft" probing of the model's decision-making process yields more reliable importance scores than traditional deletion-based methods.
Limitations and Future Work
While effective, the approach introduces computational overhead due to the additional optimization step required for perturbation. Additionally, applying this to the multi-head attention structures of Transformers remains complex; the current study uses a simplified averaging strategy across heads. Future research may explore more granular guidance for specific attention heads and the application of this logic to tasks beyond classification, such as Machine Translation or Text Summarization.
Summary updated