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.

Prediction to explainfrogconfidence: 0.91
HD-Explain→rank by κθ(x, xtest)
Predictive support
01same visual evidence
02same model response
03instance-specific

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:

Model score
sθ(x, y) = ∇x log Pθ(y | x)

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:

Stein support kernel
κθ(x, x′) = 𝒜θ,x 𝒜θ,x′ k(x, x′)

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.

Synthetic three-class dataset showing the support that each training point provides to one black test point. A histogram of Stein-kernel scores separates a small high-support tail from many weak-support points.
Figure 2 from the paper. Left: a three-class training set. Middle: support for one black test point, with greener examples receiving larger Stein-kernel values. Right: only a small tail of training examples provides strong predictive support.
01Choose a test prediction

Use the predicted class and the trained model exactly as deployed.

02Score every training example

Evaluate the closed-form Stein kernel against the test point.

03Return the top supporters

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.

CIFAR-10 qualitative comparison across Influence Functions, RPS, TracIn, HD-Explain, and HD-Explain star for a high-confidence correct prediction, a low-confidence correct prediction, and a low-confidence incorrect prediction.
Figure 3 from the paper. For correct frog and deer predictions, HD-Explain returns visually coherent training examples from the predicted class. For the incorrect bird-as-cat prediction, HD-Explain retrieves support that exposes the ambiguity instead of presenting an artificially tidy explanation.

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.

MetricQuestionDesired behavior
Hit rateDoes the explanation recover the known source?Higher
CoverageDo different test points receive distinct explanations?Higher
RuntimeCan explanations be produced at dataset scale?Lower
Bar charts comparing HD-Explain, HD-Explain star, RPS, Influence Functions, and TracIn on hit rate, explanation coverage, and execution time for CIFAR-10, ovarian cancer histopathology, brain MRI, and SVHN datasets.
Figure 5 from the paper. Under noise injection, HD-Explain achieves far higher source-retrieval hit rates and broader explanation coverage than the baselines while remaining computationally practical.

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:

NoInverse Hessian

No iterative approximation of how every training point perturbs model parameters.

NoModel retraining

The explanation remains faithful to the original deployed classifier.

NoTraining trace

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