TL;DR
Deep learning models are notoriously prone to making overconfident, miscalibrated predictions. While calibration for classification is widely studied, regression models have traditionally relied on data-hungry, post-hoc adjustments that can overfit and degrade performance. This paper introduces Quantile Regularization, an end-to-end trainable loss function that implicitly calibrates regression models during training without requiring an additional validation dataset.
What Problem Does This Paper Address?
When a classification model outputs a probability of 0.9, we expect it to be correct 90% of the time. In regression, calibration means that a model's predicted $p\%$ credible interval should contain the true target value exactly $p\%$ of the time. Unfortunately, modern deep neural networks are frequently miscalibrated, leading to unreliable uncertainty estimates.
Existing solutions for regression calibration are primarily post-hoc (e.g., Isotonic Regression). These methods suffer from three major drawbacks:
- Data Inefficiency: They require a separate, large, labeled validation dataset to learn the calibration mapping.
- Overfitting: Non-parametric methods like Isotonic Regression easily overfit, sometimes worsening miscalibration on smaller datasets.
- Discontinuity: They output piecewise-linear, non-smooth Cumulative Distribution Functions (CDFs), which result in discontinuous Probability Density Functions (PDFs).
The authors tackle this gap by proposing an implicit calibration method that optimizes for calibration directly during the primary training phase.
Methods
The core idea behind Quantile Regularization is that for a perfectly calibrated model, the predicted cumulative density of the true targets, $[F(X)](Y)$, must follow a standard $\text{Uniform}[0,1]$ distribution.
To enforce this property during training, the authors introduce a regularizer based on Cumulative KL Divergence (CKL). Unlike standard KL divergence, which operates on PDFs and requires complex density estimation (like Beta kernels), CKL operates directly on CDFs. The authors derive an analytically closed-form, consistent estimator for CKL based on ordered samples:
$$\mathcal{L}(X, y, \mu_W, \sigma_W) = NLL(y, \mu_W, \sigma_W) + \lambda \times CL(y, \mu_W, \sigma_W)$$
Where:
- NLL is the standard Negative Log-Likelihood, which ensures the model's predictions remain sharp and accurate.
- CL is the Calibration Loss derived from the CKL estimator.
- $\lambda$ is a hyperparameter controlling the regularization strength.
Because computing the calibration loss requires sorting the predicted probabilities—a non-differentiable operation—the authors integrate NeuralSort, a differentiable relaxation of the sorting operation. This allows the entire pipeline to be trained end-to-end via backpropagation.
Datasets
The method was evaluated on 10 standard UCI regression benchmark datasets spanning various sizes (from 308 to over 500,000 instances) and feature dimensions (6 to 91):
- AirFoil, Boston Housing, Concrete Strength, Fish Toxicity, Kin8nm, Protein Structure, Red Wine, White Wine, Yacht Hydrodynamics, and Year Prediction MSD.
Key Insights and Ideas
- Post-Hoc Calibration Can Backfire: A striking insight from the paper is that traditional post-hoc Isotonic Regression frequently compounds miscalibration on small-to-medium datasets because the calibration mapping overfits the validation data.
- Baking Calibration into the Loss: By treating calibration as a regularization term (CKL) alongside NLL, the model naturally balances accuracy (sharpness) with reliable uncertainty estimates without needing a split dataset.
- Smoothness Preservation: Because the regularizer avoids piecewise-linear mappings, the resulting calibrated CDFs and PDFs remain smooth and continuous, which is highly desirable for downstream probabilistic modeling.
Key Results
The authors integrated Quantile Regularization into two popular uncertainty estimation frameworks: Heteroscedastic MC Dropout and Deep Ensembles.
- Substantial Error Reduction: Quantile Regularization consistently reduced the $l_2$ Quantile Calibration Error across almost all datasets. For instance, on the Concrete Strength dataset using MC Dropout, the calibration error dropped from 58.75% to 35.42%.
- No Loss in Accuracy: Crucially, minimizing calibration error did not degrade the Root Mean Squared Error (RMSE) or NLL, proving that the model achieves calibration without sacrificing prediction sharpness.
- Superiority over Isotonic Regression: In head-to-head comparisons, post-hoc isotonic regression worsened calibration in 5 out of 10 datasets for MC Dropout and 7 out of 10 for Deep Ensembles. Quantile Regularization consistently bypassed this failure mode.
Limitations and Future Work
While highly effective, the authors note a few limitations and directions for future research:
- Marginal vs. Distributional Calibration: Quantile calibration is based on marginal probabilities. A stronger, more rigorous objective is Distributional Calibration, which guarantees that the actual distribution matches the predicted mean and variance across all individual instances. The authors point to designing trainable loss functions for Distributional Calibration as a key next step.
- Computational Overhead: Incorporating a differentiable sorting mechanism like NeuralSort adds computational complexity during the training phase compared to standard NLL optimization.
Summary updated