Occupancy-based Quantile Risk Control

Zihao Shi, Huajun Xi, Bingyi Jing, Hongxin Wei

TL;DR

This paper introduces Occupancy-based Quantile Risk Control (OQRC), a novel framework that provides tight, distribution-free risk bounds with rigorous finite-sample guarantees for machine learning models. By reformulating risk control as a classical finite-occupancy problem, OQRC avoids the excessive conservatism of prior methods while maintaining exact validity. Extensive evaluations across computer vision and NLP tasks demonstrate that OQRC significantly narrows the gap between empirical and target risks, reducing this "RiskGap" by up to 78.64%.

What Problem Does This Paper Address?

When deploying machine learning models in high-stakes domains like medical diagnostics or autonomous driving, controlling prediction risk is paramount. Conformal Risk Control (CRC) provides a model-agnostic way to guarantee that the expected loss remains below a user-defined threshold. However, many real-world applications care about the tail of the loss distribution rather than just the average—demanding guarantees on quantile-based risk measures like Value-at-Risk (VaR) or Conditional Value-at-Risk (CVaR).

Quantile Risk Control (QRC) frameworks exist, but they suffer from a major trade-off: they are either overly conservative (overestimating risk and producing uninformative, bloated prediction sets) or they rely on asymptotic assumptions that completely lack guarantees in finite-sample regimes. This paper tackles the challenge of providing tight (non-conservative) risk control bounds with exact finite-sample validity.

Figure 2: Examples of quantile-based risk measures. The horizontal axis represents the quantile, and the vertical axis denotes the loss value. Expected loss, β-CVaR, and [βmin, βmax]-VaR-Interval indicate the average loss within the sky-blue region, while β-VaR indicates the loss at the β-quantile.

Methods

The core innovation of OQRC is mapping risk control onto a finite-occupancy problem. The method operates in three sequential steps:

  1. Partitioning: The loss space is divided into $n+1$ bins (intervals) using the ordered losses obtained from a calibration dataset.
  2. Sampling: The framework treats the unknown test losses as balls falling into these bins. Crucially, the authors prove that the joint distribution of these occupancy counts follows a discrete uniform distribution, completely independent of the underlying loss values. To handle large sample sizes efficiently, they introduce a Monte Carlo approach based on a stars-and-bars sampling construction.
  3. Computing: Within each bin, the risk is upper-bounded by assuming every test loss takes the maximum possible value within that interval. A parameter $\lambda$ is then calibrated so that this upper bound does not exceed the target risk level $\alpha$ with a high probability ($1-\delta$).
Figure 1: Overview of Occupancy-based Quantile Risk Control. Given a risk level α and confidence 1 −δ, our OQRC implements a sequential procedure that calibrates a parameter λ∗of the ML model such that the quantile risk Rtest satisfies P(Rtest(λ∗) ≤α) ≥1 −δ.

Theoretically, the authors prove that OQRC's risk control bounds converge asymptotically to the optimal bounds at a rate of $\mathcal{O}_p(n^{-1/2})$, establishing its tightness.

Datasets

The authors evaluated OQRC across seven real-world datasets spanning three distinct tasks:

  • Tumor Segmentation: Data pooled from five open-source gut polyp segmentation datasets: Kvasir, Hyper-Kvasir, CVC-ColonDB, CVC-ClinicDB, and ETIS-Larib.
  • Multi-label Image Classification: The MS COCO dataset (sampled to 2,000 data points).
  • Text Emotion Recognition: The Go Emotions dataset, consisting of Reddit comments annotated with 28 fine-grained emotion categories.

Key Insights and Ideas

  • Distribution-Free Uniformity: The most surprising theoretical insight is that the vector of test loss occupancy counts across calibration bins follows a discrete uniform distribution. Because this distribution depends solely on the number of calibration and test samples—and not the actual values of the losses—it provides an elegant, distribution-free foundation for exact finite-sample guarantees.
  • CRC as a Special Case: The authors demonstrate that standard Conformal Risk Control (CRC) is actually a special case of OQRC. When the test set size is set to $m=1$ and the risk measure is expected loss, OQRC perfectly recovers the standard CRC procedure.
  • Versatility: OQRC naturally extends to unconditional quantile risk control (controlling risk over the entire population rather than a finite test set) by taking the limit as the test set size $m \to \infty$, where the occupancy distribution transitions into a Dirichlet distribution.

Key Results

OQRC was compared against several baselines, including Order Statistics (OrderStats), truncated Berk-Jones (One-sided and Two-sided BJ), and conformal distortion risk control via L-statistics (CDRC-L).

  • Reduced Conservatism: OQRC consistently achieved the smallest RiskGap (the absolute difference between empirical and target risks) and AvgSize (prediction set size) while strictly maintaining the required coverage ($1-\delta$).
  • MS COCO Performance: Under the VaR-Interval measure on the MS COCO dataset, OQRC reduced the RiskGap by 78.64% and the average prediction set size by 38.80% compared to the Two-sided BJ baseline.
  • Model Agnostic & Robust: The method demonstrated consistent performance gains across diverse model architectures, including ResNet50, EfficientNet, TResNet, and ConvNeXt, confirming its robustness.

Limitations and Future Work

The primary limitation acknowledged by the authors is that OQRC is built on the standard exchangeability (i.i.d.) assumption between calibration and test data. In practical deployments, machine learning models frequently encounter distribution shifts. The authors note that extending OQRC to handle non-i.i.d. scenarios and distribution shifts remains an important direction for future work.

Summary updated

BibTeX
@inproceedings{shi2026occupancy,
  author = {Zihao Shi and Huajun Xi and Bingyi Jing and Hongxin Wei},
  title = {{Occupancy-based Quantile Risk Control}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=qOeSSrQgQq},
}
Figure