Abstract: Local explanation methods highlight the input tokens that have a considerable impact on the outcome of classifying the document at hand. For example, the Anchor algorithm applies a statistical analysis of the sensitivity of the classifier to changes in the token. Aggregating local explanations over a dataset provides a global explanation of the model. Such aggregation aims to detect words with the most impact, giving valuable insights about the model, like what it has learned in training and which adversarial examples expose its weaknesses. However, standard aggregation methods bear a high computational cost: a naïve implementation applies a costly algorithm to each token of each document, and hence, it is infeasible for a simple user running in the scope of a short analysis session. We devise techniques for accelerating the global aggregation of the Anchor algorithm. Specifically, our goal is to compute a set of top-k words with the highest global impact according to different aggregation functions. Some of our techniques are lossless and some are lossy. We show that for a very mild loss of quality, we are able to accelerate the computation by up to 30x, reducing the computation from hours to minutes. We also devise and study a probabilistic model that accounts for noise in the Anchor algorithm and diminishes the bias toward words that are frequent yet low in impact.
Introduction
In the field of Explainable AI (XAI), "local" explanations are used to understand why a model made a specific decision for a single instance—for example, "Why did the model flag this specific email as spam?" While algorithms like Anchor are effective for local insights, they are computationally intensive.
The challenge arises when attempting to derive a global explanation: identifying which features consistently influence the model across an entire dataset. A naïve approach—running local explanations on every token in every document—is prohibitively slow, potentially taking days for modest datasets. This research introduces methods to accelerate this aggregation, enabling global analysis within interactive timeframes.
Methodology: Probabilistic Aggregation and Optimization
The authors address the computational bottleneck through both mathematical modeling and engineering optimizations.
A Generative Probabilistic Model ($G_{pr}$)
Standard aggregation methods, such as simple summation of local scores, often suffer from frequency bias. Common "stop words" (e.g., "the", "and") can appear as high-impact features simply due to their prevalence. To counter this, the researchers developed $G_{pr}$, a generative probabilistic model that treats "anchor" status as a latent variable. This allows for estimating the true probability of a word being an anchor while filtering out noise and frequency-induced bias.
Acceleration Techniques
To achieve real-time performance, several optimizations were implemented:
- Anytime Evaluation: The system provides an incremental top-k list that improves as more data is processed, allowing users to stop early once the ranking stabilizes.
- Candidate Filtering: Mathematical upper bounds are used to skip calculations for tokens that cannot possibly enter the top-k list.
- Hyperparameter Tuning: By reducing the confidence threshold ($\delta$) and sample counts of the underlying Anchor algorithm, the researchers achieved massive speedups. While local precision is slightly reduced, the impact on the final global ranking is negligible.
Evaluation and Results
The framework was tested on four text classification tasks (Coronavirus tweets, Social Dilemma tweets, and Amazon reviews) using models like DeBERTa and BERT.
The results demonstrate a significant breakthrough in efficiency. The optimized system achieved up to a 30x acceleration, transforming tasks that previously took hours into minute-long computations.
Quality was measured using the Area Over the Perturbation Curve (AOPC), which quantifies the drop in model prediction confidence when top-ranked words are removed. The $G_{pr}$ method consistently outperformed baseline sum and average aggregations. For instance, in the Coronavirus dataset, $G_{pr}$ successfully identified "hand" (related to hand sanitizer) as a high-impact word for positive sentiment—an insight buried in simpler methods.
Conclusion
By combining a noise-robust probabilistic model with aggressive runtime optimizations, this work makes global model explanation feasible for interactive use. Future work aims to extend these techniques to multi-word phrases (n-grams) and adapt the acceleration strategies to other local explanation methods like LIME or SHAP.
Summary updated