TL;DR
Large language models (LLMs) are notoriously good at sounding confident even when they are dead wrong—a fatal flaw if you want an AI agent to make high-stakes decisions autonomously. This paper demonstrates that an LLM’s internal "thoughts" (hidden states) know much more about whether its answer is right than the model can express in words. By attaching a tiny linear probe to a frozen LLM, we can build a reliable "confidence gate" that safely automates the bulk of an agent's workload while routing the genuinely tricky cases to human reviewers.
What Problem Does This Paper Address?
Imagine deploying an AI agent to process medical records or loan applications. Right now, you face a painful trade-off: let the agent act on every output and eat its error rate, or have humans review everything and bottleneck your entire system at human speed.
What we really want is gated automation: a reliable confidence score for every answer. If the score exceeds a strict threshold, the agent acts automatically; if not, a human steps in.
The catch? Because LLMs generate text one token at a time, they don't naturally output a single probability that the whole answer is factually correct. Practitioners usually improvise by averaging token probabilities, asking the model how sure it is ("verbalized confidence"), or calling a second "LLM-as-Judge." Unfortunately, these estimates are often unavailable behind commercial APIs, poorly calibrated, or far too coarse to draw a clean threshold.
Methods
Using a frozen, 4-bit quantized 2B-parameter model (gemma-2-2b-it), the authors use supervised learning to predict whether the LLM's generated answers are right or wrong (graded automatically against reference answers). They introduce two approaches depending on model access:
- Confidence Score Head (for open-weight models): A lightweight logistic regression probe (just 2,305 parameters) attached directly to the LLM's final-layer hidden state at the very last token of the prompt-plus-answer sequence. Because of causal attention, this final token has attended to the entire context, question, and generated answer.
- Text-Only Metamodels (for closed API models): When internal states and log-probabilities are locked behind an API, they embed the raw text of the context, question, and answer using a sentence encoder (
gte-modernbert-base) and train standard classifiers (Logistic Regression, Random Forest, XGBoost) on the concatenated embeddings.
They benchmark these against zero-shot, single-pass baselines: average token log-probability (isolated to the parsed answer span via JSON constrained decoding), verbalized self-scores, LLM-as-Judge, and an open-weight "typed-decision" encoder model (Laya) purpose-built to output binary decision probabilities.
Datasets
No new benchmarks were created; instead, the authors used public question-answering (QA) datasets where correctness can be graded automatically:
- In-Domain (Training & Validation): SQuAD v1.1 (~98.5% of the data, testing extractive QA from a passage) and TruthfulQA (~1.5%, testing internal knowledge against common misconceptions). Together, these total 88,086 training and 10,705 validation questions.
- Out-of-Domain (Generalization): Six unseen test splits from the MRQA 2019 shared task (BioASQ, DROP, DuoRC, RACE, RelationExtraction, and TextbookQA), totaling 8,724 questions.
Key Insights and Ideas
- LLMs know more than they say: The hidden-state probe vastly outperforms prompting the exact same model to grade itself. The signal for factual correctness is linearly encoded inside the model, even if the generative text head fails to verbalize it.
- Calibration without resolution is a mirage: Prompted baselines (self-score and LLM-as-Judge) achieve impressively low Expected Calibration Error (ECE = 0.07). Sounds great, right? Not quite. Using Murphy’s decomposition of the Brier score, the authors show these models suffer from score collapse—clustering almost all predictions onto 8 to 13 discrete values near the dataset's base accuracy rate. You can't threshold a flat line! Conversely, the supervised head is initially under-confident (a safer failure mode that routes borderline cases to humans, and easily fixed post-hoc via Platt scaling) while offering high resolution—actually separating right from wrong.
- Black-box text wrappers still beat prompting: Even with zero access to model internals or token probabilities, external text-only metamodels recover about half the performance gap between LLM-as-Judge and the internal hidden-state probe.
Key Results
On the in-domain validation set (where accepting everything yields an 81% base accuracy):
- Discrimination (ROC-AUC): The confidence score head leads at 0.88, followed by a tie between the three text metamodels and isolated answer-token log-probabilities (0.80), the typed-decision model (0.74), LLM-as-Judge (0.72), and verbalized self-score (0.57, barely beating a coin flip).
- Workload Automation: Suppose your application requires 95% accuracy on automated actions. The confidence score head safely automates 62.1% of the total workload (concentrating errors into the human review queue, which becomes 43% incorrect). At that same 95% target, the best metamodel automates 22.7%, token log-probs automate 15.4%, LLM-as-Judge automates 0.5%, and self-scoring automates 0.0%.
- Out-of-Domain Transfer: On the six unseen MRQA datasets (where base LLM accuracy drops to 65%), the confidence head retains its ranking crown (0.82 macro ROC-AUC vs. 0.73 for metamodels/log-probs). However, fixed thresholds don't transfer cleanly under distribution shift: even with a re-tuned threshold, 95%-accurate automation drops to 20.7% for the head—still crushing every other method (all $\le$ 0.4%).
Limitations and Future Work
- Single, small backbone: Everything runs on a single 2B-parameter, 4-bit model. Stronger models will make fewer mistakes (leaving less negative training data), and a 70B+ LLM-as-Judge would likely put up a much better fight than a 2B judge grading itself.
- Dataset skew: SQuAD makes up 98.5% of the main splits. TruthfulQA's validation slice ($N=164$) is too small to statistically separate the methods on non-extractive tasks.
- Drift requires monitoring: Because fixed thresholds degrade when data distributions or base accuracy rates shift, real-world deployments will need continuous human sampling of high-confidence answers to monitor drift and recalibrate.
- Future directions: Exploring non-linear probe architectures, fine-tuning typed-decision encoders, and swapping out "correctness" labels for safety or compliance annotations—turning the confidence head into a fast, lightweight risk gate before an AI agent executes real-world actions.
Summary updated