-
Notifications
You must be signed in to change notification settings - Fork 130
llm calibration explained
An LLM is calibrated when its probabilities match how often it is right: of the questions it answers with a P(yes) of about 0.8, about 80 percent really are yes. Calibration is a separate property from accuracy. A model can be accurate and overconfident, or mediocre and honest about it, and you need calibration, not accuracy, to put a meaningful threshold on the number. It is also a property of a model on a kind of data: good calibration on familiar questions does not carry over to new kinds of question.
The practical reason to care is that every threshold, review band and expected-cost rule on these pages assumes the probability means what it says. If it does not, the rule still runs; it just makes different mistakes than the ones you planned for.
This page is the difference between calibration and accuracy, why thresholds depend on it, what published work found for large models, what we measured on jevos, and how to check it on your own questions.
Accuracy asks: after thresholding, how often is the answer right? Calibration asks: when the model says 0.8, is it right 80 percent of the time? Two illustrative extremes show that they are independent:
- A model that answers 0.5 to every question on a set that is half yes is perfectly calibrated and useless. Its 0.5s are right half the time, exactly as claimed.
- A model that is right 95 percent of the time but always says 0.999 is accurate and badly calibrated. It claims one error in a thousand and delivers fifty.
Both are made-up illustrations, not measurements. What you want is a model that separates yes from no well (discrimination, which accuracy and precision/recall measure) and whose numbers mean what they say (calibration). The two are checked with different tools: a threshold sweep for the first, a reliability diagram and expected calibration error for the second.
If you only ever threshold one question at one cut-off chosen on labelled data, calibration matters less: any number that ranks cases well can be cut at the point your data says. It starts to matter as soon as you use the number as a probability:
- Expected cost. The rule "act on yes when P(yes) is above C_fp / (C_fp + C_fn)" is only correct when P(yes) is a real frequency; see thresholds when a wrong yes costs more.
- One threshold across many questions. Using 0.7 for every question assumes 0.7 means the same thing everywhere.
- Averages and combinations. The mean of P(yes) over a batch estimates the number of yeses only if the numbers are calibrated; so do products for AND.
- Review bands. A band from 0.3 to 0.8 is sized in probability; if the numbers drift, the band sends the wrong cases to people.
Calibration of neural networks is not automatic. Guo and colleagues (2017) found that modern neural networks, unlike those from a decade earlier, are poorly calibrated, and that a simple post-processing step, temperature scaling, fixed much of it on most datasets; the method is on temperature scaling for LLM probabilities.
For language models the picture depends on format and on training stage. Kadavath and colleagues (2022) report that larger models are well calibrated on diverse multiple choice and true/false questions when they are provided in the right format. The GPT-4 technical report (2023) shows a calibration plot on a subset of MMLU where the pre-trained model has an ECE of 0.007 and the post-trained model 0.074, with the caption "The post-training hurts calibration significantly." A yes/no format helps; the training stage can undo it.
On the natural yes/no questions of our held-out split (6,397 questions, jevos-q8_0), the
calibration error was 0.009; on the development split, 0.018. On questions of the kind the
model knows, its probabilities are close to the frequencies it achieves.
On 999 questions written from scratch after the model was finished, the picture changes. The errors lean one way: 152 answers said yes when the answer was no, against 91 the other way. And the lean is concentrated. The mean P(yes) on questions whose answer is no is 0.59 for arithmetic and 0.53 for dates and times, but 0.17 for negation and 0.16 for tone. A calibrated model would keep all of these low. On the question kinds it can read, it does; on the kinds it cannot compute, it is confidently wrong in one direction.
This is the general lesson in one example. Calibration measured on a held-out split that resembles the training data describes that data. It does not describe a new kind of question, and no single number can. The full analysis is on why a small LLM says yes when the answer is no.
- Collect a few hundred real cases for the questions you will use, labelled by hand, with the kind of reasoning each question needs. Building a yes/no test set covers how.
- Run them and keep every P(yes).
- Bin the probabilities, compare each bin's mean P(yes) with its fraction of yes, and draw the reliability diagram. Compute ECE if you want one number.
- Do it again per kind of question. A pooled diagram can look fine while one kind leans.
- If the error is a uniform over- or under-confidence, a temperature or a Platt fit on separate labelled data can fix it. If it is a lean on one kind of question, change the question instead: compute in code, and ask the model only what it reads.
What is LLM calibration? How well the model's stated probabilities match how often it is right. A calibrated 0.8 is right about 80 percent of the time.
Is a more accurate model better calibrated? Not necessarily. The two are measured separately, and a model can be strong on one and weak on the other.
Are LLMs well calibrated? It depends on format and training stage. Published results show good calibration for pre-trained models on multiple choice and true/false formats, and worse calibration after post-training in at least one report.
Is jevos calibrated? On natural yes/no questions like its held-out split, ECE 0.009. On new kinds of question, especially arithmetic and dates, it leans toward yes.
Can calibration be fixed after the fact? A uniform miscalibration, often yes. A directional error on some kinds of question, not with one global correction.
See also: what P(yes) means, how to choose a threshold for P(yes) and our held-out benchmark said 0.855.
- Our measurements: ECE 0.009 (held-out, 6,397 natural yes/no questions) and 0.018 (dev split)
on
jevos-q8_0; the 999-question set onjevos-q4_k_mfor error counts and mean P(yes) by kind. - Guo, Pleiss, Sun, Weinberger (2017), On Calibration of Modern Neural Networks, fetched 2026-09-29.
- Kadavath et al. (2022), Language Models (Mostly) Know What They Know, fetched 2026-09-29.
- OpenAI (2023), GPT-4 Technical Report, Figure 8, fetched 2026-09-29.
From the notes of jev. The 0.009 and the 0.59 describe the same model on two kinds of data, and we keep both on the page on purpose.
- Ask a local LLM a yes/no question and get P(yes)
- Zero-shot text classification with yes/no questions
- LLM policy decisions: put the rule in the question
- LLM as a judge on a CPU
- Why a small LLM says yes when the answer is no
- Small LLMs and arithmetic in yes/no questions
- Our held-out benchmark said 0.855, new questions said 0.757
- jevos vs Jev vs Laya for yes/no decisions
- An open-source alternative to Jev for yes/no decisions
- jevos vs the OpenAI API for yes/no classification
- jevos vs Ollama for yes/no decisions
- jevos vs bart-large-mnli for zero-shot classification
- A yes/no LLM vs a fine-tuned BERT classifier
- jevos vs SetFit: zero-shot vs few-shot classification
- jevos vs Llama Guard for content safety checks
- jev serve vs llama.cpp server for classification
- jevos vs LM Studio: a decision server, not a chat app
- Local vs hosted LLM decisions: latency, cost, privacy
- A yes/no LLM vs a business rules engine
- LLM decisions vs keyword rules and regex
- The fastest AI model for yes/no decisions
- What makes a local LLM fast on a CPU
- Why one forward pass beats generating an answer
- Prefill vs decode: where LLM latency comes from
- Why LLM latency grows with the length of the text
- Why a hosted LLM API cannot answer in 50 ms
- Many questions about one text: why the extra ones are cheap
- CPU or GPU for a small LLM
- Latency budgets: where a 200 ms model fits
- Measuring LLM latency: median, p90 and warm-up
- Q4_K_M vs Q8_0: speed and size for a small model
- Throughput vs latency for a decision server
- What P(yes) means, and what it does not
- LLM calibration explained with yes/no answers
- Expected calibration error (ECE), explained
- Temperature scaling for LLM probabilities
- Platt scaling for a yes/no model
- Reading a reliability diagram
- How to choose a threshold for P(yes)
- Thresholds when a wrong yes costs more than a wrong no
- Human in the loop AI with a review band
- Precision and recall at a P(yes) threshold
- Base rates: why a 0.9 yes can still be wrong often
- Combining yes/no answers with AND, OR and NOT
- Logits, log-odds and P(yes)
- LLM confidence scores: probabilities vs self-reports
- How to write yes/no questions an LLM answers well
- Negation in yes/no questions for an LLM
- One condition per question: splitting compound questions
- Ask whether the text says it at all
- Scores as yes/no thresholds: is it at least high?
- Sending JSON as the text: designing the state
- Why wording changes an LLM's answer, and how to test it
- Mainly about: questions for messages with several topics
- Yes/no questions about tone and emotion
- Asking about intent: what does the writer want?
- Yes/no questions about long documents
- Using an English-only LLM with other languages
- Content moderation with a local LLM
- A Discord moderation bot with a local LLM
- Spam detection with yes/no questions
- Review moderation with a local LLM
- Email triage with a local LLM
- Support ticket routing with yes/no questions
- Urgency detection in customer messages
- Sentiment analysis with yes/no questions
- Intent detection with a local LLM
- Lead qualification with yes/no questions
- Fraud case triage with a local LLM
- Phishing email screening with a local LLM
- Log and alert triage with a local LLM
- Checking text for personal data with yes/no questions
- Prompt injection screening with a small model
- Document classification with a local LLM
- Product categorization with yes/no questions
- Contract clause detection with a local LLM
- Refund request triage with a local LLM
- Detecting cancellation intent in customer messages
- RAG evaluation with yes/no questions
- RAG faithfulness check with a local LLM
- Hallucination detection with a local LLM
- LLM regression tests in CI with yes/no checks
- Rubric design for an LLM judge
- Pairwise comparison with a yes/no judge
- LLM judge bias and how to control it
- Evaluation metrics for yes/no classifiers
- Building a yes/no test set for your own data
- Accuracy by kind of question: why one number hides failures
- Generating test questions with answers computed by code
- Benchmark contamination and truly held-out tests
- An LLM router with yes/no questions
- A model cascade: small model first, large model on doubt
- Semantic routing vs yes/no questions
- Gating AI agent tool calls with yes/no checks
- AI agent guardrails with yes/no questions
- Stop conditions for AI agents
- Logging LLM decisions for audit
- Reducing LLM cost with local yes/no decisions
- Replacing chat LLM calls with yes/no questions
- Structured output vs a probability
- A Python client for local LLM decisions
- Calling a local LLM decision server from JavaScript
- Local LLM yes/no decisions in n8n
- A Slack bot that uses local LLM decisions
- Home Assistant automations with local LLM decisions
- A LangChain tool for local yes/no decisions
- Batch decisions from files with jev decide
- Running LLM yes/no checks in GitHub Actions
- Securing a local LLM server with an API key
- curl examples for a local LLM decision API
- Self-hosted AI for decisions
- A private LLM for text classification
- On-premise LLM for business decisions
- GDPR and automated decision-making with an LLM
- Offline AI for decisions: no network needed
- Edge AI decisions on a CPU
- Run an LLM locally without a GPU
- Small language models explained
- When a small model is enough, and when it is not
- An LLM on a laptop: what it can do in real time
- What is GGUF, for someone deploying a classifier
- GGUF quantization types explained: Q4_K_M, Q8_0 and others
- GGUF vs safetensors
- llama.cpp vs Ollama for a classification service
- llama-cpp-python vs calling llama.cpp through ctypes
- llama.cpp on Windows without compiling
- Running llama.cpp CPU only
- Using llama.cpp prebuilt binaries instead of building