Biological neural systems are inherently noisy. Synaptic release, ionchannel gating, and spontaneous firing all introduce randomness that shapes the dynamics of real brains. Classical deterministic neuralnetwork models (e.g., feedforward perceptrons or deep convolutional nets) often ignore this variability. Stochastic models aim to capture the probabilistic nature of neural activity, providing a more faithful representation of learning, memory, and inference in the brain.
From an engineering perspective, stochasticity can improve generalisation, avoid overfitting, and enable Bayesian reasoning. In machinelearning research, this has motivated techniques such as dropout, Bayesian neural networks, and variational inference.
Early work framed neural activity as a collection of random variables linked by a graphical structure. The most common example is the Boltzmann machine, introduced by Hinton and Sejnowski (1986). Units are binary stochastic neurons that follow a logistic activation rule:
P(s_i = 1) = 1 / (1 + e^{- h_i})where h_i = _j w_{ij}s_j + b_i Learning is performed by minimizing the KullbackLeibler divergence between the data distribution and the model distribution, typically using contrastive divergence.
Continuoustime formulations describe each neurons membrane potential as an SDE, often based on the leakyintegrateandfire (LIF) dynamics:
dV_i = ( -V_i/ + _j w_{ij}S_j(t) ) dt + dW_i(t) Here, W_i(t) is a Wiener process representing intrinsic noise, and controls its strength. The stochastic term can reproduce irregular spiking observed in cortical recordings.
In a Bayesian framework, network weights are treated as random variables with prior distributions. Posterior inference yields a distribution over functions, allowing uncertainty quantification. The posterior is typically approximated by:
Models such as the Poisson spiking neural network or the Generalized Linear Model (GLM) treat spikes as stochastic point processes. The conditional intensity _i(t) often depends on a linear filter of past spikes convolved with a nonlinear link function:
_i(t) = f( _j w_{ij} * (spike_history_j) + b_i ) These models excel at describing neural coding in sensory areas and are widely used for decoding and neural prosthetics.
Stochastic neural networks can represent posterior distributions directly, making them suitable for tasks where quantifying uncertainty is essential (e.g., autonomous driving, medical diagnosis). Techniques like MonteCarlo dropout turn a deterministic deep net into an approximate Bayesian model at inference time.
Adding controlled noise during training (e.g., weight noise, variational layers) helps networks escape sharp minima, leading to flatter loss landscapes and improved robustness against adversarial attacks.
Stochastic models bridge the gap between microscopic biophysics and macroscopic behavior. For example, networks of SDEbased LIF neurons can reproduce cortical avalanche dynamics, while GLM spike models explain stimulusdriven variability in retinal ganglion cells.
A large number of peerreviewed PDFs are freely available. Below are some cornerstone papers and review articles that can be downloaded directly:
*All links point to openly accessible PDFs or preprints. Academic institutions may have additional subscriptions for further reading.
The following short Python snippet demonstrates how to add stochastic weight noise to a simple feedforward network using PyTorch. The code can be saved as stochastic_mlp.py and run locally.
import torchimport torch.nn as nnimport torch.nn.functional as Fclass NoisyLinear(nn.Module): def __init__(self, in_features, out_features, sigma=0.1): super().__init__() self.weight_mu = nn.Parameter(torch.empty(out_features, in_features)) self.weight_sigma = nn.Parameter(torch.full((out_features, in_features), sigma)) self.bias_mu = nn.Parameter(torch.empty(out_features)) self.bias_sigma = nn.Parameter(torch.full((out_features,), sigma)) nn.init.kaiming_uniform_(self.weight_mu, a=math.sqrt(5)) nn.init.uniform_(self.bias_mu, -0.1, 0.1) def forward(self, x): weight = self.weight_mu + self.weight_sigma * torch.randn_like(self.weight_mu) bias = self.bias_mu + self.bias_sigma * torch.randn_like(self.bias_mu) return F.linear(x, weight, bias)class StochasticMLP(nn.Module): def __init__(self, input_dim, hidden_dim, output_dim): super().__init__() self.fc1 = NoisyLinear(input_dim, hidden_dim) self.fc2 = NoisyLinear(hidden_dim, output_dim) def forward(self, x): x = F.relu(self.fc1(x)) return self.fc2(x)# Example usagemodel = StochasticMLP(784, 256, 10)optimizer = torch.optim.Adam(model.parameters(), lr=1e-3)# Dummy training loopfor epoch in range(5): data = torch.randn(64, 784) target = torch.randint(0, 10, (64,)) logits = model(data) loss = F.cross_entropy(logits, target) optimizer.zero_grad() loss.backward() optimizer.step()
By sampling new weight noise at every forward pass, the model behaves like an ensemble of networks, yielding calibrated predictive uncertainties.
