Reliable Learning for Test-time Attacks and Distribution Shift

Maria-Florina Balcan, Steve Hanneke, Rattana Pukdee, Dravyansh Sharma

Abstract

The problem of designing learners that provide guarantees that their predictions are provably correct is of increasing importance in machine learning. However, learning theoretic guarantees have only been considered in very specific settings. In this work, we consider the design and analysis of reliable learners in challenging test-time environments as encountered in modern machine learning problems: namely 'adversarial' test-time attacks (in several variations) and 'natural' distribution shifts. In this work, we provide a reliable learner with provably optimal guarantees in such settings. We discuss computationally feasible implementations of the learner and further show that our algorithm achieves strong positive performance guarantees on several natural examples: for example, linear separators under log-concave distributions or smooth boundary classifiers under smooth probability distributions.

Introduction

Standard machine learning typically assumes that training and test data come from the same distribution (the i.i.d. assumption). In real-world applications, this assumption often fails due to adversarial attacks—where malicious actors perturb test points to flip predictions—or natural distribution shifts, such as a model trained in one climate encountering another. While most research focuses on maintaining high average accuracy, this paper addresses a more fundamental question: Can a model know when to trust its own specific prediction?

The authors introduce "robustly-reliable learners" that provide a pointwise reliability radius, guaranteeing correctness unless an adversary exceeds a specific perturbation budget. This framework bridges the gap between existing reliable learning theory and the hostile or shifting environments encountered in modern machine learning.

Methodology: Robustly-Reliable Learning

The core contribution is the definition of a robustly-reliable learner. Instead of outputting only a label $y$, the learner provides a label and a reliability radius $\eta$. The guarantee states: "This prediction is correct unless the test point was moved by a distance of at least $\eta$."

Version Space and Agreement Regions

The reliability of a point is determined by the "agreement region"—the set of points where every hypothesis consistent with the training data (the version space) agrees on the label.

Figure 4: Visualization of the agreement region and reliability radius across different test points. Shaded areas represent regions where the model provides a guaranteed prediction.

Key methodological components include:

  • Safely-Reliable Region: A new concept describing the portion of the input space where a model remains reliable even after an adversary attempts to "push" a data point toward a region of uncertainty.
  • $\mathcal{P} \to \mathcal{Q}$ Disagreement Coefficient: A novel complexity measure that quantifies how well reliability guarantees transfer from a source distribution ($\mathcal{P}$) to a target distribution ($\mathcal{Q}$).
  • Computational Implementation: For linear separators, the optimal reliability radius can be calculated efficiently using a constrained quadratic program to find the distance to the nearest point in the disagreement region.

Theoretical Results and Evaluation

The framework was evaluated using mathematical data distributions and concept classes common in learning theory, such as linear separators and classifiers with "smooth boundaries" under isotropic log-concave and $s$-concave distributions.

Key Results

  • Pointwise Optimality: The proposed learner is proven to be "pointwise optimal," meaning no other reliable learner can provide a larger reliability radius for any given point.
  • High Probability Reliability: For linear separators under log-concave distributions, the "safely-reliable region" covers most of the distribution's mass. The probability of a point being safely reliable is at least $1 - 2\eta_1 - \tilde{O}(\sqrt{d\epsilon})$.
  • Agnostic Extension: The theory extends from the "realizable" case (where a perfect classifier exists) to the "agnostic" case (where the model is only mostly correct on training data), though guarantees are naturally weaker.

Insights into Uncertainty and Transfer

A truly reliable model must be able to abstain from predicting when uncertainty is too high. The paper characterizes the optimal way to abstain to maximize "useful" (guaranteed) predictions.

Figure 6: Geometric representation of disagreement regions and their behavior under distribution shifts. The dashed lines illustrate how margins and shifts affect the transfer of reliability guarantees.

One surprising insight is that reliability transfers better than accuracy. The authors show that reliability guarantees can transfer even between distributions with disjoint supports, provided the geometry of the disagreement region is well-behaved. For linear models, reliability is not just about distance from the decision boundary, but distance from any boundary that could have been drawn given the training data.

Limitations and Future Outlook

While the theoretical foundations are robust, several challenges remain for practical application:

  • Scalability: The quadratic programming approach for linear separators does not easily scale to deep neural networks, where the version space is non-convex and complex.
  • Realizability: Much of the tightest theory assumes the true target function lies within the hypothesis class.
  • Unified Robust Losses: Developing a single, efficient algorithm for arbitrary robust loss functions (e.g., incentive-aware or stability losses) remains an open problem.

Summary updated

BibTeX
@inproceedings{balcan2023reliable,
  author = {Maria-Florina Balcan and Steve Hanneke and Rattana Pukdee and Dravyansh Sharma},
  title = {{Reliable Learning for Test-time Attacks and Distribution Shift}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=1h7Uh9zUXc},
}
Figure