Explaining predictive uncertainty by exposing second-order effects

Florian Bley, Sebastian Lapuschkin, Wojciech Samek, Grégoire Montavon · DOI

TL;DR

While standard Explainable AI (XAI) tells us which features lead to a prediction, this paper introduces a method to explain why a model is uncertain. By treating uncertainty as a "second-order" effect, the authors show that uncertainty explanations can be computed as the covariance of standard first-order explanations (like LRP or Gradient × Input) across a model ensemble.

What Problem Does This Paper Address?

In high-stakes applications like autonomous driving or medical diagnosis, knowing a model's prediction isn't enough—we need to know how much to trust it. While we have good ways to estimate "predictive uncertainty" (e.g., using ensembles or dropout), explaining the source of that uncertainty is much harder.

Standard XAI techniques are designed for "first-order" effects: they tell you which pixels make a model think an image is a "cat." However, uncertainty is often driven by "second-order" effects: interactions between features or cases where the model hasn't seen enough similar data. Previous attempts to explain uncertainty were either too computationally expensive (like Shapley values) or too simplistic (like Sensitivity Analysis) to capture these complex interactions.

Methods

The authors propose a framework that turns existing XAI tools into uncertainty explainers.

  1. The Ensemble Approach: They start with an ensemble of models (or MC Dropout). Uncertainty is measured as the variance of the predictions across these models.
  2. Second-Order Attribution: They mathematically demonstrate that the attribution of this variance can be reduced to a covariance computation over the first-order explanations of the individual ensemble members.
  3. CovXAI: This allows them to "upgrade" standard methods. For example, Layer-wise Relevance Propagation (LRP) becomes CovLRP, and Gradient × Input becomes CovGI.
  4. Summarization: Since second-order effects involve a massive $d \times d$ matrix of feature interactions, they propose two ways to simplify the output for humans:
  5. Diagonal (diag): Only looking at how individual features contribute to uncertainty.
  6. Marginal (marg): Redistributing feature-interaction scores back to the individual features.

Datasets

The researchers evaluated their method across a diverse range of data types:

  • Tabular Regression: kin8nm and five datasets from the UCI repository (Bias Correction, California Housing, Wine Quality, YearPredictionMSD, and Seoul Bike Sharing).
  • Time-Series: The EPEX-FR and EPEX-DE datasets, which involve predicting day-ahead electricity prices in France and Germany.
  • Images: The CelebA-HQ dataset, used to identify how underrepresented visual features (like hats or eyeglasses) trigger model doubt.

Key Insights and Ideas

  • Uncertainty is Disagreement: The core "aha" moment is that uncertainty in an ensemble is essentially a lack of consensus. By looking at the covariance of explanations, we are identifying exactly which features the different models in the ensemble are "disagreeing" about.
  • Conservation Matters: The authors prove that their method satisfies the "conservation property." This means the sum of all uncertainty "relevance" scores perfectly equals the total predicted uncertainty, ensuring the explanation is mathematically faithful to the model.
  • Interactions are Key but Tricky: While the method captures feature interactions (e.g., how the combination of high wind power and low demand creates price volatility), they found that the "diagonal" summarization often performs better in benchmarks because interaction terms can be highly local and noisy.

Key Results

  • Superior Faithfulness: Using a "feature-flipping" benchmark (where features are removed to see how quickly uncertainty drops), CovLRP and CovGI consistently outperformed baselines like Sensitivity Analysis (SA), Integrated Gradients (IG), and Shapley Value Sampling (SVS).
  • Diagnosing Data Gaps: In the CelebA-HQ experiment, the model showed high uncertainty when shown images with hats or glasses if those features were removed from the training set. The CovLRP heatmaps precisely highlighted these "unseen" features as the source of the doubt.
  • Real-World Discovery: On the German electricity dataset, the method revealed that "residual demand" (the difference between total demand and renewable production) is a primary driver of price volatility. It specifically highlighted that the model becomes highly uncertain during periods of high renewable production and low demand.

Limitations and Future Work

  • Computational Scaling: While more efficient than Shapley values, the method still requires an ensemble of models, which can be memory-intensive for very large architectures.
  • Interaction Complexity: Attributing uncertainty to specific pairs of features is mathematically sound but remains difficult for humans to visualize effectively in high-dimensional spaces.
  • Future Directions: The authors suggest extending this to Mixture Density Networks (where uncertainty is a direct output) and accounting for autocorrelation in time-series data, where uncertainty today might be linked to uncertainty yesterday.

Summary updated

BibTeX
@article{bley2025explaining,
  author = {Florian Bley and Sebastian Lapuschkin and Wojciech Samek and Grégoire Montavon},
  title = {{Explaining predictive uncertainty by exposing second-order effects}},
  journal = {Pattern Recognition},
  year = {2025},
  doi = {10.1016/j.patcog.2024.111171},
}
Figure