Knowledge Base

The role of bias in Neural Networks

The activation function in a neural network takes an input 'x' multiplied by a weight 'w'. Bias lets you shift that activation function by adding a constant — the bias — to the input. It is analogous to the constant in a linear function, where the line is transposed by a fixed value.

Without bias

With no bias, the input to the activation function is simply 'x' multiplied by the connection weight 'w0':

A neuron with no bias: input x times weight w0 feeds the activation function f(w0 * x).

With bias

Adding a bias node feeds the activation function 'x' times the connection weight 'w0', plus the bias times its own connection weight 'w1'. This shifts the activation function by a constant amount (b * w1):

A neuron with bias: input x (weight w0) and a bias node (weight w1) feed the activation function f((w0 * x) + (w1 * b)).

Why bias matters

Without bias, every activation function is forced through the origin, which limits the patterns a network can represent. Bias gives the model the freedom to fit data that a zero-intercept function cannot. It also plays a central role in the bias-variance trade-off that governs how well a model generalises — see Overfitting: variance, bias and model complexity. Neural networks like this underpin modern anomaly detection, including the machine-learning capabilities in Corvil Analytics.