Post

Conformal triage: what a coverage guarantee buys, and what it hides

Conformal triage: what a coverage guarantee buys, and what it hides

The question that starts this A scoring model puts a case at 0.06 probability of an adverse event, and operations asks whether it can clear the case without a human. “The model is 92% accurate” is not an answer. The answer is a cutoff plus a statement about how often that cutoff is wrong, and the statement has to survive a change in the population arriving at the door.

Conformal prediction is the cheapest way to produce that statement. It wraps any model, needs one labelled calibration set, and delivers a finite-sample guarantee with no assumption about the model or the data distribution. It is also easy to misread, because the guarantee is marginal: it can hold exactly while the errors that matter concentrate in a single class.

This post builds the mechanism, then reproduces the failure. On a 10% mistake budget, a pooled calibration released 25.6% of true events without review, while marginal coverage read 0.895 at matched prevalence and 0.848 at 45% prevalence. A dashboard showing only the second number looks healthy.

What split conformal promises

Split conformal reduces the whole apparatus to three steps. Pick a score that is high when the model is wrong. For a classifier, the standard choice is one minus the probability the model assigned to the true label:

\[s_i = 1 - \hat{f}(X_i)_{Y_i}\]

Take the $\lceil (n+1)(1-\alpha) \rceil / n$ empirical quantile of the calibration scores and call it $\hat{q}$. Then build a set from every label whose score falls under it:

\[\mathcal{C}(X_{\text{test}}) = \{\, y : s(X_{\text{test}}, y) \le \hat{q} \,\}\]

The guarantee is a two-sided band rather than a floor:

\[1-\alpha \;\le\; \mathbb{P}\big(Y_{\text{test}} \in \mathcal{C}(X_{\text{test}})\big) \;\le\; 1-\alpha+\frac{1}{n+1}\]

Three things about that expression are worth pausing on. The upper bound is what makes it exact rather than conservative: the coverage cannot drift far above nominal either, so a method that games coverage by returning every label is ruled out. The $\frac{1}{n+1}$ is the entire finite-sample price, and it is why 450 calibration labels give you quantile steps of roughly 0.002. And the probability is over the draw of calibration points and the test point together, which is the seed of the problem in the next section.

What it does not require matters just as much. There is no assumption that the model is any good, no assumption about the shape of the score distribution, and no asymptotic argument. A logistic regression from 2019 and a frontier model get the same guarantee. What it does require is exchangeability: the calibration cases and the deployment cases must be draws from the same distribution, in any order.

The set is also adaptive in a useful way. When the model is unsure the set grows; when it is confident the set is a singleton. That is a workload signal hiding inside a statistical object, and later we will read it as one.

The score function is a design choice rather than part of the guarantee. The threshold score used here, one minus the probability assigned to the true label, usually produces the smallest average sets for a classifier; adaptive alternatives reweight toward the top-scoring classes and can shrink the set on ambiguous cases, at the cost of more computation and slightly larger sets on average. The guarantee survives either choice, so treat it as a workload decision: pick the score that leaves your reviewers the smaller pile.

The guarantee is about the average, not your run

The code below fits a four-class model, then repeats the calibration 100 times on different random splits of the same pool. Every split uses 800 calibration cases and 2,000 test cases, so the only thing changing is which cases landed where.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import numpy as np
from sklearn.datasets import make_classification
from sklearn.linear_model import LogisticRegression

X, y = make_classification(n_samples=8000, n_features=12, n_informative=6,
                           n_classes=4, n_clusters_per_class=1,
                           class_sep=0.9, flip_y=0.02, random_state=11)
model = LogisticRegression(max_iter=5000).fit(X[:3000], y[:3000])
pool_X, pool_y = X[3000:], y[3000:]
rng = np.random.default_rng(11)


def build_sets(alpha, cal_idx, test_idx):
    p_cal = model.predict_proba(pool_X[cal_idx])
    scores = 1.0 - p_cal[np.arange(len(cal_idx)), pool_y[cal_idx]]
    n = scores.size
    q_level = np.ceil((n + 1) * (1 - alpha)) / n
    qhat = np.quantile(scores, q_level, method="higher")
    p_test = model.predict_proba(pool_X[test_idx])
    return p_test >= 1 - qhat, qhat


print(f"{'alpha':>6} {'nominal':>8} {'mean_cov':>9} {'min_cov':>8} "
      f"{'max_cov':>8} {'mean_size':>9} {'min_class':>9} {'max_class':>9}")
for alpha in (0.05, 0.10, 0.20):
    covs, sizes, class_cov = [], [], []
    for _ in range(100):
        idx = rng.permutation(len(pool_y))
        cal, test = idx[:800], idx[800:2800]
        sets, _ = build_sets(alpha, cal, test)
        hit = sets[np.arange(len(test)), pool_y[test]]
        covs.append(hit.mean())
        sizes.append(sets.sum(axis=1).mean())
        class_cov.append([hit[pool_y[test] == k].mean() for k in range(4)])
    cc = np.array(class_cov).mean(axis=0)
    print(f"{alpha:>6.2f} {1 - alpha:>8.2f} {np.mean(covs):>9.3f} {np.min(covs):>8.3f} "
          f"{np.max(covs):>8.3f} {np.mean(sizes):>9.2f} {cc.min():>9.3f} {cc.max():>9.3f}")
1
2
3
4
alpha  nominal  mean_cov  min_cov  max_cov mean_size min_class max_class
  0.05     0.95     0.953    0.931    0.969      1.81     0.941     0.963
  0.10     0.90     0.903    0.861    0.930      1.44     0.886     0.931
  0.20     0.80     0.804    0.765    0.852      1.09     0.772     0.862

The means are almost exactly nominal: 0.953, 0.903, 0.804. That is the theorem working. The spreads are the operating reality. At a nominal 90%, one calibration draw delivered 0.861 coverage and another delivered 0.930. You deploy one draw, and nothing tells you which one you got until you have labelled outcomes from the deployment itself.

Two consequences follow. Report the band you observed across calibration draws rather than a single number, because a single number is a promise the setup cannot make. And size the calibration set for the variance you can tolerate, since the spread narrows like $1/\sqrt{n}$ while the exactness term narrows like $1/n$.

The last two columns are the thread to pull. At $\alpha = 0.10$ the marginal coverage is 0.903, but per-class coverage runs from 0.886 to 0.931. The average is honest and the parts are not, which is the whole problem once classes stop being equally important to you.

For completeness, a single held-out run of the same recipe gives a calibration quantile of 0.788317, a score cutoff of 0.211683, coverage 0.897, a mean set size of 1.41, and 62% singletons. No empty sets and no full sets appeared, so the method is not silently abstaining on everything.

From sets to a release decision

The set answers “which labels are plausible”. Operations asks a different question: “may I clear this case without a human”. The first is a statistical object; the second is a rule with a cost attached, and the cost is asymmetric. Clearing a case that turns out to be an event is expensive; sending a clean case for review only costs capacity.

Conformal risk control handles that directly by controlling the expected value of any monotone loss rather than the coverage of a set. Write the release rule as “clear the case when the score is at or below $\lambda$”. The loss $\ell(\lambda)$ is the share of true events cleared, which rises with $\lambda$, so it is monotone and the machinery applies. The threshold is the largest one that satisfies a finite-sample version of the budget:

\[\hat{\lambda} = \inf\left\{ \lambda : \hat{R}_n(\lambda) \le \alpha - \frac{1-\alpha}{n} \right\}\]

with the guarantee $\mathbb{E}[\ell(\hat{\lambda})] \le \alpha$. Note what the correction does: it subtracts the slack you would otherwise spend on a lucky calibration set, so a 5% budget is met on average rather than on a good day.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import numpy as np
from sklearn.datasets import make_classification
from sklearn.linear_model import LogisticRegression

X, y = make_classification(n_samples=30000, n_features=12, n_informative=8,
                           class_sep=1.8, weights=[0.88, 0.12], flip_y=0.01,
                           random_state=3)
model = LogisticRegression(max_iter=3000).fit(X[:10000], y[:10000])
pool_X, pool_y = X[10000:], y[10000:]
scores = model.predict_proba(pool_X)[:, 1]  # P(event)


def crc_threshold(s, labels, alpha):
    """Highest cutoff whose empirical miss rate still meets the finite-sample bound.

    Release rule: case is auto-released when score <= cutoff. Loss = share of true
    events released. Loss is monotone in the cutoff, which is what CRC needs.
    """
    order = np.argsort(s)  # ascending: least likely event first
    s_sorted, lab = s[order], labels[order]
    n = s_sorted.size
    fnr = np.cumsum(lab) / lab.sum()
    bound = alpha - (1 - alpha) / n
    ok = np.flatnonzero(fnr <= bound)
    k = ok.max() if ok.size else -1
    return s_sorted[k] if k >= 0 else -np.inf


print(f"{'alpha':>5} {'avg_FNR':>8} {'p95_FNR':>8} {'max_FNR':>8} "
      f"{'over_alpha':>10} {'auto_release':>12}")
for alpha in (0.02, 0.05, 0.10, 0.20):
    fnrs, shares = [], []
    for i in range(200):
        idx = np.random.default_rng(i + 5).permutation(len(pool_y))
        cal, test = idx[:4000], idx[4000:14000]
        lam = crc_threshold(scores[cal], pool_y[cal], alpha)
        rel = scores[test] <= lam
        ev = pool_y[test] == 1
        fnrs.append(rel[ev].mean())
        shares.append(rel.mean())
    fnrs, shares = np.array(fnrs), np.array(shares)
    print(f"{alpha:>5.2f} {fnrs.mean():>8.4f} {np.quantile(fnrs, 0.95):>8.4f} "
          f"{fnrs.max():>8.4f} {(fnrs > alpha).mean():>10.3f} "
          f"{shares.mean():>11.3f}")

idx = np.random.default_rng(5).permutation(len(pool_y))
test_ev = pool_y[idx[4000:14000]] == 1
test_s = scores[idx[4000:14000]]
for vol in (0.90, 0.95):
    cut = np.quantile(test_s, vol)
    print(f"naive 'clear the {vol:.0%} lowest scores': "
          f"FNR={(test_s[test_ev] <= cut).mean():.4f}")
1
2
3
4
5
6
7
alpha  avg_FNR  p95_FNR  max_FNR over_alpha auto_release
 0.02   0.0207   0.0357   0.0418      0.470       0.458
 0.05   0.0503   0.0720   0.0808      0.465       0.760
 0.10   0.1013   0.1278   0.1380      0.535       0.855
 0.20   0.1988   0.2372   0.2637      0.485       0.894
naive 'clear the 90% lowest scores': FNR=0.2249
naive 'clear the 95% lowest scores': FNR=0.5953

Read the alpha column against auto_release as a menu. A 2% mistake budget pays for clearing 45.8% of the queue. A 10% budget pays for 85.5%. The last 10 points of budget, from 10% to 20%, buy only 4 more points of volume, which tells you where the model stops being informative: past that point you are releasing cases the model cannot separate.

The over_alpha column is the part most write-ups omit. Between 46% and 54% of individual deployments land above the budget even though the average sits just underneath. That is not a defect in the implementation; it is what an expectation-level guarantee means when you run it once. A single site running a single re-calibration has roughly a coin flip of exceeding the number its risk owner signed off on.

Now the trap. Clearing the lowest-scoring 90% of cases is a decision an operations team makes all the time, usually because it matches the review capacity they have. That rule runs at a 22.49% miss rate on the test set: more than double the 10% budget, and it looks like a policy choice rather than a risk decision. At 95% volume it reaches 59.53%. A volume target is a risk target with the number hidden.

The fix is procedural, not statistical. Derive the cutoff from the budget, then report the volume that falls out. When the volume is unacceptable, the conversation is about the model or the review staffing, not about quietly moving the cutoff.

The same reasoning applies to an operating point inherited from a vendor. It was calibrated on their population at their prevalence, so transplanted into a queue with a different mix it keeps its precision and loses its meaning: the cutoff travels, the loss does not. Ask for the description of the calibration set rather than the operating point on its own, then re-derive the threshold on your own labels.

Pooled calibration hides the class you care about

The calibration quantile is a single number for all cases, so it is set by whichever class dominates the calibration sample. When one class is 85% of the traffic, its score distribution places the quantile, and the minority class inherits a threshold chosen for someone else.

Reproduce it with a pilot at 15% prevalence and a deployment population that drifts to 30% and 45%. The model and the class-conditional score distributions stay fixed, so the only thing moving is the mix: exactly the prevalence shift that an audit should catch.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import numpy as np
from sklearn.datasets import make_classification
from sklearn.linear_model import LogisticRegression

ALPHA = 0.10  # nominal miscoverage of the conformal set

X, y = make_classification(n_samples=60000, n_features=12, n_informative=8,
                           class_sep=1.6, weights=[0.85, 0.15], flip_y=0.01,
                           random_state=9)
model = LogisticRegression(max_iter=3000).fit(X[:20000], y[:20000])
pool_X, pool_y = X[20000:], y[20000:]
p1 = model.predict_proba(pool_X)[:, 1]
pos, neg = np.flatnonzero(pool_y == 1), np.flatnonzero(pool_y == 0)


def draw(prevalence, n, rng):
    n_pos = int(round(prevalence * n))
    idx = np.concatenate([rng.choice(pos, n_pos, replace=False),
                          rng.choice(neg, n - n_pos, replace=False)])
    return p1[idx], pool_y[idx]


def qhat_from(scores, alpha):
    level = np.ceil((scores.size + 1) * (1 - alpha)) / scores.size
    return np.quantile(scores, level, method="higher")


rng = np.random.default_rng(21)
pilot_p, pilot_y = draw(0.15, 3000, rng)
# score of the true label: high means the model was wrong about this case
pilot_s = 1.0 - np.where(pilot_y == 1, pilot_p, 1.0 - pilot_p)

q_pooled = qhat_from(pilot_s, ALPHA)
q_event = qhat_from(pilot_s[pilot_y == 1], ALPHA)
q_neg = qhat_from(pilot_s[pilot_y == 0], ALPHA)
print(f"pilot prev=0.15 n=3000 events={int((pilot_y==1).sum())} | "
      f"pooled={q_pooled:.4f} event={q_event:.4f} non_event={q_neg:.4f}")
print(f"classwise resolution on event labels: 1/(n_events+1) = "
      f"{1/((pilot_y==1).sum()+1):.5f}")

print(f"\n{'prev':>5} {'method':>10} {'marg_cov':>9} {'event_in_set':>13} "
      f"{'FNR':>7} {'review_rate':>12}")
for prev in (0.15, 0.30, 0.45):
    dep_p, dep_y = draw(prev, 8000, rng)
    ev = dep_y == 1
    s_event_class = 1.0 - dep_p          # nonconformity score for label 1
    s_neg_class = dep_p                  # nonconformity score for label 0
    for name in ("pooled", "classwise"):
        lim_event = q_pooled if name == "pooled" else q_event
        lim_neg = q_pooled if name == "pooled" else q_neg
        event_in = s_event_class <= lim_event
        neg_in = s_neg_class <= lim_neg
        marg = np.where(ev, event_in, neg_in).mean()
        print(f"{prev:>5.2f} {name:>10} {marg:>9.3f} {event_in[ev].mean():>13.3f} "
              f"{1 - event_in[ev].mean():>7.3f} {event_in.mean():>12.3f}")
1
2
3
4
5
6
7
8
9
10
pilot prev=0.15 n=3000 events=450 | pooled=0.0426 event=0.2461 non_event=0.0313
classwise resolution on event labels: 1/(n_events+1) = 0.00222

 prev     method  marg_cov  event_in_set     FNR  review_rate
 0.15     pooled     0.895         0.744   0.256        0.113
 0.15  classwise     0.895         0.866   0.134        0.132
 0.30     pooled     0.867         0.743   0.257        0.224
 0.30  classwise     0.890         0.873   0.127        0.264
 0.45     pooled     0.848         0.757   0.243        0.341
 0.45  classwise     0.892         0.884   0.116        0.399

The three calibration quantiles explain the whole table. Pooled is 0.0426 and the event-class quantile is 0.2461, nearly six times larger, because 85% of the pilot’s cases were non-events and their scores placed the quantile. The event class then gets compared against a cutoff that almost none of its cases reach.

In the pooled rows, marginal coverage decays gently from 0.895 to 0.848 as prevalence rises, which reads as “roughly 90%” to anyone checking a dashboard. Underneath, event coverage sits at 0.744, 0.743 and 0.757: between a quarter and a third of true events are cleared without review, at every prevalence. It does not get better as prevalence rises because the threshold, not the mix, is the problem.

The classwise rows calibrate a separate quantile per class, which is the Mondrian construction. Event coverage recovers to 0.866, 0.873 and 0.884, and marginal coverage holds at 0.890 to 0.892. The cost is visible in the last column: review volume rises from 0.113 to 0.132 at 15% prevalence, from 0.224 to 0.264 at 30%, and from 0.341 to 0.399 at 45%. Fixing the class you care about costs two to six points of review capacity, and that is the honest price of the guarantee you thought you had.

There is a scarcity limit worth stating. With 450 event labels the classwise tail quantile has resolution 1/451, about 0.0022, which is comfortable. At 120 event labels the same quantile is much noisier, and the correct conclusion is that the pilot cannot yet certify a low-review regime. Calibration data is the binding constraint on this method, not compute.

Two recent deployment studies converge on the same gap. A May 2026 audit of conformal triage in a retrospective NSCLC pilot, where the target event prevalence was about 23%, found the pooled threshold dominated by non-event patients and showed that prevalence correction could move the release boundary while marginal coverage stayed put, releasing event-positive patients without review. A February 2026 Scientific Reports study of early sepsis prediction documents the constructive side: selective deferral cut error on retained cases by 49.6% in-distribution and 46.7% out-of-distribution at 80% coverage, while a Mondrian variant narrowed a sex-stratified coverage gap to 1.4 percentage points.

How to apply it

DecisionWhat to fix firstWhat to measure
Which population is “calibration”Match the deployment mix of cases, not the training mixPrevalence and score histogram drift between the two
Whose errors are expensiveName the class or group explicitly, then calibrate it classwisePer-class coverage next to marginal coverage, never marginal alone
What the budget isA written number from the risk owner, in loss unitsRealised loss per period against that number
Whether the labels sufficeCount event labels, not total labelsQuantile resolution 1/(n+1), and the event-labelled subset
When to recalibrateOn a mix trigger, not a calendar dateScore distribution shift, prevalence shift, model version change
What to logThreshold, budget, set size and review volume per batchRealised loss, review volume, and the gap between the two

Two further habits are worth building in. Log set size as a workload forecast, because mean set size tracks review volume closely enough to staff against, and a sudden widening is an early warning that the model has met cases it does not recognise. And treat the budget as a decision that belongs to whoever owns the risk, not to whoever owns the queue. The statistical machinery will happily produce a defensible threshold for any budget you name, which is precisely why the budget should not be named by the same team that is measured on throughput.

For genuinely changing populations, adaptive conformal inference replaces the fixed $\alpha$ with a running estimate updated by observed errors, $\alpha_{t+1} = \alpha_t + \gamma(\alpha - \text{err}_t)$, and provably achieves the target coverage frequency over long horizons regardless of the data-generating process. The price is a timely outcome stream. In a setting where the adverse event is observed after 30 days, adaptation lags by 30 days, and that lag belongs in the risk case rather than in a footnote.

Key takeaways

QuestionAnswer
What does conformal actually guarantee?Marginal coverage in a band, $1-\alpha$ to $1-\alpha + \frac{1}{n+1}$, for any model and any distribution, given exchangeable calibration and deployment data
What does it not guarantee?Coverage for the class or group you care about, or for any single deployment draw
How do I turn it into a release rule?Conformal risk control on a monotone loss: the expected share of events released stays at or under the budget
What is the commonest failure?A pooled quantile set by the majority class, which leaves the minority class with a threshold chosen for someone else
What does the fix cost?Review volume, two to six points in the run above, plus enough event labels for a stable tail quantile
What should never set the threshold?Queue capacity. A 90%-volume target ran at a 22.49% miss rate against a 10% budget

References

  • Angelopoulos and Bates, A Gentle Introduction to Conformal Prediction and Distribution-Free Uncertainty Quantification — arXiv:2107.07511 — the score, the adjusted quantile, the coverage band and the reference implementation.
  • Angelopoulos, Bates, Fisch, Lei and Schuster, Conformal Risk Control — arXiv:2208.02814 — monotone losses, the expected-risk bound, and tightness up to O(1/n).
  • Gibbs and Candès, Adaptive Conformal Inference Under Distribution Shift — arXiv:2106.00170 — online updates to the target level and long-run coverage under an unknown data-generating process.
  • Li, Liu, Zhang, Peng, Ruan, Ma, Miao, Zhou, Qi and Yu, A Deployment Audit of Release-Side Risk in Conformal Triage under Prevalence Shift — arXiv:2605.20956 — the NSCLC pilot, the 23% prevalence, the pooled-threshold mechanism, and classwise calibration as a scarcity diagnostic.
  • Kwon and Kim, Conformal selective prediction with cost aware deferral for safe clinical triage under distribution shift — Scientific Reports 16:10016 (2026) — the 49.6% and 46.7% error reductions at 80% coverage, and the 1.4-point Mondrian gap.
  • MAPIE documentation — mapie.readthedocs.io — group-conditional sets, risk control and calibration implementations for scikit-learn pipelines.
This post is licensed under CC BY 4.0 by the author.