Generative models like T5 and GPT have become the "Swiss Army knives" of NLP, excelling at tasks like entity extraction and slot filling. However, while these models are increasingly accurate, they often struggle with calibration—the ability to provide a confidence score that actually reflects the likelihood of being correct. If a model says it is 90% sure about a labeled span, it should be right 90% of the time.
Researchers from Google Research explore how to move beyond simple token probabilities to create more reliable, well-calibrated confidence estimates for generative sequence labeling by leveraging the information contained within beam search candidates.
The Problem: Overconfidence in Generative Models
In sequence labeling (e.g., identifying "London" as a Location), downstream systems need to know if they can trust a specific prediction. A high-precision system might only act on high-confidence spans while asking a human for help on low-confidence ones.
In traditional discriminative models (like BERT), getting these scores is straightforward. But in generative models, the model produces a sequence of tokens. The "natural" way to get confidence for a span is to multiply the probabilities of the tokens that form it. However, this only looks at the single best path the model found. It ignores the "uncertainty" hidden in other likely paths the model considered but ultimately didn't choose. This leads to overconfidence and poor calibration.
Proposed Methods: Aggregating Beam Search Statistics
The authors propose three methods that utilize the top-$k$ candidates generated during a beam search to better estimate span-level confidence:
- AggSpan (Aggregated Span Probability): Instead of looking at just one preceding context, this method aggregates probabilities across all unique contexts for a span found within the beam.
- AggSeq (Aggregated Sequence Probability): This method calculates confidence by looking at how often a specific span appears across all top-$k$ sequence candidates, weighted by the total probability of those sequences. If a span appears in multiple high-ranking sequences, it receives a higher score.
- AdaAggSeq (Adaptive Aggregated Sequence Probability): This variant dynamically adjusts the beam size ($k$) based on the complexity of the input (specifically, the number of entities detected in the top-1 result) to avoid introducing noise in simpler sentences.
Experimental Evaluation
The researchers evaluated their methods across six diverse public datasets: ATIS & SNIPS (slot-filling), mTOP (multilingual semantic parsing), MIT-R (dining assistance), NER (Named Entity Recognition), and CHUNK (syntactic chunking). The primary metric used was Expected Calibration Error (ECE), where a lower score indicates better-calibrated confidence.
Key Results
As shown in the results table below, the proposed aggregation methods consistently outperform the standard baseline across all datasets.
- Consistent Improvement: Both AggSpan and AggSeq consistently outperformed the standard "Span" probability baseline. AggSeq, in particular, showed significant gains in reducing calibration error for non-null (Non-O) spans.
- Dramatic Error Reduction: On the MIT-R dataset, the baseline ECE for non-O spans was 0.119. Using AggSeq slashed this to 0.023—a nearly 5x improvement in reliability.
- Beam Search as a Statistical Tool: Usually, beam search is just a way to find the best output. This research re-frames it as a tool to measure model uncertainty by treating the top-$k$ candidates as a proxy for the model's full posterior distribution.
Conclusion and Future Work
By looking at the "runner-up" candidates in a beam search, generative models can provide far more reliable confidence estimates. While these methods add some computational overhead due to the nature of beam search, the gains in calibration are substantial. Future work may address the application of these techniques to more complex, nested span structures and explore ways to reduce the latency associated with deep beam searches.
Summary updated