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

PieceNameWhat it is
inputsThe numbers coming in
weightsLearned numbers saying how much each input matters
biasA learned offset (lets the neuron fire even when inputs are zero)
weighted sumMultiply each input by its weight, then add all of them
activation functionA non-linear squashing or gating function
outputThe 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"]

Common activation functions

NameFormulaNotes
ReLUDead simple, was the default for years. “If negative, output 0, else pass through.”
GELUA 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.
SwiGLUA 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 →