Efficient Discrepancy Testing for Learning with Distribution Shift

Gautam Chandrasekaran, Adam Klivans, Vasilis Kontonis, Konstantinos Stavropoulos, Arsen Vasilyan

Abstract

Distribution shift remains a significant hurdle for deploying machine learning models in dynamic environments. Traditional methods for certifying model robustness rely on global discrepancy distance, a metric that is generally NP-hard to compute. This paper introduces a novel framework for Testable Learning with Distribution Shift (TDS) by shifting the focus from global distribution distance to "localized" discrepancy testing. By evaluating whether a specific hypothesis is reliable on a target distribution rather than searching the entire hypothesis space, the authors develop the first provably efficient algorithms for several fundamental concept classes. Key results include exponential speedups for constant-depth ($AC^0$) circuits and the first positive results for degree-2 polynomial threshold functions (PTFs) and low-dimensional convex sets.

Introduction

In practical machine learning, the assumption that training and test data are drawn from the same distribution is frequently violated. This "distribution shift" often leads to catastrophic model failure in production. Mathematically, generalization under shift is often bounded by the discrepancy distance between the source and target distributions. However, calculating this distance requires searching through every possible classifier in a class to find the maximum difference in behavior—a task proven to be NP-hard for most interesting classes.

This computational bottleneck leaves practitioners without a formal way to certify if a pre-trained model is safe for a new, potentially adversarial test set. This work addresses this gap by proposing a localized approach: instead of asking if two distributions are similar everywhere, we ask if they are similar enough for the specific model we intend to use.

Methodology: Localized Discrepancy and Sandwiching

The core innovation of this work is the concept of Localized Discrepancy. Rather than performing a global search, the proposed testers only examine a "neighborhood" around the specific hypothesis produced during training. This localization allows for significant computational savings while still providing rigorous safety guarantees.

Technical Foundations

The authors utilize several key technical components to achieve efficiency:

  • $L_1$ Sandwiching Polynomials: A major theoretical contribution is showing that if a function class can be "sandwiched" between two low-degree polynomials with small $L_1$ distance, efficient TDS learning is possible. This is a significantly weaker requirement than the $L_2$ conditions required by previous literature, broadening the scope of applicable models.
  • Chow Matching and Boundary Testing: For Boolean circuits, the algorithm employs a "Chow Matching" tester that compares low-degree moments (Chow parameters) between training and test data. For geometric concepts like intersections of halfspaces, a "Boundary Proximity" tester is used to ensure the test distribution does not place excessive mass near the model's decision boundaries.
  • Decoupled Learning and Testing: The framework separates the process into a computationally intensive training phase and a lightweight, fully polynomial-time testing phase. This allows users to verify large pre-trained models quickly on new data without the need for re-training.

Key Results and Performance

The localized approach yields several "first-of-their-kind" results in computational learning theory. Most notably, for constant-depth circuits ($AC^0$), the authors achieve an exponential improvement in runtime compared to the previous state-of-the-art.

Comparison of the proposed TDS algorithms against prior work for various concept classes.

As shown in the table above, the framework provides the first efficient algorithms for degree-2 PTFs and significantly reduces the complexity for circuits. Furthermore, in the agnostic setting—where the model may not be perfect even on training data—the algorithms achieve near-optimal error guarantees ($\lambda + \epsilon$), improving upon the constant-factor approximations found in earlier research.

Universality and Robustness

A surprising insight of this work is the "universality" of the proposed testers. Despite being designed for specific distributions like Gaussians or the uniform hypercube, the algorithms can handle "nasty" distributions (e.g., heavy-tailed or multimodal) provided they satisfy basic concentration and anti-concentration properties. This is achieved by exploiting structural guarantees, such as subspace recovery, during the training phase.

Discussion and Future Work

While this paper represents a breakthrough in testable learning, several challenges remain. Some geometric results, such as those for convex subspace juntas, are currently limited to the "realizable" setting where a perfect classifier exists. Additionally, the "universal" testers still rely on mild structural assumptions about the test distribution.

The ultimate goal remains extending these provable guarantees to modern neural network architectures like Transformers or deep ReLU networks. While $AC^0$ circuits are a significant step forward, bridging the gap to industrial-scale neural networks is the next frontier for localized discrepancy testing.

Summary updated

BibTeX
@inproceedings{chandrasekaran2024efficient,
  author = {Gautam Chandrasekaran and Adam Klivans and Vasilis Kontonis and Konstantinos Stavropoulos and Arsen Vasilyan},
  title = {{Efficient Discrepancy Testing for Learning with Distribution Shift}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=ojIhvhQBAQ},
}
Figure