Transformer Uncertainty Estimation with Hierarchical Stochastic Attention
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
- 2017Attention Is All You Needcited by 59,932
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2014Adam: A Method for Stochastic Optimizationcited by 36,960
- 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,160
- 2015Dropout as a Bayesian Approximation: Representing Model Uncertainty in Deep Learningcited by 4,416
- 2016Simple and Scalable Predictive Uncertainty Estimation using Deep Ensemblescited by 3,888
- 2016Categorical Reparameterization with Gumbel-Softmaxcited by 2,708
- 2016A Baseline for Detecting Misclassified and Out-of-Distribution Examples in Neural Networkscited by 2,362
- 2017What Uncertainties Do We Need in Bayesian Deep Learning for Computer Vision?cited by 2,335
- 2020Informer: Beyond Efficient Transformer for Long Sequence Time-Series Forecastingcited by 2,141
- 2016The Concrete Distribution: A Continuous Relaxation of Discrete Random Variablescited by 1,135
- 2018Neural Network Acceptability Judgmentscited by 952
21 more
- 2020Efficient Transformers: A Surveycited by 784
- 2021A Survey of Uncertainty in Deep Neural Networkscited by 675
- 2021Transformer in Transformercited by 632
- 2014Neural Turing Machinescited by 630
- 2015Variational Dropout and the Local Reparameterization Trickcited by 489
- 2020Pitfalls of In-Domain Uncertainty Estimation and Ensembling in Deep Learningcited by 208
- 2017On the Properties of the Softmax Function with Application in Game Theory and Reinforcement Learningcited by 136
- 2020Fast Transformers with Clustered Attentioncited by 123
- 2021Pre-trained Language Models in Biomedical Domain: A Systematic Surveycited by 87
- 2019'In-Between' Uncertainty in Bayesian Neural Networkscited by 79
- 2021H-Transformer-1D: Fast One-Dimensional Hierarchical Attention for Sequencescited by 47
- 2020Estimating Uncertainty and Interpretability in Deep Learning for Coronavirus (COVID-19) Detectioncited by 46
- 2020Doubly Stochastic Variational Inference for Neural Processes with Hierarchical Latent Variablescited by 33
- 2021Probabilistic Gradient Boosting Machines for Large-Scale Probabilistic Regressioncited by 20
- 2020Tactical Decision-Making in Autonomous Driving by Reinforcement Learning with Uncertainty Estimationcited by 14
- 2019State-Regularized Recurrent Neural Networkscited by 11
- 2020Conversations with Search Engines: SERP-based Conversational Response Generationcited by 11
- 2021Wizard of Search Engine: Access to Information Through Conversations with Search Enginescited by 11
- 2020Uncertainty Estimation and Calibration with Finite-State Probabilistic RNNscited by 9
- 2020The Monte Carlo Transformer: a stochastic self-attention model for sequence predictioncited by 6
- 2021Easy and Efficient Transformer : Scalable Inference Solution For large NLP modelcited by 5
Built on by
Citing papers per year: 2022: 2; 2023: 5; 2024: 5; 2025: 7; 2026: 2.
21 papers.
Sort:
By area:
- 2023Calibration in Deep Learning: A Survey of the State-of-the-Artcited by 72
- 2023Uncertainty in Natural Language Processing: Sources, Quantification, and Applicationscited by 44
- 2025Energy-Based Transformers are Scalable Learners and Thinkerscited by 30
- 2024Interpreting Predictive Probabilities: Model Confidence or Human Label Variation?cited by 15
- 2025Uncertainty Quantification for Machine Learning in Healthcare: A Surveycited by 11
- 2024Calibrating Verbalized Probabilities for Large Language Modelscited by 9
- 2022Probabilistic Transformer: Modelling Ambiguities and Distributions for RNA Folding and Molecule Designcited by 7
- 2025Benchmarking Uncertainty and its Disentanglement in multi-label Chest X-Ray Classificationcited by 4
- 2026HyTRec: A Hybrid Temporal-Aware Attention Architecture for Long Behavior Sequential Recommendationcited by 4
- 2025Uncertainty-Instructed Structure Injection for Generalizable HD Map Constructioncited by 3
- 2025Multimodal Graph Representation Learning for Robust Surgical Workflow Recognition with Adversarial Feature Disentanglementcited by 3
- 2022State-Regularized Recurrent Neural Networks to Extract Automata and Explain Predictionscited by 2
9 more
- 2024S2-Track: A Simple yet Strong Approach for End-to-End 3D Multi-Object Trackingcited by 2
- 2025Dropouts in Confidence: Moral Uncertainty in Human-LLM Alignmentcited by 2
- 2026Calibrating Scientific Foundation Models with Inference-Time Stochastic Attentioncited by 1
- 2023On the Calibration and Uncertainty with P'olya-Gamma Augmentation for Dialog Retrieval Modelscited by 0
- 2023A Saliency-based Clustering Framework for Identifying Aberrant Predictionscited by 0
- 2023Stochastic Vision Transformers with Wasserstein Distance-Aware Attentioncited by 0
- 2024BayesJudge: Bayesian Kernel Language Modelling with Confidence Uncertainty in Legal Judgment Predictioncited by 0
- 2024Can Uncertainty Quantification Improve Learned Index Benefit Estimation?cited by 0
- 2025TCUQ: Single-Pass Uncertainty Quantification from Temporal Consistency with Streaming Conformal Calibration for TinyMLcited by 0
- 2026Calibrating Scientific Foundation Models with Inference-Time Stochastic Attention21 Apr 2026
- 2026HyTRec: A Hybrid Temporal-Aware Attention Architecture for Long Behavior Sequential Recommendation20 Feb 2026
- 2025Dropouts in Confidence: Moral Uncertainty in Human-LLM Alignment17 Nov 2025
- 2025TCUQ: Single-Pass Uncertainty Quantification from Temporal Consistency with Streaming Conformal Calibration for TinyML18 Aug 2025
- 2025Benchmarking Uncertainty and its Disentanglement in multi-label Chest X-Ray Classification6 Aug 2025
- 2025Energy-Based Transformers are Scalable Learners and Thinkers2 Jul 2025
- 2025Uncertainty Quantification for Machine Learning in Healthcare: A Survey4 May 2025
- 2025Multimodal Graph Representation Learning for Robust Surgical Workflow Recognition with Adversarial Feature Disentanglement3 May 2025
- 2025Uncertainty-Instructed Structure Injection for Generalizable HD Map Construction29 Mar 2025
- 2024Can Uncertainty Quantification Improve Learned Index Benefit Estimation?23 Oct 2024
- 2024Calibrating Verbalized Probabilities for Large Language Models9 Oct 2024
- 2024S2-Track: A Simple yet Strong Approach for End-to-End 3D Multi-Object Tracking4 Jun 2024
9 more
- 2024BayesJudge: Bayesian Kernel Language Modelling with Confidence Uncertainty in Legal Judgment Prediction16 Apr 2024
- 2024Interpreting Predictive Probabilities: Model Confidence or Human Label Variation?25 Feb 2024
- 2023Stochastic Vision Transformers with Wasserstein Distance-Aware Attention30 Nov 2023
- 2023A Saliency-based Clustering Framework for Identifying Aberrant Predictions11 Nov 2023
- 2023Calibration in Deep Learning: A Survey of the State-of-the-Art2 Aug 2023
- 2023Uncertainty in Natural Language Processing: Sources, Quantification, and Applications5 Jun 2023
- 2023On the Calibration and Uncertainty with P'olya-Gamma Augmentation for Dialog Retrieval Models15 Mar 2023
- 2022State-Regularized Recurrent Neural Networks to Extract Automata and Explain Predictions10 Dec 2022
- 2022Probabilistic Transformer: Modelling Ambiguities and Distributions for RNA Folding and Molecule Design27 May 2022
- 2025Energy-Based Transformers are Scalable Learners and Thinkerscited by 30
- 2023Calibration in Deep Learning: A Survey of the State-of-the-Artcited by 72
- 2023Uncertainty in Natural Language Processing: Sources, Quantification, and Applicationscited by 44
- 2024Interpreting Predictive Probabilities: Model Confidence or Human Label Variation?cited by 15
- 2025Uncertainty Quantification for Machine Learning in Healthcare: A Surveycited by 11
- 2024Calibrating Verbalized Probabilities for Large Language Modelscited by 9
- 2022Probabilistic Transformer: Modelling Ambiguities and Distributions for RNA Folding and Molecule Designcited by 7
- 2025Benchmarking Uncertainty and its Disentanglement in multi-label Chest X-Ray Classificationcited by 4
- 2026HyTRec: A Hybrid Temporal-Aware Attention Architecture for Long Behavior Sequential Recommendationcited by 4
- 2025Uncertainty-Instructed Structure Injection for Generalizable HD Map Constructioncited by 3
- 2025Multimodal Graph Representation Learning for Robust Surgical Workflow Recognition with Adversarial Feature Disentanglementcited by 3
- 2022State-Regularized Recurrent Neural Networks to Extract Automata and Explain Predictionscited by 2
- 2024S2-Track: A Simple yet Strong Approach for End-to-End 3D Multi-Object Trackingcited by 2
12 most cited of 19 All 19 (JSON)
- 2026Calibrating Scientific Foundation Models with Inference-Time Stochastic Attention21 Apr 2026
- 2026HyTRec: A Hybrid Temporal-Aware Attention Architecture for Long Behavior Sequential Recommendation20 Feb 2026
- 2025TCUQ: Single-Pass Uncertainty Quantification from Temporal Consistency with Streaming Conformal Calibration for TinyML18 Aug 2025
- 2025Benchmarking Uncertainty and its Disentanglement in multi-label Chest X-Ray Classification6 Aug 2025
- 2025Uncertainty Quantification for Machine Learning in Healthcare: A Survey4 May 2025
- 2025Multimodal Graph Representation Learning for Robust Surgical Workflow Recognition with Adversarial Feature Disentanglement3 May 2025
- 2025Uncertainty-Instructed Structure Injection for Generalizable HD Map Construction29 Mar 2025
- 2024Can Uncertainty Quantification Improve Learned Index Benefit Estimation?23 Oct 2024
- 2024Calibrating Verbalized Probabilities for Large Language Models9 Oct 2024
- 2024S2-Track: A Simple yet Strong Approach for End-to-End 3D Multi-Object Tracking4 Jun 2024
- 2024BayesJudge: Bayesian Kernel Language Modelling with Confidence Uncertainty in Legal Judgment Prediction16 Apr 2024
- 2024Interpreting Predictive Probabilities: Model Confidence or Human Label Variation?25 Feb 2024
12 newest of 19 All 19 (JSON)