TL;DR
Conformal prediction helps quantify AI uncertainty by outputting sets of possible labels rather than a single guess. However, existing methods struggle with long-tailed datasets, producing either uselessly large prediction sets or sets that completely miss rare classes. This paper introduces two new approaches—a prevalence-adjusted score function and a threshold interpolation method—that smoothly trade off set size and coverage for rare classes. These methods ensure rare categories (like endangered plants) aren't ignored while keeping the prediction sets small enough for humans to practically use.
What Problem Does This Paper Address?
In high-stakes or highly ambiguous classification tasks, such as medical diagnosis or fine-grained plant identification, AI models shouldn't just output a single best guess. Instead, they should output a prediction set of likely candidates for a human expert to verify. Conformal Prediction (CP) is a popular mathematical framework for doing this because it provides guarantees that the true label will fall in the prediction set a specified percentage of the time (e.g., 90%).
However, real-world data is often long-tailed: a few classes have thousands of examples, while many rare classes have only a handful. In this setting, existing CP methods force a painful dilemma:
- Standard CP guarantees marginal coverage (overall 90% accuracy), but it achieves this by completely sacrificing rare classes. Rare classes might almost never appear in the prediction sets.
- Classwise CP guarantees class-conditional coverage (90% accuracy for every single class). But because rare classes have so little calibration data, the math forces the method to be ultra-conservative, outputting massive, unreadable prediction sets (e.g., hundreds of labels) for those rare items.
The authors tackle this gap by designing methods that provide a practical, tunable middle ground: small, user-friendly prediction sets that still maintain strong coverage for rare and important classes.
Methods
The authors propose two distinct approaches to navigate the trade-off between set size and class-conditional coverage:
- Prevalence-Adjusted Softmax (PAS): Instead of targeting marginal coverage (which inherently favors common classes), the authors target macro-coverage—the unweighted average of coverage across all classes. They mathematically prove that to optimally balance expected set size and macro-coverage, one should threshold based on the predicted probability divided by the class's prevalence. They implement this as a new conformal score function:
PAS = -p(y|x) / p(y). - Weighted PAS (WPAS): They also introduce a variant where users can explicitly assign higher weights to specific classes (e.g., endangered species) to prioritize their coverage.
- INTERP-Q: A simple but highly effective procedure that literally interpolates between the quantile thresholds of Standard CP and Classwise CP. By adjusting a parameter $\tau$ between 0 and 1, practitioners can smoothly slide along the trade-off curve between tight sets and strict class-conditional coverage.
(Note: The authors also discuss a Fuzzy Classwise CP method in the appendix, which groups classes based on similarity to "borrow" calibration data from common classes for rare ones.)
Datasets
The authors evaluate their methods on two massive, naturally long-tailed image datasets:
- Pl@ntNet-300K: 1,081 plant species.
- iNaturalist-2018: 8,142 species of plants and animals.
Note on evaluation: Because the standard test sets for these benchmarks are also long-tailed, it is statistically difficult to evaluate class-conditional metrics for rare classes. To fix this, the authors created truncated versions of both datasets, ensuring exactly 100 test examples per class to allow for robust evaluation.
Key Insights and Ideas
- Marginal coverage hides tail failures: A model can easily achieve 90% overall coverage by performing at 95% on common classes and 0% on rare classes. Shifting the optimization target to macro-coverage forces the algorithm to care about the tail.
- Dividing by prevalence is mathematically optimal: The PAS score isn't just a heuristic; it is derived from the Neyman-Pearson Lemma as the theoretical optimal solution for minimizing set size subject to a macro-coverage constraint.
- Threshold interpolation is non-linear in practice: Linearly interpolating the score thresholds (INTERP-Q) does not linearly interpolate the resulting set sizes. Because the softmax distributions for rare classes are highly skewed, backing off the Classwise CP threshold just a tiny bit drastically shrinks the prediction set size while preserving most of the coverage benefits.
Key Results
- Pareto Optimality: Standard CP with the PAS score function consistently proved Pareto optimal. For any given marginal coverage level, no other method simultaneously achieved a better combination of small set size and high macro-coverage.
- Drastic Set Size Reductions: On Pl@ntNet-300K (targeting 90% coverage), Classwise CP achieved great coverage but output an average of 780 items per set—useless for a human. Standard CP averaged 1.57 items, but 421 species had terrible coverage (<50%). Standard CP with PAS hit the sweet spot: an average set size of just 2.57 items, while slashing the number of poorly covered species from 421 down to 180.
- Protecting Endangered Species: Using the WPAS score, the authors upweighted the 33 "at-risk" species in the Pl@ntNet dataset. This significantly boosted the likelihood that an endangered plant's true label appeared in the prediction set, with almost zero negative impact on the coverage of common species and only a mild increase in overall set size.
Limitations and Future Work
- Parameter Tuning and Exchangeability: To use INTERP-Q, practitioners must choose the interpolation parameter $\tau$. If a user dynamically tunes $\tau$ on the calibration set to hit a specific target set size, it technically violates the "exchangeability" assumption required for strict conformal mathematical guarantees.
- Human Factors: The authors note that human decision-making with prediction sets is complex. Future work should explore the concept of "effort"—even if a conformal prediction set successfully contains the true label, a human might still fail to identify it if the set is too large to comfortably search through.
Summary updated