Uncertainty in Natural Language Processing: Sources, Quantification, and Applications

Mengting Hu, Zhen Zhang, Shiwan Zhao, Minlie Huang, Bingzhe WuarXiv 2023 · DOI

Introduction

Deep Neural Networks (DNNs) have fundamentally transformed Natural Language Processing (NLP), yet they often operate as "black boxes" that produce overconfident and sometimes incorrect predictions. In safety-critical domains like medical diagnosis or autonomous systems, an incorrect but confident answer can lead to catastrophic outcomes. This paper provides a comprehensive survey of uncertainty in NLP, establishing a systematic framework for understanding why models fail and how we can measure their doubt.

A Taxonomy of Uncertainty Sources

Uncertainty in NLP is not a monolithic concept; it arises from various stages of the modeling pipeline. The authors propose a three-stage taxonomy to categorize these sources:

  1. Input Uncertainty: Stemming from inherent language ambiguity (e.g., polysemy), noise, or out-of-vocabulary (OOV) tokens.
  2. System Uncertainty: Derived from model architecture, parameter scale, training biases, or hyperparameters.
  3. Output Uncertainty: Related to the complexity of the task, such as the infinite search space in generative paradigms versus fixed categories in classification.
Taxonomy of uncertainty sources across input, system, and output stages.

Quantifying Uncertainty: Modeling Approaches

The survey categorizes uncertainty quantification into three primary modeling frameworks, each offering different trade-offs between computational cost and statistical rigor.

Three primary modeling approaches for uncertainty quantification: calibration, sampling, and distribution-based models.

1. Calibration-based Methods

These methods aim to align a model’s confidence score with its actual empirical probability of being correct. Techniques like Temperature Scaling (TS) smooth output distributions post-hoc, while Conformal Prediction (CP) provides statistically backed confidence intervals.

2. Sampling-based Methods

These involve multiple inference passes to observe variance in outputs. Monte Carlo (MC) Dropout randomly disables neurons during inference, while Ensemble Methods utilize multiple independent models to reach a consensus. If the answers vary significantly across samples, the model is considered uncertain.

3. Distribution-based Methods

These treat model parameters or outputs as probability distributions rather than single points. Examples include Dirichlet-based Uncertainty (DBU) and Gaussian Processes (GPs), which explicitly model the "vacuity" or lack of knowledge due to insufficient training data.

Key Insights and Applications

Uncertainty estimation is not just a theoretical exercise; it enables several practical enhancements to NLP systems:

  • Selective Prediction (Abstention): In high-stakes scenarios, models can be programmed to "abstain" or defer to a human expert if uncertainty exceeds a specific threshold. This ensures safety by preventing the model from guessing on critical queries.
  • Efficiency via Early Exit: Models like FastBERT use uncertainty to determine if a prediction is sufficiently certain at an early layer, allowing the system to skip remaining computations and save energy.
  • Active Learning: Uncertainty can guide data collection by identifying which unlabeled examples would be most informative for the model to learn from, potentially reducing labeling requirements by 20-50% while maintaining performance.

Results and Future Directions

While Large Language Models (LLMs) generally show better "out-of-the-box" calibration than smaller predecessors, they remain prone to miscalibration when encountering new, unseen domains. Furthermore, quantifying uncertainty in text generation remains a significant challenge due to the infinite output space and the need to measure "semantic uncertainty"—determining if different phrasings convey the same underlying meaning.

Future research must address the scalability of these methods for billion-parameter models and explore "moral uncertainty," where systems recognize subjective or ethical dilemmas that lack a single correct answer.

Summary updated

BibTeX
@misc{hu2023uncertainty,
  author = {Mengting Hu and Zhen Zhang and Shiwan Zhao and Minlie Huang and Bingzhe Wu},
  title = {{Uncertainty in Natural Language Processing: Sources, Quantification, and Applications}},
  year = {2023},
  eprint = {2306.04459},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2306.04459},
}
Figure