Skip to content
AI.info

Neural networks

Inside an Artificial Neuron

Dissect the basic neural unit and understand how weights, bias, pre-activation, and activation each affect a computation.

By the end you can

Example

A four-feature calculation

Consider a neuron that scores whether a machine reading deserves inspection; its input vector contains vibration, temperature, age, and a missing-sensor flag.

  • Input values: vibration 0.7, temperature 0.4, age 0.8, missing flag 0.
  • Weights: 1.2, 0.5, 0.9, and -1.5 for the four features.
  • Weighted contributions: 0.84, 0.20, 0.72, and 0.00.
  • Bias: -1.10, producing a pre-activation of 0.66.
  • A chosen activation then converts 0.66 into the unit’s emitted value.

Visual

The neuron in one line

The familiar formula separates evidence aggregation from the response rule. Inputs x enter as a vector of measured or learned values. Weights w scale each coordinate before combination. The contributions are added into one pre-activation w·x. A learned bias b shifts when the unit responds. Finally an activation φ maps the pre-activation to the emitted output.

The last box is the one beginners read as cosmetic. It is also the one with a measured price tag. In 2012 Krizhevsky and two colleagues changed nothing but φ and timed the result. The Figure 1 caption of their ImageNet paper reports: “A four-layer convolutional neural network with ReLUs (solid line) reaches a 25% training error rate on CIFAR-10 six times faster than an equivalent network with tanh neurons (dashed line).” The learning rates were tuned independently for each of the two networks. No regularization was used. So the six-fold gap belongs to the response function and to nothing else in the pipeline.

The rectifier's advantage was already on record. Glorot and two colleagues had reported it a year earlier, finding that rectifying neurons “yield equal or better performance than hyperbolic tangent networks”. They added a second, stranger measurement about what φ does to a layer's output: “after uniform initialization of the weights, around 50% of hidden units continuous output values are real zeros”. So the choice of φ sets both how fast the unit learns and how often it emits exactly nothing. The fifth box in the diagram is a modelling decision with numbers attached, not a finishing flourish.

FigureProcess · 5 steps
  1. 1

    Inputs x

    Measured or learned values enter as a vector.

  2. 2

    Weights w

    Each coordinate is scaled before combination.

  3. 3

    Weighted sum w·x

    The contributions are added into one pre-activation.

  4. 4

    Bias b

    A learned offset shifts when the unit responds.

  5. 5

    Activation φ

    A response function maps the pre-activation to an output.

Weights are sensitivities inside a model, not opinions

Hold every other input fixed. A positive weight then makes the pre-activation rise when its own input rises, and a negative weight pushes it in the opposite direction.

This interpretation is local to the chosen representation and to the surrounding network. Feature scaling, interactions, later layers and correlated inputs can all overturn a simplistic “importance” story. The word doing the work in that sentence is *local*, and in 2017 a group of vision researchers put a number on it.

Take the 256 units of AlexNet's conv5 layer, trained on Places205, and multiply the whole representation by a random orthogonal matrix Q drawn uniformly from SO(256). That is what the Network Dissection paper did. The layers that follow can undo such a change exactly, so “each rotated representation has exactly the same discriminative power as the original layer”. Accuracy cannot tell the two apart. Legibility can. Bau and his coauthors write: “Denoting AlexNet conv5 as f(x), we find that the number of unique detectors in Qf(x) is 80% fewer than the number of unique detectors in f(x).” Intermediate rotations Q^alpha for 0<=alpha<=1 show interpretability declining smoothly as the rotation grows. This is not one brittle threshold. It is a continuous trade of readability for nothing at all.

The paper's conclusion is the sentence to carry into every weight inspection you ever do: “interpretability is neither an inevitable result of discriminative power, nor is it a prerequisite to discriminative power”. A coordinate is readable because of the basis training happened to land in. Rotate the basis and the function is untouched while four out of five readable units vanish. The meaning was never inside the coordinate.

Same function, same accuracy, 80% fewer unique detectors — a weight's readability is a property of the basis, not of the computation.

Comparison

Why the bias deserves its own name

Without a bias term, a linear response boundary must pass through the origin of the input space. The bias is what lets training place that boundary wherever the evidence demands. Drop b and the neuron responds according to w·x alone: the boundary is anchored at the origin, its placement is less flexible, the feature encoding may have to be bent to compensate, and the constraint is worth accepting only when it is intended. Keep b and the neuron responds according to w·x+b: the boundary can shift, the unit carries a baseline tendency, and that flexibility costs exactly one trainable parameter. That is why affine layers keep it by default.

A default is a decision, and two independently built large language models decided the other way. Google's PaLM paper, published in 2023, states it in two sentences: “No biases were used in any of the dense kernels or layer norms. We found this to result in increased training stability for large models.” The Allen Institute for AI made the same call in OLMo in 2024, and gave the same reason: “No biases. Following LLaMA, PaLM, and others, we exclude all bias terms from our architecture in order to improve training stability.”

Neither team forgot the bias. Both removed it on purpose, in production systems, and both named the thing they bought with it. That is the strongest argument for giving b its own name. It is a separable object with a separable cost, something you add for boundary placement or remove for stability at scale. Either way you should be able to say which of the two you chose.

FigureComparison · 2 columns

No bias

The neuron responds according to w·x alone.

  • Boundary anchored at the origin
  • Less flexible placement
  • May force awkward feature encoding
  • Useful only when the constraint is intended

Learned bias

The neuron responds according to w·x+b.

  • Boundary can shift
  • Represents a baseline tendency
  • Adds one trainable parameter
  • Common default for affine layers

Two values that beginners often collapse

The pre-activation is the affine result before the response function. The activation is the value after that function.

Debugging often requires inspecting both. A healthy pre-activation distribution can still produce poor activations if the response function saturates or clips most values. This is not pedagogical bookkeeping. One of the most widely deployed pieces of training machinery in deep learning is defined by which of the two it touches.

Batch normalization goes in one exact place. Ioffe and Szegedy said where in 2015: “We add the BN transform immediately before the nonlinearity, by normalizing x = Wu + b.” The pre-activation is the object being manipulated. The activation is downstream of the intervention. The numbers attached to that placement are large: BN-x5 reached Inception's 72.2% accuracy in 14 times fewer training steps, and the BN-Inception ensemble reached 4.9% top-5 error on the 50,000-image ImageNet validation set. The same arithmetic quietly retires the term from the previous section. Once Wu + b has been normalised, b can be dropped, its role passing to the learned shift parameter beta.

There is a second lesson underneath the first. In 2018 Santurkar and three colleagues at MIT re-examined the technique. They confirmed the effect and rejected the explanation: “There is a consistent gain in training speed in models with BatchNorm layers”, they report, yet “such distributional stability of layer inputs has little to do with the success of BatchNorm.” You can intervene on the pre-activation, measure that it works, and still be wrong about why. That is one more reason to know precisely which of the two values your chart, your hook or your fix is touching.

Batch normalization acts on Wu + b, never on what φ emits — so of any plot, hook or fix, ask first: before the nonlinearity, or after?

Analogy

A committee with weighted votes

On this committee, each evidence source receives a different voting multiplier. The bias acts like a standing preference before new evidence arrives, and the activation decides how the final vote is reported.

Neural inputs are numbers, not people offering independent reasons — and the place the analogy breaks has been measured on a real network. One neuron in the 512-neuron MLP layer of a one-layer transformer fires on a mixture of academic citations, English dialogue, HTTP requests and Korean text. That is one committee member casting the same vote on four unrelated motions. Anthropic reported it in 2023, in the Towards Monosemanticity work, with this diagnosis: “Unfortunately, the most natural computational unit of the neural network – the neuron itself – turns out not to be a natural unit for human understanding. This is because many neurons are polysemantic: they respond to mixtures of seemingly unrelated inputs.”

The committee is worse-staffed than that. The same work trained sparse autoencoders on 8 billion MLP activations, at expansion factors from 1x (512 features) up to 256x (131,072 features), and recovered features — one of them firing on Hebrew script — that were not active in the top dataset examples of any single neuron. Some voters had no seat at all. Cunningham and four colleagues reached the same conclusion independently: “One of the roadblocks to a better understanding of neural networks' internals is polysemanticity, where neurons appear to activate in multiple, semantically distinct contexts.” Keep the analogy for the arithmetic of weighted voting. Drop it the moment you start asking what any one member believes.

One real unit voted on citations, dialogue, HTTP requests and Korean text at once: the seat is not the voter.

Key idea

Three interpretation traps

A large weight may compensate for a small input scale. A zero weight can matter indirectly if earlier layers transform the feature. A neuron with a high output is not necessarily “confident” unless the entire output design supports that interpretation.

Inspect units, scaling, neighboring operations, and the task head first. Only then assign meaning. There is a falsifiable version of that discipline. Reinitialise a trained Inception v3 network's weights, cascading from the logits down through 17 blocks, then re-run whatever method claims to show what the model used. If the method is reading the model, its output must change as the model is destroyed. Adebayo and five colleagues ran that test in 2018.

Plain gradients and GradCAM changed. Two popular methods did not: “across all architectures and datasets, Guided BackProp and Guided GradCAM show no change regardless of model degradation”. The third contribution of Sanity Checks for Saliency Maps records the split without hedging: “Of the methods we tested, Gradients & GradCAM pass the sanity checks, while Guided BackProp & Guided GradCAM fail.” The general finding is worse than a bug in one implementation: “some existing saliency methods are independent both of the model and of the data generating process”.

Sixt and two colleagues found the same thing from a different direction in 2020: “We find empirically that the explanations of all mentioned methods, except for DeepLIFT, are independent of the parameters of later layers.” Throughout the randomization runs the pictures kept looking like explanations. That includes the runs in which there was nothing left to explain.

An explanation that survives the destruction of the model it explains was never reading the model.

Steps

Audit one neuron by hand

A short manual trace makes later matrix notation much easier. Write the input vector out in a fixed coordinate order. Multiply each coordinate by its weight and record the contributions separately rather than as a running total. Add the bias and write down the resulting pre-activation as its own named value. Apply φ exactly once. Then perturb a single input and compare the change in the output with that input's weight.

Run the trace twice more, and the three anchored results in this lesson become things you have felt rather than read. Once with b removed, as PaLM and OLMo removed it: the boundary snaps back through the origin and nothing else in the arithmetic moves. Once with the pre-activation normalised before φ, in the position Ioffe and Szegedy specify — “We add the BN transform immediately before the nonlinearity, by normalizing x = Wu + b.” — and watch b become redundant, its job handed to the learned shift parameter beta. Finally, swap φ from tanh to a rectifier. Notice how many of the units in a layer you have just set to exactly zero: after uniform weight initialization, around 50% of them.

FigureProcess · 5 steps
  1. 1. Write the vector

    List input values in a fixed coordinate order.

  2. 2. Multiply coordinates

    Compute each input–weight contribution separately.

  3. 3. Add the bias

    Record the resulting pre-activation.

  4. 4. Apply φ

    Use the stated activation function exactly once.

  5. 5. Perturb one input

    Observe how the output changes and compare with the corresponding weight.

Key takeaways