Source-linked AI summary

Posterior calibration and exploratory analysis for natural language processing models

Khanh Nguyen, Brendan O'Connor

arXiv:1508.05154v2cs.CL

TL;DR

NLP posterior probabilities are often evaluated indirectly, leaving their correspondence to empirical frequencies unclear. This paper develops a calibration analysis, applies it to common models, and propagates coreference uncertainty into political event-trend exploration. It argues that calibrated uncertainty can help indicate when downstream NLP analyses deserve trust.

  • Problem

    NLP systems are imperfect, while evaluating only top predictions or downstream tasks makes it difficult to assess whether posterior probabilities reflect empirical frequencies.

  • Method

    The paper develops an NLP calibration analysis, applies it to common tagging and classification models, and samples coreference resolutions to propagate uncertainty into event-frequency estimates.

  • Results

    The paper demonstrates direct calibration evaluation and a coreference-based method that produces posterior event-frequency distributions and confidence intervals for political trends.

  • Takeaways & Limitations

    Calibrated uncertainty can support exploratory analysis by indicating when political event trends have high posterior variance and should be treated cautiously.

  • Takeaways & Limitations

    Calibration analysis remains sensitive to bin-size selection, and further work is needed to address unresolved questions.

Abstract

from arXiv · show

Many models in natural language processing define probabilistic distributions over linguistic structures. We argue that (1) the quality of a model' s posterior distribution can and should be directly evaluated, as to whether probabilities correspond to empirical frequencies, and (2) NLP uncertainty can be projected not only to pipeline components, but also to exploratory data analysis, telling a user when to trust and not trust the NLP analysis. We present a method to analyze calibration, and apply it to compare the miscalibration of several commonly used models. We also contribute a coreference sampling algorithm that can create confidence intervals for a political event extraction task.

1 Introduction

NLP models are useful but imperfect, and top-prediction evaluation does not reveal whether their posterior probabilities reflect actual uncertainty. The paper proposes direct calibration analysis and propagates calibrated uncertainty into exploratory political event analysis.

  • Motivation: NLP analyzers mis-identify entities, syntactic relations, and coreference roughly 10–40% of the time, yet support downstream language analysis.Their outputs can serve as soft, noisy indicators for tasks including question answering, translation, event extraction, and narrative analysis.
  • Motivation: Evaluating only a single most-probable structure or downstream task makes posterior miscalibration difficult to diagnose.Probabilistic models also assign mass to lower-probability alternative structures.
  • Motivation: Overconfident posteriors overweight top predictions and systematically undersample alternative structures.This reduces the potential benefit of passing multiple structures or samples through downstream analyses.
  • Contributions: The paper directly evaluates posterior calibration, asking whether predicted probabilities match empirical frequencies rather than requiring perfect accuracy.A calibrated model predicting 80% confidence is correct about 80% of the time, even if its accuracy is imperfect.
  • Contributions: The authors develop an NLP calibration method, compare common generative and discriminative tagging and classification models, and sample coreference uncertainty for political event trends.The sampling procedure induces posterior distributions over event frequencies, including confidence intervals when trends have high variance.

2 Definition of calibration

Calibration measures whether predicted probabilities correspond to empirical label frequencies, while refinement measures label separation; this paper focuses on calibration and estimates it with adaptive binning and RMS error.

  • Calibration: The paper measures miscalibration with root mean squared calibration error based on the Brier score.The Brier score is mean squared error for binary labels, and its decomposition separates calibration from refinement.
  • Calibration: Calibration measures how closely probabilistic predictions match their corresponding empirical label frequencies.The paper distinguishes empirical frequencies from the model-generated prediction strengths.
  • Calibration: Perfect calibration requires P(y = 1 | q) = q for every prediction strength q.Among instances assigned q, the positive label should occur at q percent frequency.
  • Calibration and refinement: Refinement measures how well predictions separate labels, whereas calibration measures agreement between predicted and empirical probabilities.The paper focuses on calibration rather than refinement.
  • Estimation: Adaptive binning sorts prediction-label pairs, forms bins around a target size, and computes bin-size-weighted RMS calibration error.The final undersized bin is merged with the preceding bin when possible.
  • Estimation: Calibration-error estimation can be unreliable near probability 0 because both empirical frequencies and predictions are estimated.The paper notes this concern when contrasting Brier-based error with cross-entropy.

3 Empirical calibration analysis

The paper estimates calibration from finite labeled data using adaptive binning and simulation-based confidence intervals, then visualizes how predicted probabilities align with empirical frequencies.

  • Calibration estimation: Fixed-width bins can yield unreliable calibration estimates for skewed NLP prediction distributions, motivating adaptive binning.Evenly spaced bins may contain uneven numbers of observations, producing wide confidence intervals.
  • Calibration estimation: Adaptive binning assigns an equal number of prediction-label pairs to each bin and widens bins where data are sparse.This provides roughly similar standard errors across the prediction range and can be applied to probabilistic models.
  • Confidence intervals: The confidence-interval procedure simulates label frequencies within bins and aggregates the resulting calibration errors.The reported intervals use a binomial normal approximation, with β ≥200 justified by the central limit theorem.
  • Visualization: Calibration curves compare empirical label frequency with predicted strength; the y = x diagonal represents perfect calibration.Curves above the diagonal indicate underconfidence, while curves below it indicate overconfidence.
  • Visualization: Calibration plots also reveal prediction refinement through the distribution and clustering of points across the curve.Clustering near the bottom-left and top-right corners implies more refined predictions.

4 Calibration for classification and tagging models

The paper applies calibration analysis to binary classification and POS tagging, showing that task performance and posterior calibration can favor different models. Across tagging experiments, calibration patterns vary by model, label, and prediction unit.

  • Binary classification: Logistic regression has lower calibration error than Naive Bayes despite a slightly lower F-1 score.Naive Bayes scores 73.8% F-1 versus logistic regression’s 72.9%, while RMSE is 0.105 versus 0.041.
  • Binary classification: Both binary classifiers are underconfident at lower prediction strengths and overconfident at higher strengths, more strongly for Naive Bayes.The comparison uses a Twitter task predicting whether tweets are “happy.”
  • Single-word tagging: For single-word POS tags, HMM is generally underconfident whereas CRF is overconfident, and CRF has lower overall calibration error.The models are compared on marginal probabilities of individual token tags computed with forward-backward.
  • Single-word tagging: CRF is better calibrated than HMM for 39 of 47 individual POS-tag categories, although the models are about equally calibrated on NN.The calibration gap differs across tag categories.
  • Two-consecutive-word tagging: For two-consecutive-word tag pairs, CRF is generally better calibrated, but HMM performs better in 29 of 100 categories.The analysis evaluates the 5 and 100 most frequent tag pairs.
  • Overall comparison: The tagging experiments show that different models can have different calibration levels depending on the application.The study examines both single-token and consecutive-tag posterior marginals.

5 Coreference resolution

This section introduces a sampling-based antecedent coreference model and evaluates whether its pairwise posterior predictions are calibrated.

  • 5.1 Antecedent selection model: The model represents each mention’s antecedent choice as a locally normalized distribution over previous mentions or NEW, then forms entity clusters by connected components.The resulting clustering distribution is non-parametric because the number of clusters is not fixed in advance.
  • 5.2 Sampling-based inference: Independent sampling of antecedent decisions followed by connected-component construction produces samples from the joint entity-clustering distribution.The procedure avoids burn-in and autocorrelation questions associated with approximate Markov chain Monte Carlo sampling and is very fast.
  • 5.3 Calibration analysis: Pairwise calibration compares each mention pair’s sampled coreference probability with its gold-standard coreference label frequency.Each probability is estimated from 1,000 samples by taking the fraction in which the pair is coreferent.
  • 5.3 Calibration analysis: Less than 1% CalibErr was measured on 4.3 million prediction-label pairs from 404 English CoNLL-2011 development documents.The model was slightly overconfident for middle- to high-valued predictions and was the most calibrated model examined in the paper.

6 Uncertainty in Entity-based Exploratory Analysis

The paper propagates coreference uncertainty into entity-based event-count analysis by rerunning extraction over sampled clusterings. Credible intervals reveal when apparent temporal or cross-country differences are not conclusive because of coreference uncertainty.

  • 6.1 Event extraction: Coreference samples induce a posterior distribution over event counts for country-affiliated attack events extracted from unannotated news.The query counts New York Times articles in each three-month period whose entities satisfy the country-affiliation and attack-agent rules.
  • 6.1 Event extraction: The analysis uses 100 coreference samples per article across 193,403 Annotated New York Times LDC articles from 1987 to 2007.For each country and quarter, the posterior mean is paired with a normal-approximation 95% interval, m ± 1.96 s.
  • 6.2 Results: Credible intervals show that USA event-count fluctuations from 1 to 5 documents during 1993–1996 may reflect coreference noise rather than real differences.A 1-best analysis would show the fluctuations without indicating that the model is uncertain about their reality.
  • 6.2 Results: Overlapping mid-1999 Yugoslavia and NATO intervals prevent a conclusive comparison of which side received more attack-event attention.If coreference probabilities were overconfident, the resulting intervals would be too narrow and could lead to incorrect interpretations.
  • 6.2 Results: Visualized uncertainty preserves ambiguities unresolved by the NLP system and highlights where exploratory event analyses may be wrong or imprecise.The same uncertainty can support error analysis: calibrated predictions near 50% identify documents with difficult coreference cases.

7 Conclusion

The paper argues that calibrated posterior predictions are directly evaluable and useful for propagating uncertainty into downstream exploratory analysis. It also identifies unresolved questions about calibration’s broader inferential benefits and methods for estimating calibration error.

  • The paper presents calibrated posterior uncertainty as a desirable property of probabilistic NLP models and demonstrates its propagation into downstream exploratory analysis.
  • Posterior simulation is related to posterior predictive checking, which uses a posterior to test model assumptions.
  • More effective nonparametric regression methods, including Gaussian processes or bootstrapped kernels, remain a future direction for estimating and visualizing calibration error.
  • The paper leaves open which inferences are facilitated by correct calibration, including confidence-interval quality and joint pipeline inference.
  • Further work is necessary to address these and other questions about calibration.

1 Sampling a deterministic function of a random variable

The paper samples deterministic functions of uncertain variables by applying the functions to Monte Carlo samples, thereby approximating their induced posterior distributions. This supports uncertainty propagation through calibration, coreference, and event-analysis computations.

  • A deterministic function g(X) becomes a random variable when X is random, and its distribution can be approximated by Monte Carlo samples.
  • Equation 8 follows from g(x) being deterministic, while Equation 9 approximates its distribution using S samples from P(x).
  • Applying g to samples from P(X) yields samples from P(g(X)), which the event analysis treats as the posterior distribution of its counting function.
  • The same sampling principle propagates uncertainty through calibration error, coreference entity clusterings, and event-counting pipelines.
  • With 100 samples, Monte Carlo uncertainty in the posterior mean is ten times smaller than the standard deviation represented by the time-series credible interval.

2 Normalization in the coreference model

The coreference model’s factorization makes its probabilities independent and permits local normalization. This independence justifies sampling from the joint posterior independently.

  • The model is presented as a globally normalized but fully factorized conditional random field.
  • Because each factor decomposes independently for each antecedent variable, the probabilities can be rewritten with local normalization.
  • The independence interpretation justifies drawing joint-posterior samples independently.

3 Event analysis: Corpus selection, country affiliation, and parsing

The event analysis uses filtered New York Times world-news articles, country-name matching, fixed linguistic annotations, and syntactic relations to define attack-event extraction rules. Posterior time series summarize country-level event counts with uncertainty intervals.

  • Corpus selection: Articles are selected from the New York Times Annotated Corpus using world-news labels, excluding sports and opinion articles and requiring a country-name mention.
  • Country affiliation: Country affiliation is determined by case-insensitive country-name matching with light stemming against a country dictionary.
  • Parsing: Part-of-speech tags, named entities, and constituent and dependency parses are produced with Stanford CoreNLP 3.5.2 and treated as fixed.
  • Parsing: Extraction rules use frequencies of syntactic dependencies within country-affiliated entities to identify high-coverage relations for the attack rule.
  • Event analysis: Posterior time-series graphs report country-level event counts with posterior means and 95% posterior credibility intervals, aggregated monthly in the appendix.
Loading 1508.05154v2…