(Almost) Provable Error Bounds Under Distribution Shift via Disagreement Discrepancy

Elan Rosenfeld, Saurabh Garg

Abstract

Predicting model performance under distribution shift is a critical challenge for deploying reliable machine learning systems. While theoretical bounds are often too loose to be useful and estimation methods frequently underestimate risk, this paper introduces Disagreement Discrepancy ($\text{DIS}^2$). By training a "critic" model to maximize disagreement on unlabeled target data while maintaining agreement on source data, $\text{DIS}^2$ provides a conservative yet non-vacuous upper bound on target error. Across 11 benchmarks, $\text{DIS}^2$ achieves nearly 99% coverage, offering a practical safety margin for real-world applications.

1. Introduction

When machine learning models transition from controlled training environments to the real world, they often encounter distribution shift—changes in data statistics that can significantly degrade performance. For safety-critical applications like autonomous driving or medical diagnosis, it is not enough to have a high-performing model; we must also have a reliable way to estimate its failure rate on new, unlabeled data.

Existing approaches to this problem generally fall into two categories. Theoretical bounds, often based on uniform convergence, provide rigorous mathematical guarantees but are typically "vacuous" in practice, offering bounds (e.g., error < 100%) that provide no actionable information. Conversely, estimation methods like Average Thresholded Confidence (ATC) offer accurate average-case predictions but are "pointwise untrustworthy." They often underestimate error for specific, challenging shifts, which can lead to catastrophic failures. This paper proposes $\text{DIS}^2$ to bridge this gap, providing a bound that is both useful and trustworthy.

2. The $\text{DIS}^2$ Framework

The core of the proposed method is the Disagreement Discrepancy ($\text{DIS}^2$). The approach is inspired by the classical $\mathcal{H}\Delta\mathcal{H}$-divergence but is adapted to provide bounds for specific, individual classifiers rather than entire hypothesis classes.

2.1 The Critic and the Objective

To bound the error of a primary classifier $h$, the method introduces a "critic" $h'$ selected from the same hypothesis class (for example, a linear layer operating on frozen features). The critic is trained with a dual objective:

  1. Agreement on Source: $h'$ should match the predictions of $h$ on the labeled source data.
  2. Disagreement on Target: $h'$ should deviate from the predictions of $h$ as much as possible on the unlabeled target data.

The target error is then bounded by the sum of the source error and the "disagreement discrepancy"—the difference in disagreement levels between the target and source datasets.

2.2 Disagreement Logistic Loss

Maximizing disagreement in multiclass settings is computationally challenging because standard loss functions (like negative cross-entropy) are often non-convex. The authors derive a novel disagreement logistic loss. This loss is theoretically justified, convex, and acts as an effective proxy for maximizing 0-1 disagreement, making the optimization of the critic robust and efficient.

2.3 Logit-Based Optimization

A key practical insight of the paper is the use of logits. Rather than using high-dimensional raw features, evaluating the bound using the model's output logits produces significantly tighter bounds. This refinement ensures the bound remains non-vacuous while maintaining its validity.

3. Experimental Evaluation

The authors evaluated $\text{DIS}^2$ across 11 diverse vision benchmarks, including subpopulation shifts (BREEDs), satellite imagery (FMoW), medical imaging (Camelyon17), and various synthetic corruptions (CIFAR-10/100-C).

3.1 High Coverage and Reliability

The primary metric for a safety bound is coverage—the frequency with which the predicted bound actually exceeds the true error. In non-adversarial settings, $\text{DIS}^2$ (using logits) achieved approximately 99% coverage. In comparison, baseline estimation methods like ATC and COT often saw coverage drop to between 18% and 30%, frequently underestimating the true risk.

3.2 Tightness and Robustness

Despite its conservative nature, $\text{DIS}^2$ remains competitive in terms of Mean Absolute Error (MAE) compared to state-of-the-art estimation methods. It remains valid even under extreme shifts where model accuracy drops by as much as 70%, providing a reliable "safety margin" where other methods fail.

4. Discussion and Limitations

The success of $\text{DIS}^2$ rests on the assumption that the true labeling function is "reasonably simple" relative to the feature space. Because deep learning features are optimized to make classification linearly separable, this assumption generally holds in practice.

4.1 The Validity Score

The authors identified a "validity score" based on the optimization trajectory of the critic. If the critic easily finds a way to disagree with the model, the bound is likely safe. A slow or non-monotonic optimization suggests the hypothesis class is too restricted, signaling that the bound might be becoming invalid.

4.2 Failure Modes

The method's main limitation occurs with domain-adversarial features (e.g., models trained with DANN or CDAN). These techniques explicitly force source and target features to be indistinguishable. This "hides" the distribution shift from the critic, causing $\text{DIS}^2$ to underestimate the error.

5. Conclusion

$\text{DIS}^2$ offers a significant step forward in the practical monitoring of machine learning models. By prioritizing coverage and utilizing a novel disagreement loss, it provides a trustworthy upper bound on error under distribution shift. Future work may involve using the "validity score" to automatically tune critic complexity, further tightening these (almost) provable bounds.

Summary updated

BibTeX
@inproceedings{rosenfeld2023almost,
  author = {Elan Rosenfeld and Saurabh Garg},
  title = {{(Almost) Provable Error Bounds Under Distribution Shift via Disagreement Discrepancy}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=9i8MD9btc8},
}
Figure