The “neuron” in a neural network is a loose, very lossy analogy to a biological one. Mathematically it’s almost embarrassingly simple: multiply each input by a weight, add them up, add a bias, then squash the result.
Written compactly with the sum symbol (see Symbol cheat sheet):
And in vector notation, which is what you’ll see everywhere:
Breaking down the formula
Piece Name What it is inputs The numbers coming in weights Learned numbers saying how much each input matters bias A learned offset (lets the neuron fire even when inputs are zero) weighted sum Multiply each input by its weight, then add all of them activation function A non-linear squashing or gating function output The single number the neuron produces That dot product is the core operation of the whole field. Everything else is organization around it.
flowchart LR x1["x₁"] -->|"× w₁"| S(("Σ + b")) x2["x₂"] -->|"× w₂"| S x3["x₃"] -->|"× w₃"| S S --> F["f( ) activation"] F --> Y["output y"]
Worked example with real numbers
Inputs , weights , bias , activation = ReLU.
If the pre-activation had been negative (say ), ReLU would output . The neuron “stays off.”
Common activation functions
| Name | Formula | Notes |
|---|---|---|
| ReLU | Dead simple, was the default for years. “If negative, output 0, else pass through.” | |
| GELU | A smooth ReLU-ish curve. Used in GPT-2/BERT era. is defined in the Symbol cheat sheet. | |
| SiLU / Swish | , where | Common in modern models. (the sigmoid) squashes any number into the range 0 to 1. |
| SwiGLU | A gated variant: one path decides “how much to let through” for the other. What most modern LLMs use in their MLPs (see 8b. The MLP). |
← The big picture · Contents · 2. Layers and why non-linearity matters →