Efficient and Accurate Explanation Estimation with Distribution Compression

Hubert Baniecki, Giuseppe Casalicchio, Bernd Bischl, Przemyslaw Biecek

Introduction

"Compress Then Explain" (CTE) is a new paradigm designed to replace noisy random sampling with "distribution compression," making machine learning explanations faster and more reliable. By utilizing a technique called Kernel Thinning to select a representative "coreset" of data, CTE achieves the same accuracy as standard methods while requiring significantly fewer model evaluations and drastically reducing explanation variance.

The Problem with Current Sampling Methods

Post-hoc explanation methods—such as SHAP (Shapley Additive Explanations) or SAGE—are the industry standard for peeking inside "black-box" models. However, these methods are notoriously computationally expensive. To estimate a specific feature's impact, algorithms typically "marginalize" it out by sampling from a background dataset to observe how the model behaves without that information.

Currently, most practitioners rely on simple i.i.d. (independent and identically distributed) sampling to select these background points. The inherent flaw in this approach is that random sampling is "jittery." Picking a slightly different random set of points can cause feature importance rankings to flip entirely. This instability forces researchers to use massive sample sizes, leading to a huge number of model inferences that slow down the entire pipeline. Ultimately, the traditional "sample then explain" approach is inefficient and prone to error.

Methods: Compress Then Explain (CTE)

To resolve the inefficiencies of random sampling, the authors propose a new workflow: Compress Then Explain (CTE). Instead of picking points at random, CTE uses distribution compression to find a small, high-quality subset (a "coreset") that best represents the entire dataset.

Overview of the Compress Then Explain (CTE) paradigm, demonstrating how distribution compression yields more accurate explanations with fewer samples compared to standard i.i.d. sampling.

The technical engine driving this is Kernel Thinning (KT), specifically implemented via the COMPRESS++ algorithm. Unlike random sampling, KT explicitly minimizes the Maximum Mean Discrepancy (MMD)—a mathematical measure of how much two distributions differ.

The paper's major theoretical contribution is proving that the error in feature marginalization is mathematically bounded by this MMD. By minimizing MMD through compression, practitioners are guaranteed to restrict the "worst-case" error of their explanations.

Key Insights

  • "Garbage sample in, garbage explanation out": Even if an explanation algorithm is theoretically perfect, using a poor sample of background data will inevitably lead to incorrect feature rankings.
  • The MMD Connection: The theoretical link between statistical thinning and explanation accuracy is a major breakthrough. Compressing a distribution well (achieving a low MMD) mathematically guarantees a better estimate of feature effects.
  • Stability is King: CTE mitigates "random seed hacking," a frustrating phenomenon in Explainable AI (XAI) where explanations change based on the random seed of the sampler. CTE produces highly stable results, fostering greater trust in the explanation.
  • Negligible Overhead: While sophisticated compression sounds computationally heavy, COMPRESS++ is highly efficient. Compressing 20,000 points down to 128 takes less than a second on a standard CPU—a negligible cost compared to the massive time saved by requiring fewer model inferences.

Empirical Validation and Key Results

The authors conducted extensive empirical validation across over 50 datasets, including the OpenXAI Benchmark, OpenML-CC18, OpenML-CTR23, and unstructured data like IMDB (text embeddings) and ImageNet-1k (image representations).

Performance comparison of CTE ('compress') versus standard sampling across various explanation methods, highlighting improvements in Mean Absolute Error (MAE) and Top-k accuracy.

The results demonstrate significant improvements across several axes:

  • Efficiency: CTE typically achieves the same level of approximation error as i.i.d. sampling but uses 2–3× fewer model evaluations.
  • Accuracy: Across the OpenXAI datasets, CTE improved the Mean Absolute Error (MAE) of explanations by 20–45%.
  • Reliability: Explanation estimates were roughly 50% more stable (exhibiting lower variance) compared to random sampling.
  • Plug-and-Play Integration: CTE can be seamlessly integrated into existing workflows and popular libraries (like shap or captum) with just a few lines of code.

Limitations and Future Work

While CTE is a powerful tool, the authors note a few limitations:

  • Categorical Features: Kernel Thinning is inherently designed for continuous spaces. The authors successfully used "target encoding" to handle categories, but specialized thinning methods for discrete data remain a fruitful area for future research.
  • Conditional Distributions: The current framework focuses on marginal feature distributions (assuming features are independent). Extending this to conditional distributions—where features depend on one another—is a more complex challenge.
  • Hyperparameter Sensitivity: Default settings for the compression algorithm worked well across the 50+ tested datasets, but tuning the kernel choice (e.g., using Matern or B-spline kernels) could potentially unlock even greater performance.

Summary updated

BibTeX
@inproceedings{baniecki2025efficient,
  author = {Hubert Baniecki and Giuseppe Casalicchio and Bernd Bischl and Przemyslaw Biecek},
  title = {{Efficient and Accurate Explanation Estimation with Distribution Compression}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=LiUfN9h0Lx},
}
Figure