Thresholds and metrics for decision models
TL;DR. A decision model gives you a score; your product needs a yes or no. The score’s ranking quality (ROC and PR curves, AUROC, AP) is fixed by the model and prompt. The operating point (threshold) is your choice and should come from the costs of the two kinds of error, minimum requirements, and the prevalence you will see in deployment. This page lists the threshold rules, the agreement and uncertainty statistics to report next to them, and works every rule on the scores released with Hamel and Saha’s evaluation (98 traces, 61 failures). All numbers on this page are our computation from those scores unless marked otherwise.
From scores to curves
Section titled “From scores to curves”Sweeping the threshold over all scores traces out:
- The ROC curve, TPR = recall against FPR = FP/(FP+TN). Its area, AUROC, is the probability that a random failure scores above a random pass. Chance is 0.5, and AUROC does not depend on prevalence.
- The PR curve, precision against recall. Its summary, average precision (AP), has a chance level equal to the prevalence . On these traces that level is 0.622, so AP 0.80 is less impressive than it sounds.
Both curves depend only on the order of the scores. A single strictly increasing mapping applied to every example, such as one Platt fit, preserves ranking and attainable threshold sets; it only changes which score value corresponds to which point on the curve. Isotonic calibration can introduce ties and change AUROC or PR/AP, and pooling predictions from different fold-specific calibrators can also change their order (Calibration).
| Model | AUROC (95% bootstrap) | AP | F1 at 0.50 | Best F1 (thr) |
|---|---|---|---|---|
| Clef Flash | .709 (.61–.81) | .822 | .351 | .800 (.055) |
| Liquid d1 | .715 (.60–.81) | .802 | .577 | .814 (.101) |
| Jev 1.13 | .765 (.66–.86) | .823 | .788 | .817 (.40) |
| Perplexity Decider 1.1 | .795 (.69–.89) | .830 | .729 | .825 (.127) |
| Liquid d1-ultra | .813 (.72–.89) | .876 | .803 | .831 (.20) |
| OpenAI Decisions | .860 (.78–.93) | .906 | .840 | .878 (.72) |
“Best F1” is in-sample, chosen on all 98 labels, and therefore optimistic. Flagging every trace already gives F1 = 0.767.
Choosing the operating point: five rules
Section titled “Choosing the operating point: five rules”| Rule | Picks to… | Needs | Strength | Weakness |
|---|---|---|---|---|
| Default 0.50 | nothing | nothing | no labels used | arbitrary unless scores are calibrated and costs are equal |
| Max / | maximise | labels | one number | ignores TN; weights recall relative to precision but is not a fixed false-positive/false-negative cost ratio (Lipton et al., Thm 4.1); use expected cost when costs are known |
| Floors, then | max s.t. , | labels | encodes minimum requirements | can be infeasible; floors are prevalence-dependent |
| Expected cost (Bayes) | flag if | calibrated , costs | principled; transfers across prevalence if is recalibrated | needs calibration and honest costs |
| (Lipton et al.) | flag if | calibrated | explains why the threshold is ≤ 0.5 | holds only for calibrated scores |
The Bayes rule. If is calibrated, flagging an item costs in expectation and not flagging costs . Flag when the first is smaller, which gives . With a miss three times as costly as a false alarm, .
The F1/2 rule* (Lipton, Elkan and Narayanaswamy, 1402.1892). Write with . Flagging one more item with probability of being positive adds to the numerator in expectation and exactly 1 to , because a positive moves from FN to TP and a negative becomes a new FP. So rises only if , that is, . At the optimum the marginal item therefore sits at , and since the threshold is at most 0.5.
Worked comparison on the 98 traces.
| Model | Best-F1 thr | F1*/2 | F1 at F1*/2 (vs best) | Cost 1:3 at 0.50 | Min cost 1:3 (thr) |
|---|---|---|---|---|---|
| Jev | .40 | .41 | .809 (.817) | 43 | 31 (.18) |
| d1-ultra | .20 | .42 | .819 (.831) | 48 | 28 (.20) |
| OpenAI | .72 | .44 | .840 (.878) | 33 | 29 (.72) |
| Perplexity | .127 | .41 | .752 (.825) | 73 | 30 (.012) |
| Liquid d1 | .101 | .41 | .608 (.814) | 107 | 30 (.026) |
| Clef Flash | .055 | .40 | .416 (.800) | 144 | 33 (.046) |
The cost columns count 1 per false alarm and 3 per miss. Flagging everything costs 37 and flagging nothing costs 183.
Three lessons follow. First, the rule works for the two models that are close to calibrated (Jev, d1-ultra) and fails badly for the under-confident ones, so the gap is a cheap calibration check. Second, OpenAI’s best threshold of 0.72 is far above 0.44 because its middle scores are over-confident: raw group means of 0.48 predicted versus 0.25 observed. Third, at 62% prevalence with misses weighted 3×, every model’s best policy is within 4–9 units of flagging everything. The dataset is too failure-rich to separate models on cost.
Prevalence moves precision
Section titled “Prevalence moves precision”With TPR and FPR fixed,
OpenAI at 0.72 has TPR 0.885 and FPR 0.216. Its precision is 0.87 at the dataset’s , but 0.64 at , 0.31 at and 0.08 at . A precision floor tuned on a failure-enriched sample does not survive deployment on mostly-clean traffic. Tune on TPR and FPR and recompute precision for the deployment prevalence, or label a sample at that prevalence. The same applies to , AP and κ. It is the same base-rate effect that makes relevance-judge precision depend on how deep the pool goes in IR.
Agreement: Cohen’s κ
Section titled “Agreement: Cohen’s κ”, where is the agreement expected from the two raters’ marginals alone. At the best-F1 thresholds, κ against the labels is 0.28 (Clef), 0.37 (Jev), 0.38 (d1), 0.42 (d1-ultra), 0.51 (Perplexity) and 0.67 (OpenAI). That is “fair” to “substantial” on the usual scale, even though five of the six F1 values are around 0.82. F1 and κ disagree because F1 ignores true negatives, while κ penalises a judge that agrees mainly by flagging most traces. The statistics page covers weighted κ, Kendall τ over system rankings, and prediction-powered inference for correcting a judge with a few human labels.
Uncertainty at small n
Section titled “Uncertainty at small n”With 98 traces, every proportion is uncertain. Use the Wilson interval for a proportion :
OpenAI’s precision at 0.72 is 54/62, with 95% interval [0.77, 0.93]. Perplexity’s at 0.127 is 52/65, with interval [0.69, 0.88]. Both are “0.80+” point estimates whose intervals straddle the floor. For a comparison between models, use a paired bootstrap that resamples traces and evaluates both models on the same resample. For OpenAI minus Perplexity, the AUROC gap has a 95% interval of about −0.01 to 0.15. To halve an interval you need four times the labels. A ±0.05 interval on a proportion near 0.8 needs about items in the denominator: 250 flagged items for precision and 250 true failures for recall.
Connections
Section titled “Connections”- Anchor: Hamel and Saha’s decision-model evals (floors, cross-validated tuning, cost Pareto).
- Calibration: required before reading a score as a probability or using the Bayes rule.
- Statistics and judge calibration: κ, τ, paired tests, PPI.
- Decision models as judges and Routing and agents: where the operating point becomes an escalation or routing threshold.
Questions to think through
These questions have no single right answer. Write or say your answer before you open the hints. Mark a question once you could defend your answer in a reading group.
- Derive / compute
OpenAI Decisions at threshold 0.72 on the 98 traces: TP 54, FP 8, FN 7, TN 29. Compute raw agreement with the labels and Cohen's κ, then compute κ for Jev at 0.50 (TP 54, FP 22, FN 7, TN 15). Both catch 54 failures; why is Jev's κ less than half of OpenAI's?
What a strong answer covers
- OpenAI: p_o = (54 + 29)/98 ≈ 0.847. The model flags 62 of 98 and the labels mark 61 of 98 as failures, so p_e = (62·61 + 36·37)/98² = 5114/9604 ≈ 0.533 and κ = (0.847 − 0.533)/(1 − 0.533) ≈ 0.67.
- Jev: p_o = 69/98 ≈ 0.704; p_e = (76·61 + 22·37)/9604 ≈ 0.568; κ ≈ (0.704 − 0.568)/0.432 ≈ 0.32.
- The two have the same true positives. The difference is all on the 37 passes: Jev raises 22 false alarms and clears only 15, which is close to what a flag-most-things rater would do given 62% prevalence.
- κ removes the agreement expected from the marginals alone. That matters here because a judge that flags everything already agrees on 62% of traces.
- Derive / compute
At threshold 0.72 OpenAI Decisions has TPR 0.885 and FPR 0.216 on these traces (61 failures out of 98). Assuming TPR and FPR stay fixed, compute its precision if production prevalence of failures is 30%, 10% and 2%, and say what this means for a precision floor of 0.80 tuned on this dataset.
What a strong answer covers
- Precision = π·TPR/(π·TPR + (1 − π)·FPR).
- π = 0.30: 0.266/(0.266 + 0.151) ≈ 0.64. π = 0.10: 0.0885/(0.0885 + 0.194) ≈ 0.31. π = 0.02: 0.0177/(0.0177 + 0.212) ≈ 0.08.
- The 0.80 floor holds only near the 62% prevalence of the labelled set. AUROC, TPR and FPR do not depend on prevalence, but precision, F1, AP and κ do.
- Either label a sample whose prevalence matches deployment, or tune on TPR/FPR and recompute precision for the deployment prevalence before setting the threshold.
- Mechanism
Lipton et al. show that for calibrated scores the F1-maximising threshold is F1*/2, where F1* is the best achievable F1. On the 98 traces, the F1*/2 rule gives thresholds near 0.41 for every model. It nearly matches the best F1 for Jev (0.809 vs 0.817) and d1-ultra (0.819 vs 0.831), but not for Perplexity (0.752 vs 0.825) or Clef Flash (0.416 vs 0.800). Explain why the rule takes this form and why it fails for those two models.
What a strong answer covers
- Write F1 = 2TP/D with D = 2TP + FP + FN. Flagging one more item adds 2p to the numerator in expectation and exactly 1 to D (a positive moves from FN to TP; a negative becomes a FP). F1 rises iff (2TP + 2p)/(D + 1) > 2TP/D, i.e. p > F1/2, so at the optimum the marginal item has p = F1*/2.
- Since F1* lies between 0 and 1, the optimal threshold for calibrated scores is always at most 0.5. Flagging is cheaper than it looks because F1 ignores true negatives.
- Perplexity and Clef are under-confident on this task (observed failure rates well above their scores), so their best thresholds lie far below 0.41 (0.13 and 0.055).
- The gap between the F1*/2 threshold and the empirical best threshold is therefore a quick calibration diagnostic. Platt scaling would move each model's best threshold back toward F1*/2.
- Critique
With costs of 1 per false alarm and 3 per missed failure, the cost-minimising thresholds on the 98 traces give total costs of 28–33 for all six models, while flagging every trace costs 37 and the default threshold 0.50 costs 33–144. What does this say about the dataset and about reporting F1 alone?
What a strong answer covers
- At 62% prevalence and with misses weighted 3×, a trivial flag-all policy is within 4–9 cost units of the best policy for every model. Model differences shrink to a few traces.
- F1 hides this because it ignores true negatives. Always report the trivial baselines (flag-all, base-rate Brier) next to tuned results.
- The 0.50 default ranges from near-optimal (OpenAI 33) to terrible (Clef 144). The choice of threshold matters more than the choice of model here.
- In-sample cost minimisation is optimistic; the same cross-validation as for F1 tuning is needed.
- Design
You must certify that a decision-model relevance filter has precision at least 0.80 and recall at least 0.80 before turning it on, and you can afford to label 400 items. Design the labelling and reporting plan.
What a strong answer covers
- Sample from deployment traffic at deployment prevalence (or stratify and reweight), and keep a test split that is never used for tuning.
- Choose the threshold on the tuning split under the floors, with CV and reporting of infeasible splits. Then freeze it.
- On the test split, report Wilson 95% intervals for precision and recall. Certify only if the lower bounds clear the floors, or state the probability of clearing them. A Wilson half-width of ±0.05 near 0.8 needs about 250 items in the denominator.
- Report κ, AUROC and AP with bootstrap CIs, and the trivial baselines. If downstream code consumes the probability, also report reliability and Brier.