Conformal Structured Prediction

Botong Zhang, Shuo Li, Osbert Bastani

Deep learning models are notoriously overconfident, often presenting incorrect predictions with high certainty. Conformal Prediction (CP) has emerged as a popular statistical tool to address this: instead of outputting a single guess, a conformal predictor outputs a set of possible answers that is mathematically guaranteed to contain the true answer with a user-specified high probability (e.g., 95%).

However, standard CP faces a major usability hurdle in complex domains. If you ask a model to identify a bird in an image, standard CP might output a list of 50 specific sub-species of sparrows to satisfy the 95% confidence requirement. While technically "correct," this massive list is practically useless for a human user.

In the paper Conformal Structured Prediction, researchers introduce a general framework that shifts the focus from generating exhaustive "sets of labels" to producing "interpretable structures" that implicitly represent those labels.

Example and Overview of Conformal Structured Prediction

The Challenge of Structured Settings

Traditional conformal prediction algorithms rely heavily on a property called monotonicity—the idea that as you demand higher confidence, your prediction set simply grows larger by adding more individual labels.

In structured settings, this mathematical property often breaks down. For example, if a model is unsure whether an image shows a "balance beam," a "horizontal bar," or "parallel bars," a structured approach might prefer to output the single, broader category "gymnastic apparatus." Because switching from three specific labels to one broad label isn't a strictly "monotonic" increase in set size, standard CP tools cannot be directly applied without losing their mathematical guarantees.

A Framework for Structured Uncertainty

To solve this, the authors propose a novel framework that combines graph theory, optimization, and rigorous statistical testing:

  1. DAG-Based Representation: The label space is modeled as a Directed Acyclic Graph (DAG). In a hierarchical classification task, internal nodes represent coarse labels (e.g., "mammal," "gymnastic apparatus"), while leaf nodes represent fine-grained labels (e.g., "beagle," "balance beam"). A single coarse node can implicitly represent hundreds of specific leaf labels, acting as a form of "compression" that makes uncertainty digestible.
  2. Integer Programming (IP): To find the optimal structured set for a given confidence level, the system formulates the search as an optimization problem. Using Integer Programming, the goal is to minimize the number of leaf nodes covered while staying within a user-defined budget of interpretable nodes.
  3. Statistical Testing for Guarantees: Because the structured prediction space lacks monotonicity, the authors adapt the "Learn-Then-Test" framework. The algorithm sequentially tests candidate thresholds using a calibration dataset, stopping as soon as a threshold fails a statistical validity test. This bypasses the need for monotonicity while preserving rigorous coverage guarantees.
  4. Flexible Coverage: The framework supports both Marginal Coverage (average performance over many samples) and PAC (Probably Approximately Correct) Coverage (high-probability performance for a specific model instance).

Experimental Validation

The researchers evaluated their approach across five diverse domains, proving its versatility:

  • ImageNet: Hierarchical image classification using the WordNet taxonomy.
  • SQuAD: Question answering where answers are years (represented as unions of intervals).
  • MBPP (Mostly Basic Python Problems): Code generation where the "structure" is a partial program with "holes" representing uncertainty.
  • MNIST Digits: Predicting multi-digit numbers as ranges.
  • GoEmotions: Text emotion classification using a hierarchical taxonomy of feelings.

Key Results

  • Guaranteed Reliability: In all experiments, the empirical coverage successfully stayed above the user-defined thresholds (e.g., 90% or 95%).
  • Superior Efficiency: Compared to existing baselines, the proposed method produced significantly smaller and more precise prediction sets. For instance, in the SQuAD question-answering task, it successfully summarized a wide range of possible years into a single, concise interval.
  • Qualitative Clarity: The interpretability gains were substantial. In ImageNet trials, instead of listing 15 different types of terriers, the model simply output "Dog" and "Artifact," perfectly capturing the ambiguity of an image containing a dog near a man-made object.

Limitations and Future Directions

While powerful, the framework does have limitations. Primarily, it requires a predefined DAG or hierarchy (like WordNet). If the structure of the label space is unknown or poorly defined, the method is difficult to apply. Additionally, the Integer Programming approach can face computational scaling issues; it slowed down significantly on dense graphs like the "3-digit MNIST" task, requiring DAG simplification as a workaround.

Future work will likely explore ways to automatically learn the optimal DAG structure directly from data, removing the reliance on human-provided hierarchies and further automating the generation of interpretable uncertainty.

Summary updated

BibTeX
@inproceedings{zhang2025conformal,
  author = {Botong Zhang and Shuo Li and Osbert Bastani},
  title = {{Conformal Structured Prediction}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=2ATD8a8P3C},
}
Figure