From Matrix Inversion to Constraints: Provably Tighter Confidence Regions for Importance Weights in Label Shift

Mushan Li, Kihyun Han, Yanyuan MaNeurIPS 2026

TL;DR

When deploying machine learning models into new environments where class proportions change ("label shift"), we rely on importance weights to recalibrate our predictions—but estimating these weights from small datasets introduces dangerous statistical noise. Instead of algebraically inverting noisy matrices, which wildly amplifies uncertainty, this paper reframes the problem using linear constraints and linear programming. The result is a provably tighter, exact finite-sample confidence region that keeps downstream tasks like uncertainty-aware prediction both safe and sharp.

What Problem Does This Paper Address?

Imagine training a medical diagnostic model in one hospital (source domain) and deploying it in another (target domain) where a certain disease is suddenly ten times more common, even though the symptoms look the same. This is label shift: the label distribution $p(y)$ changes to $q(y)$, while the conditional feature distribution $p(x|y)$ stays invariant.

To adapt our model without labeled target data, we estimate importance weights ($\omega_y = q(y)/p(y)$). Standard methods like Black-Box Shift Estimation (BBSE) find a point estimate $\widehat{\boldsymbol{\omega}}$ by solving a linear system $\mathbf{C}\boldsymbol{\omega} = \mathbf{q}$, where $\mathbf{C}$ is the classifier's source confusion matrix and $\mathbf{q}$ is the target predicted class distribution.

Here is the catch: with finite data, $\mathbf{C}$ and $\mathbf{q}$ are noisy. Plugging a noisy point estimate $\widehat{\boldsymbol{\omega}}$ into downstream tasks like weighted conformal prediction (which outputs a set of plausible labels guaranteed to contain the true label, say, 90% of the time) breaks the statistical guarantee, leading to systematic undercoverage.

Undercoverage in weighted conformal prediction when using point estimates of importance weights on small samples.

Prior finite-sample work tried to fix this by putting confidence intervals around every entry of $\mathbf{C}$ and $\mathbf{q}$ and running interval-based Gaussian Elimination (GE) to invert the system. However, doing row reductions on intervals causes severe "noise amplification," yielding massive, overly conservative confidence regions that make downstream prediction sets unusably wide.

Methods

The authors propose MaC-LP (Matrix Constraints Linear Programming), shifting the mindset from matrix inversion to matrix constraints.

  1. Standard Setup: Just like interval-BBSE, they start by computing standard binomial confidence intervals (e.g., Clopper-Pearson) for each element of the confusion matrix $[\underline{\mathbf{C}}, \overline{\mathbf{C}}]$ and target prediction vector $[\underline{\mathbf{q}}, \overline{\mathbf{q}}]$.
  2. Matrix Constraints (MaC): Rather than inverting $[\underline{\mathbf{C}}, \overline{\mathbf{C}}]$, they ask: which non-negative weight vectors $\boldsymbol{\omega}$ could plausibly satisfy $\mathbf{C}\boldsymbol{\omega} = \mathbf{q}$? They prove that this exact feasible set—which turns out to coincide with the classical Oettli-Prager theorem—can be written simply as a convex polytope of linear inequalities: $$\boldsymbol{\Omega} = \{ \boldsymbol{\omega} \ge \mathbf{0} : \overline{\mathbf{C}}\boldsymbol{\omega} \ge \underline{\mathbf{q}} \text{ and } \underline{\mathbf{C}}\boldsymbol{\omega} \le \overline{\mathbf{q}} \}$$
  3. Linear Programming (LP): If you want clean, class-by-class confidence intervals (a "squeezing box" $\boldsymbol{\Omega}_{\text{LP}}$ around the polytope $\boldsymbol{\Omega}$), you simply run $2K$ standard linear programs to minimize and maximize each $\omega_k$ subject to those linear constraints.
  4. Robust Conformal Prediction: To build finite-sample valid prediction sets in the target domain, they take the worst-case (supremum) conformal threshold over all $\boldsymbol{\omega}$ inside the confidence region.

Datasets

The authors evaluate MaC-LP across five existing datasets (no new benchmarks are introduced), simulating varying label shift intensities on the first four and testing real-world geographic adaptation on the fifth:

  • AGNews (text classification)
  • MNIST and CIFAR-10 (image classification)
  • N24News (multimodal text-and-image news classification)
  • nuImages (real-world autonomous driving images, adapting from Singapore as the source domain to Boston as the target domain)

Key Insights and Ideas

  • Algebraic inversion is a trap for intervals: Solving $\mathbf{C}^{-1}\mathbf{q}$ via interval Gaussian elimination treats coupled variables independently at each row-reduction step, ballooning the bounds. Leaving the system as linear inequalities ($\overline{\mathbf{C}}\boldsymbol{\omega} \ge \underline{\mathbf{q}}, \underline{\mathbf{C}}\boldsymbol{\omega} \le \overline{\mathbf{q}}$) completely avoids this relaxation, giving the exact smallest valid region given elementwise intervals ($\boldsymbol{\Omega} \subset \boldsymbol{\Omega}_{\text{LP}} \subset \boldsymbol{\Omega}_{\text{GE}}$).
  • Geometry matters—boxes waste space: Even the tightest axis-aligned box ($\boldsymbol{\Omega}_{\text{LP}}$) contains vast corners of "infeasible" weight combinations that violate the joint matrix structure. Using the raw polytope $\boldsymbol{\Omega}$ directly captures class dependencies and dramatically shrinks downstream prediction sets.
  • Confidence regions double as a shock absorber: On the real-world nuImages dataset (Singapore $\to$ Boston), the strict label shift assumption doesn't perfectly hold—even the "Oracle" true weights drop below the 90% coverage target. Yet $\boldsymbol{\Omega}$ and $\boldsymbol{\Omega}_{\text{LP}}$ still maintain $>90\%$ empirical coverage because the statistical confidence region inadvertently absorbs some of the domain-shift violation.

Key Results

  • Drastically tighter intervals: Across all benchmarks, $\boldsymbol{\Omega}_{\text{LP}}$ produces statistically significantly shorter intervals than Gaussian Elimination ($\boldsymbol{\Omega}_{\text{GE}}$). In synthetic scaling tests with $K \ge 200$ classes, the mean $\log_2$ length ratio of GE to LP reaches ~10.9—meaning GE intervals are over 1,900 times wider on average!
  • Tiny polytope volume: Monte Carlo volume estimation shows that the joint polytope $\boldsymbol{\Omega}$ occupies only a fraction of the bounding box $\boldsymbol{\Omega}_{\text{LP}}$, even under severe label shift.
Figure 2: N24News. (Left) Volcano plot of the interval length ratios (GE vs. LP) and their corresponding t-test significance levels. (Right) Volume ratio of Ωto ΩLP across varying shift intensities a and sample sizes.
  • Downstream conformal efficiency: Under extreme shifts on N24News, point-estimated BBSE fails its 90% nominal coverage guarantee. Meanwhile, MaC ($\boldsymbol{\Omega}$) consistently stays above 90% coverage while keeping average prediction set sizes hugging closely to the theoretical Oracle (~2 to 3.5 classes), whereas $\boldsymbol{\Omega}_{\text{LP}}$ and $\boldsymbol{\Omega}_{\text{GE}}$ inflate set sizes past 6.
  • Fast execution: Computing $\boldsymbol{\Omega}_{\text{LP}}$ takes just 0.046 seconds for $K=100$ classes and 1.72 seconds for $K=500$ classes.

Limitations and Future Work

  • Strict label shift assumption: All theoretical finite-sample guarantees rely on $p(x|y) = q(x|y)$ holding exactly.
  • Elementwise optimality: The optimality of $\boldsymbol{\Omega}$ is strictly relative to the independent, elementwise binomial intervals of $\mathbf{C}^*$ and $\mathbf{q}^*$. Incorporating joint multinomial or simplex constraints could shrink the region further, though doing so sacrifices convexity and simple linear constraints.
  • Monte Carlo approximation gap: While conformal thresholds over the hyperrectangles ($\boldsymbol{\Omega}_{\text{LP}}, \boldsymbol{\Omega}_{\text{GE}}$) are computed exactly, maximizing the threshold over the irregular polytope $\boldsymbol{\Omega}$ is approximated via 1,000 Monte Carlo samples. Because sampling can underestimate the true supremum, the empirical $\boldsymbol{\Omega}$ prediction sets do not formally inherit the exact finite-sample guarantee.
  • Future potential: Because $\boldsymbol{\Omega}$ is an explicit convex set requiring no point estimates, the authors note it can be plugged directly into broader domain adaptation pipelines (like robust empirical risk minimization) as a clean convex optimization problem.

Summary updated

Abstract

Importance weights are essential in domain adaptation under label shift, yet their utility is often undermined by the finite sample uncertainty associated with their estimation. Existing methods typically analyze this uncertainty through Gaussian elimination on interval-valued linear systems, which leads to overly conservative confidence regions and inefficient downstream applications. We propose a paradigm shift from inversion-based inference to a direct matrix constraint framework. We use this framework to define a joint confidence region and extract marginal intervals via linear programming, deriving provably tighter bounds for importance weights while maintaining exact finite-sample validity. Furthermore, we analyze the confidence region's geometry and provide the theoretical results for its diameter bounds. Evaluated across text, image, multimodal benchmarks, including AGNews, MNIST, CIFAR-10, N24News, and a real-world autonomous driving dataset, nuImages, our approach consistently yields shorter confidence intervals and smaller prediction sets than inversion-based methods.
BibTeX
@inproceedings{li2026from,
  author = {Mushan Li and Kihyun Han and Yanyuan Ma},
  title = {{From Matrix Inversion to Constraints: Provably Tighter Confidence Regions for Importance Weights in Label Shift}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=FA5NKoBbAJ},
}
Figure