TL;DR
This paper investigates calibration in semantic parsing—the task of translating natural language into executable code. The authors find a striking "domain gap": while models for task-oriented dialogue are relatively well-calibrated, text-to-SQL models are dangerously overconfident, especially as inputs become more difficult or unfamiliar.
What Problem Does This Paper Address?
When a digital assistant or a robot receives a command, it translates that request into a program (semantic parsing). If the model is 90% sure it understood you, it should be right 90% of the time. This is called calibration.
In safety-critical or "executable" domains—like a robot moving an object or a system querying a private database—calibration is vital. If a model has low confidence, it should defer to a human or ask for clarification. However, most research on calibration focuses on simple classification (one-step decisions). Semantic parsing is a sequence generation task, where a single mistake in a long string of code can render the whole program useless. This paper explores how well current state-of-the-art models actually know what they don't know.
Methods
The authors evaluate several model architectures across two paradigms:
- Fine-tuning: Taking pre-trained models like T5 and BART and training them on specific parsing datasets. They also include MISO, a specialized "transductive" parser that predicts graph structures.
- In-Context Learning (ICL): Using large "few-shot" models like Codegen (up to 16B parameters) to predict programs based on just a few examples, without weight updates.
To measure calibration, they use Expected Calibration Error (ECE) with adaptive binning. This technique groups predictions by confidence levels to see if the accuracy matches the predicted probability. Crucially, for sequence-level confidence, they compare two aggregation methods: taking the mean of token probabilities versus the minimum (the "weakest link" approach).
Datasets
The study covers four major benchmarks across two domains:
- Task-Oriented Dialogue (TOD): SMCalFlow and TreeDST (predicting Lisp-like programs for calendar/travel tasks).
- Text-to-SQL: Spider and CoSQL (predicting SQL queries for databases).
The authors also introduce new "HARD" and "EASY" challenge splits for the TOD datasets. These are created by identifying examples where an ensemble of models consistently shows low confidence, providing a more rigorous testbed for future research.
Key Insights and Ideas
- The Domain Gap: Models are significantly better calibrated on TOD tasks than on SQL tasks. Even when trained on the same amount of data, SQL models remain stubbornly overconfident.
- The "Weakest Link" Wins: For sequence generation, using the
minprobability of any token in the sequence is a much better indicator of overall success than themean. Themeantends to "wash out" a single catastrophic error with a sea of high-confidence syntactic tokens (like parentheses or keywords). - Difficulty Breeds Overconfidence: In the SQL domain, as inputs become more "Out-of-Distribution" (OOD) or complex, models actually become more overconfident in their (often wrong) predictions. In contrast, TOD models correctly lower their confidence as perplexity increases.
- Syntactic "Error Spikes": The authors noticed spikes in calibration error in high-confidence regions. These are often driven by common syntactic tokens (like commas or brackets) that the model learns to predict with near-certainty, even when the surrounding logic is failing.
Key Results
- TOD Performance: Fine-tuned models like T5-small achieved an ECE as low as 1.27 on SMCalFlow.
- SQL Performance: The same architectures performed much worse on Spider, with T5-small hitting an ECE of 7.64—nearly six times higher error in confidence estimation.
- Few-Shot vs. Fine-Tuned: Large ICL models (Codegen) are generally less calibrated than their fine-tuned counterparts, showing calibration curves similar to BART-large but with lower overall accuracy.
- Execution vs. Exact Match: When evaluating SQL, the authors found that "Execution Accuracy" (does the code work?) is better calibrated than "Exact Match" (does the code look exactly like the gold standard?). This suggests that models are often "right" in spirit even when they fail a rigid string comparison.
Limitations and Future Work
The study is limited to English-language datasets and Transformer-based architectures. The authors acknowledge that while they used adaptive binning to make ECE more robust, it remains a somewhat "brittle" metric.
Future work could explore:
- Cross-lingual calibration: Do these trends hold in morphologically rich languages?
- Interactive Parsing: How can these confidence scores be used in real-time to trigger clarification questions to a user?
- Tool-use: As LLMs are increasingly augmented with "tools" (APIs), understanding the calibration of those short program calls will be essential for system reliability.
Summary updated