All-Spin Bayesian Neural Networks

Kezhou Yang, Akul Malhotra, Sen Lu, Abhronil SenguptaarXiv 2019 · DOI

Abstract

Probabilistic machine learning enabled by the Bayesian formulation has recently gained significant attention in the domain of automated reasoning and decision-making. While impressive strides have been made recently to scale up the performance of deep Bayesian neural networks, they have been primarily standalone software efforts without any regard to the underlying hardware implementation. In this paper, we propose an "All-Spin" Bayesian Neural Network where the underlying spintronic hardware provides a better match to the Bayesian computing models. To the best of our knowledge, this is the first exploration of a Bayesian neural hardware accelerator enabled by emerging post-CMOS technologies. We develop an experimentally calibrated device-circuit-algorithm co-simulation framework and demonstrate $24\times$ reduction in energy consumption against an iso-network CMOS baseline implementation.

Introduction

Standard Deep Neural Networks (DNNs) are deterministic, providing single-point predictions without an inherent measure of confidence. In safety-critical domains such as autonomous driving or medical diagnostics, quantifying uncertainty is essential. Bayesian Neural Networks (BNNs) address this by treating synaptic weights as probability distributions rather than fixed scalars.

Conceptual framework of a Bayesian Neural Network where weights are represented as probability distributions.

Despite their theoretical advantages, BNNs are computationally prohibitive on conventional CMOS hardware. The primary bottlenecks include the high energy cost of generating high-quality Gaussian random numbers and the "Von Neumann bottleneck," where the frequent movement of distribution parameters (means and variances) between memory and processing units leads to significant energy dissipation.

The All-Spin Architecture

We propose an "All-Spin" hardware accelerator that leverages the intrinsic stochasticity and non-volatility of spintronic devices to overcome these limitations. The architecture utilizes Magnetic Tunnel Junctions (MTJs) for both stochastic sampling and in-memory computation.

Spintronic Stochasticity for RNG

Instead of using complex digital logic to generate random numbers, our design exploits the inherent thermal noise of Spin-Orbit Torque (SOT) devices. By biasing these devices into a meta-stable state, they relax into a binary state with a 50% probability. By aggregating multiple such outputs, we leverage the Central Limit Theorem to produce high-quality Gaussian random numbers with minimal power consumption.

In-Memory Computing with Domain Wall MTJs

To eliminate data movement, we employ Domain Wall (DW) MTJs arranged in crossbar arrays. These devices exhibit a linear change in electrical conductance based on the position of a magnetic domain wall, allowing them to store synaptic weights and perform dot-product operations directly within the memory array.

The proposed All-Spin architecture featuring a spintronic synapse crossbar array for in-memory computing.

Hardware-Software Co-Design

A key innovation is the mathematical partitioning of the BNN inference equation: $$f(x, W) = \sum x \cdot \mu + \sum x \cdot \sigma \cdot N(0,1)$$ This decomposition allows the hardware to store the static parameters ($\mu$ and $\sigma$) in non-volatile magnetic memory while injecting the stochastic component ($N(0,1)$) externally. This approach decouples the deterministic and probabilistic components of the computation, optimizing energy efficiency.

Results

The proposed architecture was evaluated using the MNIST dataset. The "All-Spin" system achieved a test accuracy of 96.98%, closely matching the software baseline of 97.51%. Crucially, the hardware demonstrated exceptional energy efficiency, consuming only 790.2 nJ per classification—a 24× improvement over a comparable CMOS-based Bayesian accelerator. Furthermore, the system showed high robustness, maintaining stability even with 10% variation in device conductances, highlighting the natural resilience of BNNs to hardware noise.

Conclusion

By embracing the inherent "noise" of nanomagnets rather than fighting it, the All-Spin BNN architecture provides a highly efficient pathway for deploying probabilistic AI. This work demonstrates that emerging spintronic technologies can offer a superior hardware substrate for the next generation of automated reasoning systems.

Summary updated

BibTeX
@misc{yang2019all,
  author = {Kezhou Yang and Akul Malhotra and Sen Lu and Abhronil Sengupta},
  title = {{All-Spin Bayesian Neural Networks}},
  year = {2019},
  eprint = {1911.05828},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1911.05828},
}
Figure