AI Glossary / Deep learning / Intermediate
Bayesian neural network
Definition
A Bayesian neural network is a neural model that represents uncertainty about its parameters using probability distributions and updates that uncertainty in light of data. Instead of relying only on one fitted set of weights, prediction considers multiple plausible parameter settings according to a posterior distribution or an approximation to it. This can help express uncertainty about the model, but it does not automatically make predictions correct or well calibrated.
What it means
An ordinary fitted network commonly stores one numerical value for each weight. A Bayesian treatment asks which weight settings remain plausible after considering the observations and the assumptions encoded in a prior.
The distinction concerns uncertainty over the model, not merely whether the network outputs probabilities. A conventional classifier can produce class probabilities while still using a single weight estimate. A Bayesian neural network is also different from a Bayesian network, which is a graphical model of conditional relationships among variables. The similar names refer to different concepts.
How it works
A prior distribution describes parameter assumptions before the observed training data is incorporated. A likelihood describes how the network and observation model assign probability to the data. Bayes' rule combines these into a posterior over parameters.
For practical neural networks, exact posterior calculations are generally intractable. Methods such as variational inference approximate the distribution, while sampling methods offer another approach. The choice changes computational cost and approximation behavior.
Prediction averages or integrates the output distribution over plausible weights. In a sampling approximation, several weight samples produce several predictions that are combined. Observation noise and parameter uncertainty play different roles, so the complete predictive model needs to specify both where relevant.
Three practical examples
1. Regression study: a team compares predictions and uncertainty bands in regions with many training examples and regions with sparse coverage, checking whether the uncertainty behaves usefully.
2. Review prioritization: a prototype uses model-uncertainty information to help identify examples for human review. The team measures whether the selected cases actually contain more errors or unfamiliar patterns.
3. Active-learning experiment: researchers use uncertainty to nominate additional examples for labeling, then compare the resulting learning progress with simpler selection strategies under the same annotation budget.
Think of it this way
Think of consulting a collection of plausible maps rather than committing immediately to one map. Agreement and disagreement can help describe what the available evidence leaves unresolved. The analogy is limited: Bayesian weight samples are mathematical possibilities shaped by a prior, likelihood, data, and approximation. They are not independent experts, and unanimous agreement can still occur when the whole modeling setup is wrong.
Worked example
Suppose an illustrative two-point approximation assigns posterior weight 0.6 to network A and 0.4 to network B. For one input, A predicts a positive-class probability of 0.8 and B predicts 0.3.
The combined predictive probability is 0.6 × 0.8 + 0.4 × 0.3 = 0.60. That is different from selecting A alone and reporting 0.8.
Across these two plausible settings, the weighted variance of their positive-class probabilities is 0.6 × (0.8 − 0.6)² + 0.4 × (0.3 − 0.6)² = 0.06. This illustrates disagreement across parameter settings, not the full variance of a future binary outcome. For that binary predictive outcome, probability 0.6 gives variance 0.6 × 0.4 = 0.24.
The numbers are invented for arithmetic clarity. They do not show how a real posterior was fitted or establish calibration on new data.
Illustrative case study
Fictional case: Uncertainty Field, a maintenance research group, builds a Bayesian neural prototype to predict a measured equipment quantity. It notices that the reported uncertainty is narrow even for a newly introduced machine type.
Rather than assuming the model has strong knowledge of the new equipment, the group investigates its prior, training coverage, observation model, and posterior approximation. It also evaluates actual errors on separately collected examples. No reliability improvement is claimed. The case illustrates why an uncertainty estimate is itself an output requiring validation, especially when the operational input differs from the data used to construct the model.
Common misconceptions and mistakes
A Bayesian neural network is not automatically calibrated, robust to every distribution shift, or aware of everything it does not know. Poor priors, unsuitable likelihoods, limited data, and restrictive approximations can all affect its uncertainty estimates.
Output probability alone does not prove that parameter uncertainty is represented. Conversely, variability across sampled weights should not be confused with all sources of uncertainty in an observation.
A collection of independently trained networks is not automatically an exact Bayesian posterior. Ensembles can be useful, but the probabilistic interpretation requires justification. Finally, increasing the number of prediction samples reduces sampling noise in an approximation; it does not necessarily correct a badly chosen approximate distribution.
Business use
Businesses may investigate Bayesian neural networks when a decision depends on the reliability of a prediction as well as its average value. Potential benefits should be measured against the extra training, inference, and maintenance costs.
Define how uncertainty will change the workflow: trigger review, request more data, widen planning ranges, or defer a decision. Then evaluate that action policy, not just an attractive uncertainty plot. Keep the prior, likelihood, approximation method, and sampling settings with the model documentation. Distinguish uncertainty about an estimated relationship from variation inherent in the observations so users do not expect additional training data to remove every form of unpredictability.
People also ask
Does every weight have to use an independent Gaussian distribution?
No. That is a common approximation choice in some methods, not the definition of a Bayesian neural network.
Can it still use backpropagation?
Yes. Variational approaches can use gradient-based optimization and backpropagation to fit parameters of an approximate weight distribution.
Will more data always eliminate uncertainty?
No. Some uncertainty reflects observation noise or model limitations, and useful data must also be relevant to the prediction setting.
Check your understanding
A network outputs 0.9 for a class but uses one fixed fitted weight vector. Is that output alone sufficient to call it a Bayesian neural network?
Answer: No. Class probabilities and a posterior distribution over model parameters are different objects. The modeling and inference procedure must justify the Bayesian description.
Related terms
- Prior (regularizer)
- Likelihood
- Posterior
- Posterior predictive distribution
- Monte Carlo sampling
- Calibration
- Prior
- variational inference
- epistemic uncertainty
- aleatoric uncertainty
Learn next
Calculate predictive averages from a few hypothetical weighted models, then study how an approximate posterior is fitted. Evaluate uncertainty alongside errors on held-out and shifted data, and compare the resulting review policy with a simple baseline.
More in Deep learning
- Backpropagation - Backpropagation is an efficient method for calculating how a model's loss changes with respect to its parameters.
- Backpropagation through structure - Backpropagation through structure is a method for calculating training gradients in recursive neural networks whose computations follow a structured input...
- Batch normalization - Batch normalization is a neural-network operation that normalizes selected intermediate values using statistics computed across a training mini-batch, then...
- BCPNN - BCPNN stands for Bayesian Confidence Propagation Neural Network.
- Biclustering - Biclustering is a way of finding related subsets of rows and columns together in a data matrix.
- Bidirectional associative memory - Bidirectional associative memory, or BAM, is a neural associative-memory model that stores relationships between pairs of patterns and can use a cue on...
Sources
Primary sources: Blundell and colleagues, “Weight Uncertainty in Neural Networks,” https://arxiv.org/html/1505.05424v2 ; TensorFlow Probability, “Probabilistic Layers: Regression,” https://www.tensorflow.org/probability/examples/Probabilistic_Layers_Regression . Both were opened; posterior prediction and approximate weight-distribution learning were checked in the original paper. The two-network arithmetic and fictional case are original illustrations, not empirical claims about any particular deployed model.
Previous: Bayesian network Next: Bayesian optimization