Adjusting regression models for conditional uncertainty calibration

Ruijiang Gao, Mingzhang Yin, James McInerney, Nathan Kallus

Abstract

Standard Conformal Prediction (CP) guarantees marginal coverage, ensuring that uncertainty intervals are reliable on average. However, it often fails to protect specific subgroups, leading to poor conditional coverage. This paper introduces KS-constrained Conformal Prediction (KS-CP), a method that regularizes regression models during training using the Kolmogorov-Smirnov (KS) distance. By aligning local and global error distributions, KS-CP ensures that uncertainty intervals are "locally" reliable across all inputs, addressing a critical gap in high-stakes machine learning applications.

Introduction

In many machine learning applications, point predictions are insufficient; we require uncertainty intervals to gauge the reliability of a model's output. Conformal Prediction (CP) has emerged as a popular framework for this, providing a mathematical guarantee of "marginal coverage." For instance, a 90% confidence interval will contain the true value 90% of the time across the entire dataset.

However, marginal coverage can mask significant local failures. A model might achieve 90% coverage globally while being 100% accurate for a majority group and only 50% accurate for a minority subgroup. Achieving conditional coverage—guaranteeing reliability for every specific input—is a much harder problem that typically requires strong data assumptions. KS-CP addresses this by baking uncertainty awareness directly into the model's training phase.

Methodology

The authors propose KS-constrained Conformal Prediction (KS-CP), a training-time intervention that moves beyond post-hoc calibration. The core idea is to minimize the discrepancy between the distribution of errors (non-conformity scores) at a local level versus the global level.

The KS Connection and Regularization

The authors prove that the gap between marginal and conditional coverage is upper-bounded by the Kolmogorov-Smirnov (KS) distance between local and global error distributions. To make this objective compatible with gradient descent, they use a differentiable sigmoid approximation of the KS distance with a temperature parameter ($\gamma$).

Generative Modeling for Local Error Estimation

To estimate the "local" distribution of errors during training, KS-CP employs a conditional generative model (such as a Mixture Density Network or CVAE). This model generates potential outcomes for a given input, allowing the regression model to understand its own potential for error in specific regions of the feature space.

Algorithm 1: The KS-constrained Conformal Prediction (KS-CP) procedure.

The final objective function is a weighted sum of the standard Mean Squared Error (MSE) and a penalty for the worst-case KS distance: $$\text{Loss} = \text{MSE} + \lambda \cdot (\text{Worst-case KS Distance})$$ where $\lambda$ controls the trade-off between predictive accuracy and uncertainty reliability.

Experimental Evaluation

The authors evaluated KS-CP on both synthetic and real-world datasets, including the UCI Bike, Communities, and Parkinsons datasets, as well as the Medical Expenditure Panel Survey (MEPS) data from 2019–2021.

Key Results

  • Synthetic Data: In controlled environments where standard CP achieved only 55% conditional coverage for specific subgroups (against a 90% target), KS-CP successfully reached 87% coverage.
  • Real-World Robustness: Across all UCI datasets, KS-CP consistently improved the Worst-Slab Coverage (WSLAB), a metric designed to detect the most severe reliability failures within any subgroup.
  • Adaptive Intervals: When paired with Quantile scores, KS-CP adaptively adjusts interval widths for different subgroups, maintaining fairness without sacrificing global validity.

Discussion and Insights

A primary insight of this work is that post-hoc calibration is often insufficient if the underlying regression function is "uncertainty-blind." By forcing the model to be "honest" about its local uncertainty during training, KS-CP produces more reliable bounds.

However, this improvement comes with trade-offs. There is a "no free lunch" dynamic where improving conditional coverage often leads to a slight increase in MSE and wider prediction intervals. Additionally, the method's performance is dependent on the quality of the conditional generative model used to estimate the KS penalty.

Conclusion

KS-CP represents a significant step toward achieving conditional coverage in regression. By integrating a differentiable KS penalty into the training loop, the method ensures that uncertainty intervals are not just globally valid, but locally reliable. Future work may explore tighter theoretical bounds and the application of this framework to non-stationary environments where data distributions shift over time.

Summary updated

BibTeX
@article{gao2024adjusting,
  author = {Ruijiang Gao and Mingzhang Yin and James McInerney and Nathan Kallus},
  title = {{Adjusting regression models for conditional uncertainty calibration}},
  journal = {Machine Learning},
  year = {2024},
  doi = {10.1007/s10994-024-06627-7},
}
Figure