Abstract
Anomaly attribution aims to identify which input variables are responsible when a model's prediction fails to match observed reality. This paper addresses the "doubly black-box" scenario where neither model internals nor training data are available. We demonstrate that standard explainability methods like LIME and Shapley Values are "deviation-agnostic" and propose Likelihood Compensation (LC), a framework that attributes anomalies by finding the minimal input perturbation required to align predictions with observations.
Introduction
In industrial applications such as digital twins, machine learning models often operate as proprietary black boxes. When a significant discrepancy arises between a model's prediction and actual sensor data, stakeholders must determine the cause. This process, known as anomaly attribution, is critical for troubleshooting and maintaining trust in AI systems.
However, existing model-agnostic explanation tools (e.g., LIME, Shapley Values) are primarily designed to explain the model's output $f(x)$ rather than the error $f(x) - y$. This paper identifies a fundamental limitation in these "deviation-agnostic" methods and introduces a robust alternative.
The Limitation of Current XAI Methods
Mainstream explainability methods typically belong to the Integrated Gradient (IG) family. These methods focus on the "vertical" slope or local gradient of the function $f(x)$. Because the gradient of the prediction function $f(x)$ is identical to the gradient of the error function $f(x) - y$ with respect to input $x$, these tools are effectively blind to the specific value of the observation $y$. Consequently, they provide the same explanation regardless of whether a data point is a normal prediction or a massive anomaly.
Likelihood Compensation (LC)
To overcome this, the authors propose Likelihood Compensation (LC). Instead of analyzing the local gradient, LC adopts a "horizontal" perspective: it calculates the smallest change $\delta$ to the input $x$ that would have resulted in a prediction matching the observation $y$.
The LC Framework
LC treats the attribution problem through a probabilistic lens, assuming a Gaussian observation model. It solves an optimization problem to find a perturbation vector $\delta$ that maximizes the likelihood of observation $y$ given the perturbed input $x + \delta$. To ensure interpretability and stability, the framework incorporates Elastic Net regularization ($\ell_1$ and $\ell_2$ penalties). For black-box models, LC utilizes Monte Carlo-based direct slope estimation to determine the necessary "fix" direction.
Experimental Results
The LC framework was validated across several datasets, including synthetic 2D sinusoidal data and real-world benchmarks like Boston Housing and Building Energy consumption.
- Sensitivity to Deviations: In synthetic tests, LC correctly differentiated between opposite errors that produced identical explanations in LIME and Shapley Values.
- Real-World Utility: In a Building Energy use case, LC identified that anomalies in energy consumption were tied to specific "day-type" and "time-of-day" variables. Domain experts confirmed these anomalies corresponded to national holidays not accounted for by the model.
- Stability: LC demonstrated superior stability and lower score variability compared to methods like Expected Integrated Gradients (EIG), particularly for test points near the population mean.
Conclusion
Likelihood Compensation provides a more intuitive and mathematically sound approach to anomaly attribution in black-box settings. By focusing on how to "fix" the input to match reality, rather than just explaining the model's internal logic, LC offers a powerful tool for industrial AI troubleshooting. Future work will explore non-Gaussian noise distributions and further optimize the computational efficiency of gradient estimation for complex models.
Summary updated