Definition · AI basics
Confidence scores
A confidence score is a number that an AI model gives with a result, usually from 0 to 1 or from 0 to 100. The number shows how sure the model is of that result. A confidence score is useful only when the model is calibrated. Results at 80% confidence must be correct about 80% of the time.
Last reviewed
Key points
- A confidence score shows how sure a model is of its result. The result can be a label, a token or an answer.
- The score is useful only when it is calibrated. The stated confidence must agree with how frequently the result is correct.
- Guo and colleagues (ICML 2017) found modern neural networks poorly calibrated. Temperature scaling repaired this on most datasets.
- OpenAI reports that the base GPT-4 model has good calibration, but its post-training makes the calibration less good.
- Confidence scores also leak data. Tramèr and colleagues used them to copy models from BigML and Amazon Machine Learning.
How it works
Systems give the score in different shapes. Some scores are probabilities. Other scores are only a level of confidence.
| Where the score comes from | Example | What the source says |
|---|---|---|
| A score for each label | A label at 98.4629 in Amazon Rekognition | AWS calls it “the level of confidence in the label” |
| The probability of each token | logprobs in the OpenAI API, for 0 to 20 tokens at each position |
Log probabilities of each output token |
| The model gives a probability that its answer is correct | P(True) in Kadavath and colleagues | Good calibration on many tasks with the correct format |
| The model writes a number in text | “90% sure” | Frequently overconfident |
A score is calibrated when the stated confidence agrees with how frequently the result is correct. Guo and colleagues use the words “probability estimates representative of the true correctness likelihood”.
What a confidence score is for
Systems use the score to make a decision. Below a threshold, the system ignores a result or sends it to a person. Amazon Rekognition, for example, gives no labels below 55% if you set no other threshold.
That decision is only as good as the calibration. Three results show the limits:
- Neural networks: Guo and colleagues found modern networks “poorly calibrated”. Temperature scaling, a procedure with one parameter, worked on most datasets.
- Chat models: OpenAI reports that the base GPT-4 model is “highly calibrated”. After post-training, “the calibration is reduced.”
- Words: Xiong and colleagues found that values in words “primarily range between 80% and 100%, often in multiples of 5.”
In practice
Kadavath and colleagues (2022) found larger models “well-calibrated on diverse multiple choice and true/false questions”. The format of the question had an effect on the result. Models tuned with RLHF “naively appear very miscalibrated”. A temperature of 2.5 largely repaired this on some tests.
Kalai and colleagues (2025) connect AI hallucination to tests that give points for a guess. They propose a confidence target in the instruction:
“Answer only if you are >t confident, since mistakes are penalized t/(1-t) points”
The paper gives these rules for the score:
- A correct answer gets 1 point.
- No answer gets 0 points.
- An incorrect answer loses t/(1-t) points.
- The examples of t in the paper are 0.5, 0.75 and 0.9.
Trade-offs for security teams
Confidence scores help defenders, and they also help attackers.
- They let you set a threshold. A guardrail model or a classifier can stop or mark a result at a set score.
- They leak the model. Tramèr and colleagues (USENIX Security 2016) used confidence values to copy models from BigML and Amazon Machine Learning “with near-perfect fidelity”. This attack is model extraction.
- An API without scores is not safe. The same paper found that “omitting confidence values from model outputs still admits potentially harmful model extraction attacks”.
Questions and answers
Does a confidence score of 90% mean the answer is correct?
No. A score of 90% shows how sure the model is. The result is correct 9 times in 10 only if the model is calibrated. Xiong and colleagues found that LLMs which write their confidence in words are frequently overconfident. Most of their values were between 80% and 100%.
Must an AI API send confidence scores with its results?
Each decision has a cost. The scores let users set a threshold and send unsure results to a person. Tramèr and colleagues showed that the same scores help an attacker copy the model. An API without the scores did not fully stop the attack.
Sources
- On Calibration of Modern Neural NetworksarXiv (Guo et al., ICML 2017), 14 Jun 2017
- GPT-4OpenAI, 14 Mar 2023
- Language Models (Mostly) Know What They KnowarXiv (Kadavath et al.), 11 Jul 2022
- Can LLMs Express Their Uncertainty? An Empirical Evaluation of Confidence Elicitation in LLMsarXiv (Xiong et al.), 22 Jun 2023
- Chat Completions API referenceOpenAI
- DetectLabels, Amazon Rekognition API ReferenceAmazon Web Services
- Stealing Machine Learning Models via Prediction APIsarXiv (Tramèr et al., USENIX Security 2016), 9 Sep 2016
- Why Language Models HallucinatearXiv (Kalai et al.), 4 Sep 2025
Guides that use this term
Related topics
In the news
- AI models do not find their math errors, but external tags help
- AWS releases 5 open decision models and a sandbox tool for agents
- Perplexity gives AI agents a monitor API for web changes
- New training lifts math answers at 5% risk from 0.8% to 42.4%
- Microsoft launches Decision-1.1, a model that picks steps for agents
- Google makes a Decisions API with a result in 150 to 250 ms
- Dataline gets $10.6 million for a data market that AI agents use
- A method with a prior is above other methods when sources do not agree
- AWS releases two open-source tools to control AI agents