Clustered Influence Functions

Miklós Máté Badó, Kristian FenechICML 2026

Influence functions (IF) are a cornerstone technique for data debugging, unlearning, and detecting poisoned data. They allow researchers to trace model predictions back to specific training examples, answering questions like, "Which training images caused my model to misclassify this input?"

However, standard IFs suffer from a severe computational bottleneck: calculating the influence of a data subset requires solving a complex Inverse Hessian-Vector Product (IHVP) for every single query. For high-query workloads—such as large-$K$ cross-validation, repeated resampling, or interactive what-if analyses—this per-query cost becomes prohibitive. Researchers often spend more time waiting for the curvature math to finish than actually debugging their models.

The Clustered Influence Function (CiF) Approach

To overcome this bottleneck, researchers have introduced Clustered Influence Functions (CiF). CiF transforms the subset influence problem from a per-query computation into an amortized subset oracle. It shifts the heavy lifting to a one-time setup phase, enabling nearly instantaneous queries thereafter. The workflow is divided into two phases:

1. Offline Cache Building

First, high-dimensional training gradients are compressed using a Johnson-Lindenstrauss sketch, preserving their geometric relationships while making them computationally manageable. These sketched gradients are then grouped into $C$ clusters using k-means. Crucially, the expensive IHVP is solved only for the mean gradient of each cluster, and the results are stored in a compact cache.

2. Online Querying

When evaluating a new subset query, CiF simply tallies the cluster membership counts for the points in that subset. The subset's influence is then computed via a linear recombination of the cached cluster solutions weighted by these counts. This reduces the per-query cost to $O(Cp)$, scaling linearly with the cache size $C$ and parameter count $p$, entirely bypassing the IHVP step for subsequent queries.

Theoretical Guarantees and Key Insights

The authors provide a formal diagnostic error bound that decomposes the approximation error into two interpretable components: clustering scatter (variance within a cluster) and solver residual (inaccuracy in the initial IHVP solve). This makes the accuracy-compute tradeoff explicit through the cache budget and solver tolerance.

Furthermore, CiF leverages the phenomenon of "neural collapse"—where deep learning gradients naturally exhibit low-rank, clustered structures—to compress the problem without significant information loss. Interestingly, this clustering acts as a form of geometric regularization. In data poisoning scenarios, averaging gradients within a cluster filters out random noise and amplifies the consistent signal of the backdoor, which actually improves detection.

Empirical Performance

Evaluated across standard vision benchmarks (MNIST, CIFAR-10, and ImageNet-1k), CiF demonstrates remarkable efficiency and fidelity:

  • Speed and Scalability: The method establishes a clear "break-even" frontier, becoming strictly faster than standard methods once the number of queries ($Q$) exceeds the number of clusters ($C$). On CIFAR-10, CiF achieved up to a 15.3x speedup for 150 queries. In a massive ImageNet-1k stress test with a DeiT-Tiny model and 5,000 queries, CiF was 32.9x faster than projected baselines, reducing compute time from hundreds of hours to just 19.
  • Fidelity: Despite the approximation, CiF maintains a high rank correlation (often >0.95 Spearman $\rho$) with exact influence functions, reliably identifying the most influential data points.
  • Poison Detection: CiF matched or outperformed state-of-the-art methods like TRAK and Grad-Dot in identifying poisoned data groups.

Limitations and Future Directions

While highly effective, CiF's primary limitation is memory overhead. Storing $C$ vectors of size $p$ can be memory-intensive for massive foundation models like LLMs. Additionally, CiF assumes a static model; if the model updates significantly during active training, the cache must be rebuilt.

Future research directions include exploring layer-wise caches and quantized responses to reduce memory footprints. The authors also highlight the potential for "workload-aware" influence, where the cache dynamically refines itself based on user query patterns, further optimizing the balance between memory, speed, and accuracy.

Summary updated

BibTeX
@inproceedings{bado2026clustered,
  author = {Miklós Máté Badó and Kristian Fenech},
  title = {{Clustered Influence Functions}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=Efjuj6kanc},
}
Figure