---
title: "The role of bias in Neural Networks"
description: "What the bias term does in a neural network, why it shifts the activation function, and why models need it, shown with and without bias."
source: https://www.pico.net/kb/the-role-of-bias-in-neural-networks/
markdown_url: https://www.pico.net/kb/the-role-of-bias-in-neural-networks.md
---

# 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).](https://www.pico.net/assets/kb/the-role-of-bias-in-neural-networks/no-bias.png)

## 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)).](https://www.pico.net/assets/kb/the-role-of-bias-in-neural-networks/bias.png)

## 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](https://www.pico.net/kb/overfitting-variance-bias-and-model-complexity-in-machine-learning/). Neural networks like this underpin modern anomaly detection, including the machine-learning capabilities in [Corvil Analytics](https://www.pico.net/products/corvil-analytics/).