mlsanityData to 7 Oct 2026

Transformer Uncertainty Estimation with Hierarchical Stochastic Attention

arXiv 2112.13776 ↗First posted 27 Dec 2021cs.CL cs.AIcited by 21

Not on the map. Why?

Abstract (arXiv)

Transformers are state-of-the-art in a wide range of NLP tasks and have also been applied to many real-world products. Understanding the reliability and certainty of transformer model predictions is crucial for building trustable machine learning applications, e.g., medical diagnosis. Although many recent transformer extensions have been proposed, the study of the uncertainty estimation of transformer models is under-explored. In this work, we propose a novel way to enable transformers to have the capability of uncertainty estimation and, meanwhile, retain the original predictive performance. This is achieved by learning a hierarchical stochastic self-attention that attends to values and a set of learnable centroids, respectively. Then new attention heads are formed with a mixture of sampled centroids using the Gumbel-Softmax trick. We theoretically show that the self-attention approximation by sampling from a Gumbel distribution is upper bounded. We empirically evaluate our model on two text classification tasks with both in-domain (ID) and out-of-domain (OOD) datasets. The experimental results demonstrate that our approach: (1) achieves the best predictive performance and uncertainty trade-off among compared methods; (2) exhibits very competitive (in most cases, improved) predictive performance on ID datasets; (3) is on par with Monte Carlo dropout and ensemble methods in uncertainty estimation on OOD datasets.

Key facts. Cited by 21 papers in the map (data through 7 Oct 2026). Builds on 33 of its 56 references that are in the map. First posted on arXiv 27 Dec 2021.

Builds on

33 of 56 references.

References · 33

  1. 2017Attention Is All You Needcited by 59,932
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  3. 2014Adam: A Method for Stochastic Optimizationcited by 36,960
  4. 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,160
  5. 2015Dropout as a Bayesian Approximation: Representing Model Uncertainty in Deep Learningcited by 4,416
  6. 2016Simple and Scalable Predictive Uncertainty Estimation using Deep Ensemblescited by 3,888
  7. 2016Categorical Reparameterization with Gumbel-Softmaxcited by 2,708
  8. 2016A Baseline for Detecting Misclassified and Out-of-Distribution Examples in Neural Networkscited by 2,362
  9. 2017What Uncertainties Do We Need in Bayesian Deep Learning for Computer Vision?cited by 2,335
  10. 2020Informer: Beyond Efficient Transformer for Long Sequence Time-Series Forecastingcited by 2,141
  11. 2016The Concrete Distribution: A Continuous Relaxation of Discrete Random Variablescited by 1,135
  12. 2018Neural Network Acceptability Judgmentscited by 952
21 more
  1. 2020Efficient Transformers: A Surveycited by 784
  2. 2021A Survey of Uncertainty in Deep Neural Networkscited by 675
  3. 2021Transformer in Transformercited by 632
  4. 2014Neural Turing Machinescited by 630
  5. 2015Variational Dropout and the Local Reparameterization Trickcited by 489
  6. 2020Pitfalls of In-Domain Uncertainty Estimation and Ensembling in Deep Learningcited by 208
  7. 2017On the Properties of the Softmax Function with Application in Game Theory and Reinforcement Learningcited by 136
  8. 2020Fast Transformers with Clustered Attentioncited by 123
  9. 2021Pre-trained Language Models in Biomedical Domain: A Systematic Surveycited by 87
  10. 2019'In-Between' Uncertainty in Bayesian Neural Networkscited by 79
  11. 2021H-Transformer-1D: Fast One-Dimensional Hierarchical Attention for Sequencescited by 47
  12. 2020Estimating Uncertainty and Interpretability in Deep Learning for Coronavirus (COVID-19) Detectioncited by 46
  13. 2020Doubly Stochastic Variational Inference for Neural Processes with Hierarchical Latent Variablescited by 33
  14. 2021Probabilistic Gradient Boosting Machines for Large-Scale Probabilistic Regressioncited by 20
  15. 2020Tactical Decision-Making in Autonomous Driving by Reinforcement Learning with Uncertainty Estimationcited by 14
  16. 2019State-Regularized Recurrent Neural Networkscited by 11
  17. 2020Conversations with Search Engines: SERP-based Conversational Response Generationcited by 11
  18. 2021Wizard of Search Engine: Access to Information Through Conversations with Search Enginescited by 11
  19. 2020Uncertainty Estimation and Calibration with Finite-State Probabilistic RNNscited by 9
  20. 2020The Monte Carlo Transformer: a stochastic self-attention model for sequence predictioncited by 6
  21. 2021Easy and Efficient Transformer : Scalable Inference Solution For large NLP modelcited by 5

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2022: 2; 2023: 5; 2024: 5; 2025: 7; 2026: 2.

21 papers.

Sort:

By area:

  1. 2023Calibration in Deep Learning: A Survey of the State-of-the-Artcited by 72
  2. 2023Uncertainty in Natural Language Processing: Sources, Quantification, and Applicationscited by 44
  3. 2025Energy-Based Transformers are Scalable Learners and Thinkerscited by 30
  4. 2024Interpreting Predictive Probabilities: Model Confidence or Human Label Variation?cited by 15
  5. 2025Uncertainty Quantification for Machine Learning in Healthcare: A Surveycited by 11
  6. 2024Calibrating Verbalized Probabilities for Large Language Modelscited by 9
  7. 2022Probabilistic Transformer: Modelling Ambiguities and Distributions for RNA Folding and Molecule Designcited by 7
  8. 2025Benchmarking Uncertainty and its Disentanglement in multi-label Chest X-Ray Classificationcited by 4
  9. 2026HyTRec: A Hybrid Temporal-Aware Attention Architecture for Long Behavior Sequential Recommendationcited by 4
  10. 2025Uncertainty-Instructed Structure Injection for Generalizable HD Map Constructioncited by 3
  11. 2025Multimodal Graph Representation Learning for Robust Surgical Workflow Recognition with Adversarial Feature Disentanglementcited by 3
  12. 2022State-Regularized Recurrent Neural Networks to Extract Automata and Explain Predictionscited by 2
9 more
  1. 2024S2-Track: A Simple yet Strong Approach for End-to-End 3D Multi-Object Trackingcited by 2
  2. 2025Dropouts in Confidence: Moral Uncertainty in Human-LLM Alignmentcited by 2
  3. 2026Calibrating Scientific Foundation Models with Inference-Time Stochastic Attentioncited by 1
  4. 2023On the Calibration and Uncertainty with P'olya-Gamma Augmentation for Dialog Retrieval Modelscited by 0
  5. 2023A Saliency-based Clustering Framework for Identifying Aberrant Predictionscited by 0
  6. 2023Stochastic Vision Transformers with Wasserstein Distance-Aware Attentioncited by 0
  7. 2024BayesJudge: Bayesian Kernel Language Modelling with Confidence Uncertainty in Legal Judgment Predictioncited by 0
  8. 2024Can Uncertainty Quantification Improve Learned Index Benefit Estimation?cited by 0
  9. 2025TCUQ: Single-Pass Uncertainty Quantification from Temporal Consistency with Streaming Conformal Calibration for TinyMLcited by 0