Fast conformal classification using influence functions

Umang Bhatt, Adrian Weller, Giovanni CherubinCOPA 2021

Authors: Umang Bhatt, Adrian Weller, Giovanni Cherubin

Abstract

Full conformal prediction (CP) provides rigorous uncertainty guarantees but is computationally expensive, requiring model retraining for every test point and candidate label. We propose CP+IF, a method that leverages influence functions from robust statistics to approximate the retraining process. This approach significantly reduces time complexity while maintaining high validity, especially as training set sizes increase.

Introduction: The Computational Bottleneck of Conformal Prediction

In high-stakes machine learning, point predictions are often insufficient; we require a measure of uncertainty. Conformal Prediction (CP) addresses this by producing prediction sets that contain the true label with a user-specified probability. "Full CP" is the most statistically powerful variant, but it requires retraining the model $n+1$ times for each test point to calculate a p-value. For large datasets ($n > 10^4$) and complex models, this is computationally prohibitive. While "Split CP" offers a faster alternative, it sacrifices statistical power. Our work bridges this gap by making Full CP computationally feasible through influence functions.

Methods: Approximating Retraining with Influence Functions

The proposed CP+IF method replaces the exhaustive leave-one-out (LOO) retraining with a first-order Taylor expansion. By calculating the inverse Hessian of the loss function once on the augmented dataset, we can estimate how the model parameters would change if any specific training point were removed.

Algorithm 1: The CP+IF procedure for fast p-value estimation.

The workflow involves:

  1. Training the model once on the dataset $\mathcal{D}$ augmented with the test point $(x, \hat{y})$.
  2. Calculating the Hessian inverse $H_{\theta_{\mathcal{Z}}}^{-1}$.
  3. Using the influence function $I_{\mathcal{Z}}(x_i, y_i) = -g^\top H_{\theta_{\mathcal{Z}}}^{-1} g$ to approximate non-conformity scores $\alpha_i$ without retraining.
  4. Computing the p-value based on these approximated scores.

Results: Efficiency and Validity at Scale

We evaluated CP+IF using logistic regression on synthetic datasets. The results demonstrate two primary advantages:

  1. Computational Efficiency: As shown in Figure 1(a), the average prediction time for "Standard CP" grows exponentially with the training set size. In contrast, "Optimized CP" (CP+IF) remains nearly constant, scaling linearly $O(n)$ rather than $O(n^2)$.
  2. Statistical Validity: Influence function approximations become more accurate as the dataset grows. Figure 1(b) shows that the difference between the Full CP p-value and the CP+IF estimate drops to approximately $10^{-4}$ for $10^4$ training examples.
Performance comparison: (a) Average prediction time and (b) p-value approximation error vs. training set size.

Furthermore, the "fuzziness" of the predictions—a measure of the efficiency of the prediction sets—was identical (0.0258) for both standard Full CP and CP+IF at $n=10,000$, indicating no loss in statistical power.

Discussion and Future Work

While CP+IF offers a significant speedup, challenges remain. Calculating and inverting the Hessian is expensive for high-dimensional models like deep neural networks. Future research will explore using the Woodbury matrix identity for faster updates across multiple test points and extending the framework to non-convex loss functions. By bounding the approximation error, we aim to provide even stronger theoretical guarantees for this efficient approach to uncertainty quantification.

Summary updated

BibTeX
@inproceedings{bhatt2021fast,
  author = {Umang Bhatt and Adrian Weller and Giovanni Cherubin},
  title = {{Fast conformal classification using influence functions}},
  booktitle = {COPA},
  year = {2021},
  url = {https://openreview.net/forum?id=NgONaXgBQDc},
}
Figure