Abstract
Traditional confidence scores for machine learning models, typically derived from the probability of the top-ranked output, often fail in the context of open-ended text generation. This failure stems from the "one-to-many" nature of generation tasks, where multiple valid outputs may exist, causing the model to spread its probability mass and appear unconfident. We introduce two novel, task-agnostic metrics—Ratio and Tail Thinness—that leverage the characteristics of the entire output distribution generated via beam search. Our results across translation, question answering, and summarization tasks demonstrate that these metrics significantly improve the calibration of confidence scores, outperforming standard baselines by up to 17.2% in correlation with actual output quality.
Introduction: The Calibration Gap in Text Generation
In classification tasks, a model is considered confident if it assigns a high probability to a single class. However, text generation is inherently open-ended. For tasks like summarization or translation, there are often multiple equally valid ways to express the same information. Standard confidence metrics, such as Average Token Probability (ATP), focus on the probability of the single "top" sequence. When a model identifies several high-quality alternatives, it distributes probability among them, leading to a low score for the top choice despite high overall model certainty. This results in "miscalibration," where the model's reported confidence does not accurately reflect the quality of its output.
Proposed Metrics: Analyzing Distribution Shape
To address this, we propose looking at the "shape" of the model's output distribution rather than just the magnitude of the top probability. We introduce two metrics that rely on the probabilities of multiple sequences generated via beam search:
- Ratio: This metric calculates the probability ratio between the top-ranked sequence ($y^{(1)}$) and an "average" sequence ($y^{(k)}$). A confident model will exhibit a sharp drop-off between high-quality and mediocre sequences. The choice of $k$ is task-dependent; more open-ended tasks like summarization benefit from comparing the top sequence to a much lower-ranked one (e.g., $k=99$).
- Tail Thinness: Adapted from recent statistical work, this metric calculates the sum of the squared probabilities of the top $N$ sequences (after normalization). A "thin tail" (high score) indicates that the model has concentrated its probability on a small set of likely candidates and assigned near-zero probability to the rest, signaling high confidence.
Experimental Evaluation
We evaluated these metrics using BART-Base and Flan-T5 Base models across three categories of NLP tasks:
- Translation: WMT 2017 (English-German, English-Russian) and FLORES (Filipino).
- Question Answering: SQuAD and HotpotQA.
- Summarization: DebateSumm, Reddit Tifu, XSUM, and CNN-DailyMail.
Results and Discussion
The proposed metrics consistently outperformed standard baselines like Average Token Probability (ATP) and Dropout-based methods. Tail Thinness achieved the best performance in 10 out of 16 dataset-model pairs, while Ratio was superior in 8 cases. Notably, these metrics improved the Spearman correlation with actual quality scores (e.g., BLEU, ROUGE) by up to +17.2% in certain QA and translation tasks.
Qualitative analysis revealed that our metrics correctly assign high confidence when a model finds multiple valid ways to answer—a scenario where traditional metrics often fail. However, limitations remain. The computational cost of generating 100 beams for these metrics is higher than single-sequence generation. Additionally, while these metrics improve calibration for fluency, models can still be "confidently wrong" regarding factual accuracy, a phenomenon known as hallucinated confidence that warrants future research.
Conclusion
By shifting the focus from the probability of a single output to the structural characteristics of the entire output distribution, we can more accurately estimate a model's confidence in text generation. Ratio and Tail Thinness provide a robust, task-agnostic framework for better-calibrated AI systems.
Summary updated