Abstract
We revisit the fundamental problem of learning with distribution shift, where a learner is given labeled samples from training distribution $D$ and unlabeled samples from test distribution $D'$ and must output a classifier with low test error. Traditional approaches bound loss using distance metrics between $D$ and $D'$ that are often computationally intractable. We introduce Testable Learning with Distribution Shift (TDS Learning), a model where algorithms can provably certify the performance of a classifier. In this model, a learner outputs a classifier with guaranteed low test error whenever samples from $D$ and $D'$ pass an associated test; the test must accept if the marginals are equal. We provide the first efficient algorithms for learning halfspaces, intersections of halfspaces, and decision trees under unknown distribution shifts by leveraging moment-matching and $L_2$-sandwiching polynomial approximators. Our results include lower bounds showing these guarantees are near-optimal and a separation showing TDS learning is incomparable to standard agnostic learning.
The Challenge of Distribution Shift
In real-world machine learning, models frequently encounter "distribution shift," where the data seen at test time ($D'$) differs from the training data ($D$). The classical theoretical approach uses distance metrics like "discrepancy distance" to bound error. However, these metrics are notoriously difficult to compute, often requiring exponential time even for simple models. Consequently, we lack efficient algorithms that can provide rigorous performance guarantees when test data deviates from training data.
The authors propose a "self-aware" learner that uses unlabeled test samples to decide if it can safely provide a high-accuracy prediction or if it should "REJECT" the task because the shift is too unpredictable to guarantee safety.
The TDS Learning Framework
The TDS Learning model requires two fundamental properties:
- Soundness: If the algorithm accepts and outputs a classifier, that classifier must have low error on the test distribution $D'$.
- Completeness: If there is no shift (i.e., the test distribution equals the training distribution), the algorithm must accept with high probability.
Technical Core: Moment Matching and $L_2$-Sandwiching
To achieve these guarantees, the authors employ several innovative technical strategies:
- Moment Matching: The algorithm estimates low-degree moments (means, variances, etc.) of the test distribution. If these do not match the training distribution's moments within a specific tolerance, the learner rejects. This ensures the distributions are "close enough" in the ways that matter for the specific function class.
- $L_2$-Sandwiching Polynomials: A core innovation is showing that function classes like decision trees can be "sandwiched" between two low-degree polynomials. By using $L_2$ error instead of the standard $L_1$ error, the authors apply a "transfer lemma" to relate training loss to test loss. Since the square of a low-degree polynomial remains a low-degree polynomial, $L_2$ approximations allow for more robust error transfer.
- Disagreement Region Method: For halfspaces in the realizable case, the authors combine moment-matching with active learning techniques to identify "uncertainty regions." By ensuring the test distribution does not place excessive mass in these regions, they can guarantee accuracy even under significant shift.
Key Results
The paper provides a suite of new, efficient algorithms for several important function classes, including halfspaces and decision trees. Notably, the algorithm for general halfspaces runs in quasi-polynomial time, a significant improvement over previous exponential-time approaches.
These results cover both the realizable setting (where a perfect classifier exists for both distributions) and the agnostic setting (where the learner competes with the best possible joint error). The authors also provide lower bounds demonstrating that the dependence on error parameters in their agnostic results is essentially unavoidable.
Discussion and Future Work
While TDS learning provides a powerful framework for reliability, it currently requires the training marginals to be "well-behaved" distributions (like Gaussian or Uniform). A fully distribution-free version of TDS learning remains an open challenge. Additionally, while the quasi-polynomial run-times are a major theoretical breakthrough, further optimization is needed to bring these techniques to high-dimensional real-world applications. This work marks a significant shift from measuring distribution distance to certifying model compatibility, paving the way for more reliable machine learning systems.
Summary updated