Hybrid Uncertainty Quantification for Selective Text Classification in Ambiguous Tasks

Artem Vazhentsev, Gleb Kuzmin, Akim Tsvigun, Alexander Panchenko, Maxim Panov, Mikhail Burtsev, Artem Shelmanov

Introduction

In real-world natural language processing (NLP), particularly in subjective domains like toxicity detection or sentiment analysis, model predictions are often clouded by two distinct types of uncertainty. Aleatoric uncertainty arises from inherent ambiguity or noise in the data—for instance, a comment that one person finds offensive while another considers a joke. Epistemic uncertainty, conversely, stems from a lack of model knowledge, occurring when the system encounters data significantly different from its training set (out-of-distribution, or OOD).

While state-of-the-art uncertainty estimation (UE) methods excel at identifying OOD instances, they frequently struggle with ambiguous in-distribution (AID) cases. This paper introduces Hybrid Uncertainty Quantification (HUQ), a novel framework designed to integrate both uncertainty types to improve selective classification—the ability of a model to abstain from a prediction and defer to human review when confidence is low.

The HUQ Framework

The core innovation of HUQ lies in its ability to dynamically switch between or combine different uncertainty "lenses" based on the nature of the input. The process follows three primary steps:

  1. Categorization: Inputs are first partitioned into three categories: In-Distribution (ID) for clear cases, Ambiguous In-Distribution (AID) for familiar but borderline data, and Out-of-Distribution (OOD) for unfamiliar data.
  2. Ranking-Based Scoring: To normalize disparate uncertainty metrics (e.g., density scores vs. entropy), HUQ converts raw values into ranks relative to a reference dataset. This allows for a unified comparison on a scale from 0 to 1.
  3. Hybrid Logic: The final uncertainty score is determined by the category. For ID and AID instances, the system prioritizes aleatoric signals (like Softmax Response). For OOD instances, it employs a weighted linear combination of both epistemic and aleatoric ranks.
Comparison of uncertainty quantification methods on a 2D synthetic dataset. HUQ variants effectively combine aleatoric (SR, Entropy) and epistemic (MD, RDE) signals.

HUQ is designed as a "plug-and-play" module, compatible with various base epistemic methods such as Mahalanobis Distance (MD) or Robust Density Estimation (RDE).

Experimental Evaluation

The researchers evaluated HUQ across eight datasets, including five toxicity/hate speech benchmarks (e.g., TOXIGEN, JIGSAW) and three general classification tasks (e.g., 20 NEWS GROUPS, SST-5). The primary performance metric was the Area Under the Risk-Coverage curve (AUC-RC), where a lower score indicates a more effective identification of potential errors during data rejection.

Key Results

  • Performance Gains: HUQ-MD and HUQ-RDE consistently outperformed standard baselines. On the 20 NEWS GROUPS dataset using an ELECTRA backbone, HUQ achieved a 13.0% reduction in AUC-RC compared to non-hybrid methods.
  • Efficiency: Despite its performance, HUQ adds less than 5% computational overhead to single-model inference. Remarkably, it often matched or exceeded the performance of "Deep Ensembles"—the traditional gold standard for UE—which require running multiple models and are significantly more expensive.
  • Robustness: The method proved stable across different transformer architectures, including BERT and ELECTRA, unlike many deterministic UE methods that exhibit high variance across datasets.

Discussion and Conclusion

A significant finding of this work is the prevalence of ambiguity in subjective tasks; in toxicity detection, for example, ambiguous instances can make up over 90% of toxic labels. By explicitly modeling this ambiguity alongside epistemic gaps, HUQ provides a more reliable mechanism for selective classification.

However, the authors note a limitation regarding covariate shift. When test data deviates extremely from the training distribution, the relative benefit of the hybrid approach diminishes as the model's errors become dominated by a total lack of knowledge rather than data ambiguity. Future research will focus on enhancing the framework's resilience to these large distributional shifts.

In conclusion, HUQ offers a computationally efficient and highly effective solution for deploying NLP models in sensitive, real-world environments where knowing when to "ask for help" is as important as the prediction itself.

Summary updated

BibTeX
@inproceedings{vazhentsev2023hybrid,
  author = {Artem Vazhentsev and Gleb Kuzmin and Akim Tsvigun and Alexander Panchenko and Maxim Panov and Mikhail Burtsev and Artem Shelmanov},
  title = {{Hybrid Uncertainty Quantification for Selective Text Classification in Ambiguous Tasks}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.acl-long.652},
}
Figure