When a neural network predicts “frog,” a useful explanation is not merely another frog-shaped image. It is a small set of training examples that reveals why this particular trained model supports that particular prediction. HD-Explain retrieves those examples directly, using Kernelized Stein Discrepancy to measure model-dependent support without retraining the model or tracing its entire optimization history.
What counts as an explanation?
Example-based explanation asks a concrete question: which training examples best account for this test prediction? Existing methods commonly build the connection through parameter influence or latent-space similarity. Influence functions can require expensive Hessian approximations; representation methods can return broad, class-level prototypes that look plausible but do not distinguish one test case from another.
HD-Explain builds the connection through the trained model’s probability distribution. It starts with the score function—the gradient of the model’s log probability with respect to its input:
This gradient describes how the model’s belief in class y changes around input x. It makes the comparison model-aware: two visually similar examples need not provide the same predictive support.
Kernelized Stein Discrepancy combines this score with an ordinary kernel k. The resulting Stein kernel κθ gives a closed-form, pairwise relevance score between a training example and the test example:
The Stein operators inject the trained classifier into the kernel. Ranking the training set by κθ(x, xtest) retrieves the examples that provide the strongest predictive support.
From distribution discrepancy to prediction support
Kernelized Stein Discrepancy was designed to measure whether samples match a probability distribution. The paper’s key move is to reuse its pairwise kernel as an explanation score. A few training points occupy a high-support tail; most have little relationship to the test prediction.

Use the predicted class and the trained model exactly as deployed.
Evaluate the closed-form Stein kernel against the test point.
Retrieve a compact, instance-level explanation without retraining.
Correct predictions should have coherent support
The paper compares HD-Explain with Influence Functions, Representer Point Selection, and TracIn. For each CIFAR-10 test image, every method retrieves its three most influential training examples.

The third case is especially informative. The model predicts “cat,” while the ground truth is “bird.” A coarse explainer can still produce cat examples and make the decision appear well supported. HD-Explain’s retrieved examples are less internally consistent, signaling that the model’s decision is not grounded in a clean, shared pattern. The explanation therefore helps inspect both successful reasoning and possible failure.
Measuring explanation quality
Visual plausibility is not enough, so the paper introduces quantitative tests. It perturbs known training images with noise or a horizontal flip, treats the transformed image as a test point, and asks whether an explainer retrieves the original source example.

Across CIFAR-10, SVHN, ovarian-cancer histopathology, and brain-tumor MRI, HD-Explain achieves source-retrieval hit rates above 80% in the reported noise-injection experiment; the baseline methods remain at or below roughly 10%. Its explanations also cover substantially more unique training examples, showing that the method adapts to individual cases rather than repeatedly returning a few class prototypes.
Why it scales
The support between a training point and a test point is available in closed form once the model score and kernel derivatives are computed. HD-Explain therefore avoids three expensive requirements common in earlier approaches:
No iterative approximation of how every training point perturbs model parameters.
The explanation remains faithful to the original deployed classifier.
Only the trained model and training data are needed after the fact.
The method can operate on the whole model rather than only its final layer. Its per-training-example cache scales with the data dimension, while Influence Functions and TracIn cache quantities tied to the number of model parameters. That distinction becomes important for modern networks whose parameter count greatly exceeds their input dimensionality.
Data as evidence for model behavior
HD-Explain turns the training set into an audit surface. A prediction can be accompanied by examples that expose its strongest support; an incoherent support set can flag a questionable decision; and recurring influential examples can help trace problematic data. The explanation stays concrete—actual data points—while remaining specific to the model that made the decision.
Read the research
- Mahtab Sarvmaili, Hassan Sajjad, and Ga Wu. Data-Centric Prediction Explanation via Kernelized Stein Discrepancy, ICLR 2025.
- Source code