MAnchors: Memorization-Based Acceleration of Anchors via Rule Reuse and Transformation
Abstract
Anchors is a popular local model-agnostic explanation technique whose applicability is limited by its computational inefficiency. To address this limitation, we propose a memorization-based framework that accelerates Anchors while preserving explanation fidelity and understandability. Our approach leverages the iterative nature of Anchors' algorithm which gradually refines an explanation until it is precise enough for a given input by storing and reusing intermediate results obtained during prior explanations. Specifically, we maintain a memory of low-precision, high-coverage rules and introduce a rule transformation framework to adapt them to new inputs: the horizontal transformation adapts a retrieved explanation to the current input by replacing features, and the vertical transformation refines the general explanation until it is precise enough for the input. We evaluate our method across tabular, text, and image datasets, demonstrating that it significantly reduces explanation generation time while maintaining fidelity and understandability, thereby enabling the practical adoption of Anchors in time-sensitive applications.
Lay Summary
Machine learning models are increasingly used to support decisions, but their predictions are often difficult for people to understand. Anchors is a popular explanation method because it describes a model’s decision using simple rules, such as “if these important parts of the input stay the same, the model will likely make the same prediction.” However, generating these rules can be very slow, because Anchors repeatedly creates many modified versions of the input and queries the model. This paper introduces MAnchors, a faster version of Anchors. The key idea is to give Anchors a memory. Instead of explaining every new input from scratch, MAnchors stores useful intermediate rules from previous explanations and reuses them for similar new inputs. It first adapts a remembered rule to the new input, then gradually refines it until the rule is reliable enough. This allows the method to reduce repeated sampling while keeping the explanations faithful and easy to understand. Experiments on tabular data, text sentiment analysis, and image classification show that MAnchors can substantially reduce explanation time. For example, when explaining Llama 3-8B, it achieves an 8.74× speedup and reduces sampling by 87%, while largely preserving explanation quality.