A Semantic-Sampling Framework for Evaluating Calibration in Open-Ended Question Answering

Zhanliang Wang, Jiancong Xiao, Ruochen Jin, Shu Yang, Bojian Hou, Li Shen

TL;DR

Evaluating whether a large language model (LLM) "knows what it doesn't know" is notoriously difficult in open-ended settings where answers are free-form and commercial APIs hide internal probabilities. This paper introduces Sem-ECE (Semantic-Sampling Expected Calibration Error), a black-box framework that clusters sampled model responses into semantic classes to rigorously quantify confidence. By introducing a held-out sampling variant (Sem2-ECE), the authors successfully eliminate the statistical "winner's curse," providing a provably unbiased and more accurate calibration metric for modern LLMs.

What Problem Does This Paper Address?

Model calibration measures how well a system’s self-reported confidence aligns with its actual accuracy. In high-stakes fields like medicine or law, poor calibration means a model might confidently output a dangerous hallucination without triggering any warning systems.

While calibration is easy to measure in multiple-choice settings using token logits (internal probabilities), it breaks down in realistic, open-ended question answering (QA). Open-ended QA presents three major challenges:

  1. Unbounded Answer Space: Two completely different strings (e.g., "seven" and "7") can mean the exact same thing.
  2. Hidden Logits: Leading commercial LLM providers often hide internal token probabilities behind black-box APIs.
  3. Unreliable Self-Reporting: Asking an LLM to state its confidence directly ("verbalized confidence") typically results in extreme overconfidence.

Existing sampling-based methods attempt to use answer consistency as a proxy for confidence, but they rely on brittle, task-specific regular expressions and lack solid statistical foundations.

Methods

The authors propose Sem-ECE, a framework that estimates calibration purely through behavioral sampling:

  1. Generate: Sample multiple independent free-form responses from the LLM for a given question.
  2. Cluster: Use an advanced LLM judge to group these responses into distinct semantic equivalence classes (e.g., grouping all variations of the correct answer together).
  3. Score: Compute confidence based on the generation frequencies of these semantic classes.

Within this framework, the paper analyzes two distinct estimators:

  • Sem1-ECE (Same-Sample): This approach selects the most frequent semantic answer from a batch of samples and uses that same frequency as the confidence score. However, this suffers from the classical winner's curse (an upward Jensen bias)—random sampling noise makes the top answer look more dominant than it actually is.
  • Sem2-ECE (Held-Out): To fix this, the authors decouple selection from evaluation. They split the samples into two disjoint blocks: block $N$ selects the favorite answer, and block $E$ measures its frequency to determine confidence. This eliminates the upward bias, trading it for a much smaller, downward selection bias.
Figure 1: (a) Regime diagram on the ( ˜mq, Kq) plane, partitioned by the JDR boundary ˜mq = 2˜λ⋆

Datasets

The framework was validated across fifteen distinct model-benchmark pairs using three diverse open-ended QA datasets:

  • SimpleQA: A benchmark targeting short-form factoid accuracy.
  • HLE (Humanity's Last Exam): A highly challenging, expert-level multidisciplinary benchmark.
  • PopQA: A dataset focusing on long-tail, entity-centric knowledge.

Evaluations were conducted using five frontier commercial engines: OpenAI gpt-5.4, Anthropic claude-opus-4.6, Google gemini-3.1-flash-lite-preview, xAI grok-4.20-0309, and Mistral mistral-large-latest.

Key Insights and Ideas

  • Asymptotic Unbiasedness: The authors mathematically prove that both Sem1 and Sem2 are asymptotically unbiased as the number of samples grows, placing sampling-based calibration on a firm theoretical footing.
  • The Hard-Question Divergence: On easy questions with a clear correct answer, Sem1 and Sem2 yield identical results. However, on difficult, low-margin questions, Sem2 strictly outperforms Sem1 by mitigating the winner's curse.
  • Difficulty Diagnostic: Because the two estimators behave differently depending on answer margins, the mathematical gap between Sem1-ECE and Sem2-ECE serves as a reliable, observable diagnostic tool for question difficulty.
Convergence of Sem1 and Sem2 estimators

Key Results

  • Sem2 Superiority: Sem2-ECE achieved a lower or equal calibration error compared to Sem1-ECE across all 15 model-benchmark pairs.
  • Outperforming Verbalization: Sem2-ECE drastically outperformed traditional verbalized confidence in 12 out of 15 evaluations. For example, on the difficult HLE dataset, verbalized confidence metrics showed massive distortions (errors up to 0.81), while Sem2 accurately tracked the true behavioral calibration error.
  • Empirical Validation: Stratification experiments perfectly matched the authors' theoretical proofs, showing that the performance gap between the two estimators concentrates precisely in low-margin, high-difficulty question regimes.
Stratification by per-question margin

Limitations and Future Work

  • Judge Dependency: The framework relies heavily on an external LLM judge to perform semantic clustering. If the judge misclusters the answers, the confidence frequencies will be skewed.
  • Agreement vs. Truth: Sem-ECE measures semantic consistency (how often the model agrees with itself). If a model is stubbornly and consistently wrong on a specific fact, it will register high confidence despite zero accuracy. The authors note that combining Sem2-ECE with independent factual accuracy signals remains an important frontier for future work.

Summary updated

BibTeX
@inproceedings{wang2026semantic,
  author = {Zhanliang Wang and Jiancong Xiao and Ruochen Jin and Shu Yang and Bojian Hou and Li Shen},
  title = {{A Semantic-Sampling Framework for Evaluating Calibration in Open-Ended Question Answering}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=tL3fAjECyx},
}
Figure