Confidence scoring measures how strongly a system supports a prediction, extracted value, or generated response. Scores may come from model probabilities, a separate evaluator, agreement across predictions, or checks against supporting evidence. Their meaning depends on how they are produced: a classification probability, retrieval similarity score, and grounding score measure different things and are not interchangeable. A score should always have a documented interpretation and an associated operational decision.
For generative AI, confidence scoring is useful because fluent language can conceal factual errors. A language model can generate a plausible answer that invents a policy, misstates a technical limit, or cites a nonexistent document. Asking the model to report its own confidence does not reliably detect these hallucinations. Likewise, high token probabilities indicate that wording is likely under the model, not that the underlying claims are true.
Retrieval Augmented Generation, or RAG, improves grounding by supplying relevant external information as context. An application can retrieve approved documents, generate an answer, and then evaluate whether its claims are supported by those documents. Retrieval relevance alone is insufficient: a highly relevant document does not guarantee that the answer accurately represents it. Claim-level support checks, citation verification, and checks for contradictions provide additional evidence. Grounding also depends on source quality; an answer can faithfully reproduce an outdated or incorrect document.
Consider a cloud-hosted assistant answering questions about employee travel reimbursement. The application retrieves the current policy and generates a response with citations. A separate evaluation step scores support against the retrieved passages, while deterministic checks verify that cited document identifiers exist and monetary amounts match policy data. Responses that pass the configured checks are delivered; uncertain responses trigger another retrieval attempt, a request for clarification, human review, or an explicit statement that the available evidence is insufficient.
Thresholds should be selected using representative labeled examples rather than intuition. If a score is intended to represent a probability of correctness, calibration tests whether predictions assigned approximately 80 percent confidence are correct about 80 percent of the time. Many similarity and evaluator scores are not calibrated probabilities. Evaluate both missed errors and unnecessary rejections, and use stricter acceptance criteria for consequential decisions. Higher thresholds generally reduce automated coverage and increase review workload; additional evaluators also add latency and cost.
In production, record score definitions, model and evaluator versions, evidence references, threshold decisions, and review outcomes while protecting sensitive data. Monitor performance after changes to models, prompts, documents, or user populations. Confidence scoring supports hallucination detection and risk-based routing, but it is neither a security boundary nor a replacement for authorization, trusted retrieval sources, output validation, or human oversight.