Lune

DAC2022Top-tier venue

Enabling fast uncertainty estimation: accelerating bayesian transformers via algorithmic and hardware optimizations

Hongxiang Fan, Martin Ferianc, Wayne Luk

Abstract

Quantifying the uncertainty of neural networks (NNs) has been required by many safety-critical applications such as autonomous driving or medical diagnosis. Recently, Bayesian transformers have demonstrated their capabilities in providing high-quality uncertainty estimates paired with excellent accuracy. However, their real-time deployment is limited by the compute-intensive attention mechanism that is core to the transformer architecture, and the repeated Monte Carlo sampling to quantify the predictive uncertainty. To address these limitations, this paper accelerates Bayesian transformers via both algorithmic and hardware optimizations. On the algorithmic level, an evolutionary algorithm (EA)-based framework is proposed to exploit the sparsity in Bayesian transformers and ease their computational workload. On the hardware level, we demonstrate that the sparsity brings hardware performance improvement on our optimized CPU and GPU implementations. An adaptable hardware architecture is also proposed to accelerate Bayesian transformers on an FPGA. Extensive experiments demonstrate that the EA-based framework, together with hardware optimizations, reduce the latency of Bayesian transformers by up to 13, 12 and 20 times on CPU, GPU and FPGA platforms respectively, while achieving higher algorithmic performance.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

1 top-tier paper has cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Hardware-Aware Neural Dropout Search for Reliable Uncertainty Prediction on FPGA cites High-Performance FPGA-based Accelerator for Bayesian Neural Networks
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers1

  1. Hardware-Aware Neural Dropout Search for Reliable Uncertainty Prediction on FPGAZehuan Zhang, Hongxiang Fan, Hao Mark Chen, Lukasz Dudziak et al.DAC 2024 · 1 citation

Builds on7

  1. ELECTRA: Pre-training Text Encoders as Discriminators Rather Than GeneratorsKevin Clark, Minh-Thang Luong, Quoc V. Le, Christopher D. ManningICLR 2020 · 541 citations
  2. SpAtten: Efficient Sparse Attention Architecture with Cascade Token and Head PruningHanrui Wang, Zhekai Zhang, Song HanHPCA 2021 · 412 citations
  3. Specifying Weight Priors in Bayesian Deep Neural Networks with Empirical BayesRanganath Krishnan, Mahesh Subedar, Omesh TickooAAAI 2020 · 65 citations
  4. Scheduled DropHead: A Regularization Method for Transformer ModelsWangchunshu Zhou, Tao Ge, Furu Wei, Ming Zhou et al.EMNLP Findings 2020 · 35 citations
  5. High-Performance FPGA-based Accelerator for Bayesian Neural NetworksHongxiang Fan, Martin Ferianc, Miguel Rodrigues, Hongyu Zhou et al.DAC 2021 · 31 citations

Related papers

  1. When Monte-Carlo Dropout Meets Multi-Exit: Optimizing Bayesian Neural Networks on FPGAHongxiang Fan, Mark Chen, Liam Castelli, Zhiqiang Que et al.DAC 2023 · 5 citations
  2. Fast-BCNN: Massive Neuron Skipping in Bayesian Convolutional Neural NetworksQiyu Wan, Xin FuMICRO 2020 · 26 citations
  3. Calibrating Transformers via Sparse Gaussian ProcessesWenlong Chen, Yingzhen LiICLR 2023
  4. HAT: Hardware-Aware Transformers for Efficient Natural Language ProcessingHanrui Wang, Zhanghao Wu, Zhijian Liu, Han Cai et al.ACL 2020 · 215 citations
  5. Towards Uncertainty-aware Robotic Perception via Mixed-signal BNN Engine Leveraging Probabilistic Quantum TunnelingLikai Pei, Yu Zhou, Xingtian Wang, Xueji Zhao et al.DAC 2025
Dusk over the sea between two cliffs drawn in fine vertical lines