validity-screen
Check whether an LLM's confidence signal tracks correctness, and which response set dominates it, before you build on it.
Implements the screen in:
Cacioli, J. P. (2026). Screen Before You Interpret: A Portable Validity Screen for Benchmark-Based LLM Confidence Signals. arXiv:2604.17714v2.
Version 0.3.0 corrects version 0.1. See CHANGELOG.md. Results produced with 0.1 should be rerun.
Install
pip install validity-screen
Quick start
import numpy as np
from validity_screen import screen, binarise
# item-level correctness and a binary confidence judgement (1 = KEEP / high)
result = screen(correct, keep, model_name="My Model")
print(result.tier) # Valid, Indeterminate, Invalid or Uncertifiable
print(result.vrs_table()) # full reporting table
# verbalized 0-100 confidence: choose the cut point in advance
result = screen(correct, binarise(confidence, 90), binarisation_threshold=">= 90")
# exclude declines, parse failures and pipeline defaults before scoring
result = screen(correct, keep, answered=answered)
Command line:
validity-screen run --data results.csv --correct-col is_correct --confidence-col keep
validity-screen run --data results.csv --confidence-col confidence --threshold 90
validity-screen run --data results.csv --answered-col parsed --json
validity-screen plan --accuracy 0.92 # items needed to certify blanket confidence
What it computes
From the correctness-by-confidence table (a = correct & high, b = incorrect & high, c = correct & low, d = incorrect & low):
| Index | Definition | Standard equivalent | Flag |
|---|---|---|---|
| L | b / (b + d): confidence kept on errors | false-positive rate of KEEP | >= .95 |
| Fp | c / (a + c): confidence withdrawn on correct answers | false-negative rate of KEEP | >= .50 |
| RBS | Fp - (1 - L) | minus Youden's J; binary AUROC = (1 - RBS)/2 | > 0 |
| TRIN | max(n_high, n_low) / N | modal-response share | >= .95, warning only |
| r | Pearson on 0/1 vectors | phi | reported |
Each index is computed only when its denominator reaches 10. A flagged index is Invalid if its interval clears the guard (Wilson lower bound > .40 for Fp, > .90 for L; Newcombe interval excluding 0 for RBS) and Indeterminate otherwise.
Tiers
| Tier | Meaning |
|---|---|
| Invalid | A response set is established: blanket confidence, blanket withdrawal, or inversion. Do not interpret AUROC, ECE or selective prediction. |
| Indeterminate | A threshold is crossed but cannot be certified (often too few errors), or no response set is present but confidence does not measurably track correctness. |
| Uncertifiable | RBS cannot be estimated (fewer than 10 correct items or errors). |
| Valid | No response set, and the RBS interval lies below 0: confidence measurably tracks correctness. |
require_signal=False (CLI --v02) gives the 0.2 rule, under which Valid only meant that no flag fired. Every result also reports tier_v02.
Things to know
- Errors, not items, set the sample size. Certifying blanket confidence needs 35 errors at L = 1.00, 71 at .97, 97 at .96 and 139 at .95. Use
errors_needed()/items_needed(). - Continuous confidence needs a cut point chosen in advance. Verdicts depend on it: verbalized confidence usually piles at 90-100, so at 50 most models look like blanket confidence. Screen at the threshold your deployment will use. Median splits are deprecated because their verdict depends on tie handling.
- Valid is necessary, not sufficient. It says the signal is non-degenerate and better than chance, not that it is good. Report r and AUROC alongside the tier.
- Verdicts are specific to probe format, prompt and task. Screen under the conditions the signal will be used in.
Citation
@misc{cacioli2026screen,
author = {Cacioli, Jon-Paul},
title = {Screen Before You Interpret: A Portable Validity Screen for Benchmark-Based {LLM} Confidence Signals},
year = {2026},
howpublished = {arXiv:2604.17714v2}
}
License
MIT.
Metadata
Release files for validity-screen 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| validity_screen-0.3.0.tar.gz | 14.2 kB | Without provenance | Details for validity_screen-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| validity_screen-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for validity_screen-0.3.0-py3-none-any.whl |
Total release size: 27.0 kB
Release files / validity_screen-0.3.0.tar.gz
| Download URL | validity_screen-0.3.0.tar.gz |
|---|---|
| Size | 14.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3bb84a6c33a2663f62c12122e4e1def8d588740bf7f39ad54f3c28d768108175
|
|
BLAKE2b-256 checksum How to use checksums |
61a9bca572b747dbf1d4c4a5e88512de8609f95082881dbdb2881252c64a3ee8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.2
|
Release files / validity_screen-0.3.0-py3-none-any.whl
| Download URL | validity_screen-0.3.0-py3-none-any.whl |
|---|---|
| Size | 12.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ceda0eb17028c220192b1369adb83fdf75cccccfccd5dd5d58b700e0ccb2183c
|
|
BLAKE2b-256 checksum How to use checksums |
ba8144e6d8762e75af52750bffd904986e0cff4fda37a06cbce50ef00c6a5e72
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.2
|
Security for validity-screen 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.