Calibrated Data-Dependent Constraints with Exact Satisfaction Guarantees

Songkai Xue, Yuekai Sun, Mikhail Yurochkin

Introduction

When training machine learning models with constraints—such as fairness, safety, or stability—standard methods often fail to meet those constraints on new, unseen data. In fact, under standard assumptions, the common approach of using Sample Average Approximation (SAA) results in the population constraint being violated roughly 50% of the time. For high-stakes applications like algorithmic fairness or medical diagnostics, a coin-flip's chance of failing a legal or ethical requirement is unacceptable.

This paper introduces a "calibrated" reformulation of these constraints using distributionally robust optimization (DRO). By simply picking a quantile from a standard normal distribution, practitioners can now guarantee that their models will satisfy constraints on test data with a user-specified probability (e.g., 95%).

Methodology: A Distributionally Robust Approach

The authors propose a distributionally robust version of the constrained optimization problem to tackle the challenge of constraint generalization. Instead of satisfying the constraint only on the empirical training data, the model is required to satisfy the constraint for all distributions within a small neighborhood (specifically, a $\phi$-divergence ball) of the training distribution.

Key technical highlights of this approach include:

  • Calibrated Reformulation: By choosing the size of the neighborhood (the radius $\rho$) based on the quantiles of a standard normal distribution, the method achieves "asymptotically exact" constraint satisfaction.
  • Pivotal Uncertainty Sets: Unlike previous methods that require estimating complex "nuisance parameters" like asymptotic variances, this method is "pivotal." The user only needs to look up a standard Z-score for their desired confidence level (e.g., $1.96$ for 95% confidence).
  • Efficient Algorithm: The complex robust optimization problem simplifies into a form that can be solved with standard stochastic gradient tools. The authors derive a dual ascent algorithm that makes the computational cost comparable to standard DRO tasks.
  • Extension to Multiple Constraints: The theory is extended to handle $K$ simultaneous constraints, properly accounting for the correlation between them.

Experiments and Key Insights

The authors validated their approach using a synthetic Multi-item Newsvendor Problem (to precisely measure constraint violation frequencies across thousands of trials) and the UCI Adult Dataset (a standard benchmark for fair machine learning, predicting income subject to demographic parity constraints).

The "50% Failure" Trap and Variance Margins

The most striking insight is that standard constrained optimization is essentially uncalibrated for out-of-sample data. Without a safety margin, you are effectively gambling on a 50/50 shot that your constraint holds at test time. The authors demonstrate that their DRO approach is asymptotically equivalent to adding a margin that scales with the variance of the constraint function. Consequently, the model "pushes harder" to satisfy constraints that are noisier or more volatile.

Exact Calibration and Trade-offs

In simulations, the method achieved exact calibration. As the sample size increased, the frequency of constraint satisfaction converged exactly to the user's requested probability.

Frequency of constraint satisfaction converges to the requested probability as sample size increases.

Furthermore, on the Adult dataset, the authors demonstrated a clear "price of certainty." To move from a 50% chance of satisfying fairness to a rigorous 95% guarantee, the model only had to trade off about 2% in classification accuracy. This method also proved significantly more reliable than "uniform margin" approaches, which tend to be overly conservative because they fail to adapt to the specific variability of the data.

Limitations and Future Work

While the proposed framework offers strong guarantees, the authors note a few areas for future exploration:

  • Linearity Constraints: The current framework focuses on constraints that are expectations of functions (linear in the probability measure). Many real-world metrics, like the F1-score or certain fairness ratios, are non-linear "statistical functionals." The current dual form does not easily support these.
  • Active Set Identification: In problems with many constraints, it is not always clear which ones will be "active" (at the limit) at the optimal solution. A fully integrated theoretical solution for unknown active sets remains an open challenge, though the authors propose a two-stage heuristic.
  • Asymptotic Nature: The exact satisfaction guarantees are asymptotic, holding as the sample size $n$ becomes large. Performance on extremely small datasets where asymptotics have not yet taken effect is less certain.

Summary updated

BibTeX
@inproceedings{xue2022calibrated,
  author = {Songkai Xue and Yuekai Sun and Mikhail Yurochkin},
  title = {{Calibrated Data-Dependent Constraints with Exact Satisfaction Guarantees}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=oWqWiazEb62},
}
Figure