Validity screening protocol for LLM confidence signals
Project description
validity-screen
Check whether an LLM's confidence signal carries information before you build on it.
Implements the screening protocol from:
Cacioli, J. P. (2026). Screen Before You Interpret: A Portable Validity Protocol for Benchmark-Based LLM Confidence Signals. arXiv.
Install
pip install validity-screen
Quick start (Python)
import numpy as np
from validity_screen import screen
# Your data: item-level correctness and confidence
correct = np.array([True, True, False, True, False, True, True, False])
confidence = np.array([True, True, True, True, False, True, False, False])
result = screen(correct, confidence, model_name="My Model")
print(result.tier) # 'Valid', 'Indeterminate', or 'Invalid'
print(result.vrs_table()) # Complete reporting table
Quick start (command line)
# From a CSV with 'correct' and 'confidence' columns
validity-screen run --data my_data.csv --model-name "GPT-5.4"
# From separate files
validity-screen run --correct correct.txt --confidence confidence.txt
# Continuous confidence? Auto-binarised at median
validity-screen run --data my_data.csv --confidence-col prob --threshold 0.5
# JSON output for pipelines
validity-screen run --data my_data.csv --json
What it does
Before computing calibration metrics (ECE), metacognitive sensitivity (meta-d', AUROC), or selective prediction accuracy, this protocol checks whether the confidence signal carries item-level information about correctness. If it doesn't, those downstream metrics are fitting noise.
Five values from a 2x2 contingency table. Three possible outcomes.
| Tier | Meaning | Action |
|---|---|---|
| Valid | Confidence tracks correctness | Proceed with downstream metrics |
| Indeterminate | Near threshold, uncertain | Compute but flag; consider more items |
| Invalid | Confidence does not discriminate | Do not interpret AUROC, ECE, selective prediction |
Indices
| Index | What it detects | Invalid threshold |
|---|---|---|
| L | Blanket confidence on errors | >= 0.95 |
| Fp | Over-withdrawal of correct items | >= 0.50 |
| RBS | Inverted monitoring direction | > 0 (CI excludes zero) |
| TRIN | Fixed responding | >= 0.95 (warning only) |
| r | Item-level sensitivity | Reported, not thresholded |
Batch screening
from validity_screen import screen_batch, summary_table
models = {
"GPT-5.4": {"correct": correct_gpt, "confidence": conf_gpt},
"Claude": {"correct": correct_claude, "confidence": conf_claude},
"Gemini": {"correct": correct_gemini, "confidence": conf_gemini},
}
results = screen_batch(models, benchmark_name="MMLU")
print(summary_table(results))
Continuous confidence
from validity_screen import screen, binarise
# Binarise at a fixed threshold
confidence_binary = binarise(confidence_continuous, threshold=50)
# Or at the sample median
confidence_binary = binarise(confidence_continuous, method='median')
result = screen(correct, confidence_binary)
Requirements
- Python >= 3.8
- NumPy >= 1.20
- SciPy >= 1.7
Citation
@article{cacioli2026screen,
title={Screen Before You Interpret: A Portable Validity Protocol for
Benchmark-Based LLM Confidence Signals},
author={Cacioli, Jon-Paul},
journal={arXiv preprint},
year={2026}
}
@article{cacioli2026validity,
title={Before You Interpret the Profile: Validity Scaling for
LLM Metacognitive Self-Report},
author={Cacioli, Jon-Paul},
journal={arXiv preprint},
year={2026}
}
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file validity_screen-0.1.0.tar.gz.
File metadata
- Download URL: validity_screen-0.1.0.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b08d42bc9b6600878be98046469a2ed434248f319d6b4ec45d5ab34e1f13f6c
|
|
| MD5 |
d560fb0c8ba5f7a16be5186b3bbb78fe
|
|
| BLAKE2b-256 |
e57833f1082559b8e22984cc1fb35dbe092a75a2464c5c7cd1685959ecacecef
|
File details
Details for the file validity_screen-0.1.0-py3-none-any.whl.
File metadata
- Download URL: validity_screen-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef4f5d053bb0882fba8318a4323cb8c5aad61c14d57f45886e2f37d7ea1e824f
|
|
| MD5 |
cfaaf7f2384ec203e1c9e48ea02b070d
|
|
| BLAKE2b-256 |
33dfdeb4804ac724b269ba634b6769f678c99fd5449c736e7db16ef62bdf9a1b
|