Conformal

Conformal Prediction is the statistical framework that produces prediction sets with guaranteed coverage probability — ensuring the true label is contained within the predicted set at least (1-α)% of the time — providing distribution-free, assumption-light uncertainty quantification that is valid under any data-generating process satisfying exchangeability.

What Is Conformal Prediction?

  • Definition: Rather than outputting a single class label or point estimate, conformal prediction outputs a prediction set C(x) such that P(Y ∈ C(x)) ≥ 1-α — guaranteed for any desired coverage level α (e.g., 95% coverage means α=0.05).
  • Key Innovation: The coverage guarantee is valid without assumptions about the model, the data distribution, or the relationship between features and labels — only exchangeability (weaker than i.i.d.) is required.
  • Output Format: "Given image x, the true class is in {Cat, Dog, Wolf} with 95% guaranteed probability."
  • Adaptive Sets: Small, confident prediction sets for clear inputs; larger sets for ambiguous inputs — the set size communicates uncertainty naturally.

Why Conformal Prediction Matters

  • Statistical Validity: Unlike Bayesian uncertainty or neural network softmax probabilities (which can be miscalibrated), conformal prediction provides hard mathematical guarantees on coverage — the 95% confidence interval contains the true value at least 95% of the time, verified empirically.
  • Model-Agnostic: Works as a post-processing wrapper on any trained model — random forests, neural networks, LLMs, or ensembles. No retraining required.
  • Safety-Critical Applications: Medical diagnosis ("The true diagnosis is one of: Appendicitis, Diverticulitis, or Ovarian Cyst — with 99% guaranteed coverage"), drug discovery, autonomous vehicle obstacle classification.
  • Interpretable Uncertainty: The size of the prediction set directly communicates the model's uncertainty — a singleton set means high confidence; a large set means genuine ambiguity that warrants human review.
  • Regulatory Compliance: Coverage guarantees align with regulatory requirements for reliable uncertainty communication in high-stakes AI systems.

How Conformal Prediction Works

Step 1 — Calibration:
- Split data into training set and calibration set (typically 10-20% of data).
- Train model on training set normally.
- Run calibration examples through model; compute nonconformity scores s_i = s(x_i, y_i).
- Nonconformity score measures how "unusual" the (input, true-label) pair is. Common choice: s(x, y) = 1 - f_y(x) where f_y(x) is the softmax probability assigned to true class y.

Step 2 — Quantile Computation:
- Compute the (1-α)(1 + 1/|calibration set|) quantile of calibration nonconformity scores.
- Call this threshold q̂.

Step 3 — Prediction Set Construction:
- For a new test point x, include class y in prediction set C(x) if s(x, y) ≤ q̂.
- C(x) = {y : s(x, y) ≤ q̂}.

Guarantee: P(Y_test ∈ C(X_test)) ≥ 1-α — a finite-sample, distribution-free guarantee.

Types of Conformal Prediction

VariantSettingKey Feature
Full Conformal PredictionAny regression/classificationExact coverage, computationally expensive
Split (Inductive) ConformalClassificationEfficient, single calibration pass
Cross-Conformal PredictionSmall datasetsK-fold calibration for efficiency
Adaptive ConformalTime series, distribution shiftAdjusts coverage online
Conformalized Quantile RegressionRegressionPrediction intervals with guaranteed coverage
RAPS (Regularized Adaptive)ClassificationSmaller prediction sets on average

Conformal Prediction for Regression

For regression, conformal prediction outputs intervals [ŷ - q̂, ŷ + q̂] rather than sets:
- Calibrate on residuals |ŷ_i - y_i| from a regression model.
- q̂ = (1-α) quantile of calibration residuals.
- Test prediction interval: [ŷ_test - q̂, ŷ_test + q̂] contains true y_test with probability ≥ 1-α.

Applications

  • Clinical AI: GenAI-powered diagnosis returns "possible diagnoses include [ICD codes] with 99% coverage" — clinician knows to investigate all listed possibilities.
  • Drug Discovery: Molecular property predictions with calibrated confidence intervals guide which candidate compounds to synthesize experimentally.
  • LLM Factuality: Recent work applies conformal prediction to language model outputs — generating sets of possible answers guaranteed to contain the correct answer with specified probability.
  • Anomaly Detection: A prediction set that equals the full label space (covering all classes) signals a potential anomaly — the model has no useful prediction.

Conformal prediction is the statistical framework that brings hard guarantees to AI uncertainty — unlike ad hoc confidence scores or Bayesian approximations, conformal prediction provides mathematically rigorous coverage guarantees that hold regardless of model architecture or data distribution, making it the principled choice for safety-critical applications requiring reliable uncertainty communication.

Take conformal further

Ask the copilot about this term, or have our engineers assess it against your process.