Introduction
Modern Pre-trained Language Models (PLMs) often operate as "black boxes," making it difficult to identify which specific components of an input string drive their decisions. A theoretical concept known as sensitivity offers a way to measure this by determining how many disjoint subsets of an input can be modified to flip a model's output. However, calculating sensitivity is computationally expensive, typically requiring exponential time complexity. Furthermore, existing explainability tools like LIME or SHAP provide local explanations for individual sentences but fail to offer a global perspective on word importance across an entire dataset.
This paper introduces SMAB (Sensitivity-based Multi-Armed Bandit), a scalable framework designed to estimate word-level sensitivity in black-box text classifiers efficiently. By treating sensitivity estimation as a resource allocation problem, SMAB identifies "high-stakes" words that consistently influence model predictions across a corpus.
The SMAB Framework
The core of the SMAB framework is a two-level bandit system that transforms an exponential search problem into a linear one. The process operates through a cycle of sampling, replacement, and prediction:
- Two-Level Bandit Architecture: The Outer Arm represents every unique word in the dataset, using strategies like Thompson Sampling to select words for testing. The Inner Arm represents all sentences containing the selected word.
- Sample-Replace-Predict: Once a word ($w_1$) is chosen, the framework identifies sentences containing it. It utilizes a Masked Language Model (MLM), specifically XLM-ROBERTA LARGE, to generate contextually appropriate perturbations.
- Sensitivity Calculation: If replacing a word flips the target classifier's label, that word is assigned a high Local Sensitivity ($L_{w_1}$).
- Global Aggregation: These local scores are aggregated to update a Global Sensitivity value for the word, identifying its overall influence across the dataset.
Sensitivity as a Performance Proxy
A significant finding of this research is that the distribution of sensitivity can serve as a powerful unsupervised proxy for model accuracy. The researchers discovered that if a model's sensitivity distribution on a new, unlabeled language (e.g., Hindi) deviates significantly from its distribution on a known language (e.g., English), this deviation strongly correlates with a drop in accuracy.
By measuring the KL divergence between these sensitivity distributions, researchers can estimate model performance decay without requiring gold-standard labels. Empirical results showed a high negative correlation—up to -0.91 for the XNLI task—between KL divergence and model accuracy.
Enhancing Adversarial Attacks
Beyond performance prediction, SMAB's sensitivity scores can be used to guide the generation of highly effective adversarial attacks. By identifying the most "sensitive" words in a sentence, the framework provides a roadmap for flipping a model's prediction with minimal changes.
- PromptAttack: Integrating SMAB sensitivity values into prompts for Large Language Models (like GPT-3.5) improved the Attack Success Rate (ASR) by 15.58% over standard baselines.
- ParaphraseAttack: Using sensitivity as a reward signal in generating adversarial paraphrases led to a 12.00% improvement over previous state-of-the-art methods.
Validation using the CheckList dataset confirmed that SMAB accurately distinguishes between words intended to flip labels (Directional Expectation) and those that should remain invariant, assigning significantly higher sensitivity scores to the former.
Conclusion
SMAB provides a scalable and efficient method for global sensitivity estimation in black-box models. By bridging the gap between local explanations and global model behavior, it enables unsupervised accuracy prediction and significantly boosts the effectiveness of adversarial text generation. While currently focused on sequence classification, future work may extend these techniques to generative tasks such as translation and summarization.
Summary updated