Back to Learn

Neural Networks, Intuitively

A neural network is a mathematical function built from layers of simple units (neurons). It learns by adjusting weights to reduce error - via backpropagation and gradient descent.

Last updated: August 2026

InputHiddenHiddenOutput
How Neural Networks, Intuitively worksletslearngenai.com
Listen: Neural Networks, Intuitively (student & teacher)StudentTeacher
0:000:00

At its heart, a neural network is just a mathematical function: it takes some inputs, applies a series of transformations, and produces an output. What makes it special is that it learns those transformations from data instead of being hand-programmed. The transformations happen in layers of simple units called neurons, connected by weights that decide how much each input matters. Learning is a loop you repeat over and over: a forward pass runs the inputs through the network to make a prediction, a loss function measures how wrong that prediction was, and then backpropagation - paired with gradient descent - figures out how each weight contributed to the error and nudges every one of them slightly in the direction that reduces it. Do this across millions of examples and the network gradually shapes itself to the task, discovering features no human wrote down: early layers pick up simple patterns like edges, later layers combine them into complex concepts like faces or grammar. This same machinery, scaled to billions of weights, is exactly what powers modern LLMs - which is why understanding it demystifies all of deep learning.

Weights are knobs. Training is just turning every knob a little, over and over, in the direction that makes the answer less wrong.

ComponentWhat it doesExample
Neuron (node)
Takes weighted inputs, sums them, and passes the result through an activation function.One unit deciding 'is an edge present?'
Layers
Neurons organized into input, hidden, and output layers; depth builds up abstraction.Pixels -> edges -> shapes -> 'cat'.
Weights
Knobs controlling how much each input influences a neuron; learned during training.A high weight amplifies an input.
Bias
An offset that shifts a neuron's output, giving the model more flexibility.Lets a neuron fire more or less easily.
Activation (ReLU)
Introduces non-linearity so the network can learn curved, complex patterns.ReLU passes positives, zeros out negatives.
Loss function
Measures how far the prediction is from the truth - the thing training minimizes.Higher loss = more wrong.
Backpropagation
Computes how much each weight contributed to the error, layer by layer.Assigns 'blame' to every weight.
Gradient descent
Uses those gradients to nudge all weights toward lower loss.Small steps downhill on the error surface.

Key intuitions

  • 1Non-linearity is what makes it powerful. - Without activation functions, stacking layers would still only draw straight lines - ReLU and friends let it learn curves.
  • 2Learning is iterative. - Forward pass, measure error, backpropagate, nudge weights - repeated over and over on many examples.
  • 3Depth builds abstraction. - Early layers learn simple features; later layers combine them into complex concepts.
  • 4Data quality rivals quantity. - Clean, representative data often matters as much as more of it or a bigger model.
  • 5Generalization is the goal. - You want it to perform on unseen data, not memorize the training set (overfitting).
  • 6It's differentiable math, not magic. - The whole system works because you can compute gradients and follow them downhill.

Forward pass

Run inputs through the layers to produce a prediction.

Prompt

Pixels in -> 'cat' probability out.
Use when:Every prediction and every training step starts here.

Loss computation

Compare the prediction to the truth with a loss function.

Prompt

Cross-entropy for classification.
Use when:To quantify how wrong the model is.

Backpropagation

Propagate the error backward to find each weight's contribution (its gradient).

Prompt

Chain rule from output to input.
Use when:After computing the loss.

Gradient descent

Nudge every weight a little in the direction that reduces the loss; the learning rate sets the step size.

Prompt

weight -= learning_rate * gradient.
Use when:To actually update the model.

Epochs & batches

Repeat the loop over the dataset (epochs), updating on small batches for stability and speed.

Prompt

Train 10 epochs in batches of 32.
Use when:Training over a full dataset.

Common misconceptions

  • 1'It works like a human brain.' - Loosely inspired, but artificial neurons are simple math; the mechanics are linear algebra and calculus, not biology.
  • 2'More layers always help.' - Depth helps to a point; too much without enough data or regularization causes overfitting and training trouble.
  • 3'It's programmed with rules.' - Nobody writes the features - the network learns weights from examples.
  • 4'Higher accuracy on training data is better.' - If it memorizes training data it may fail on new data; watch validation performance.
  • 5'Activation functions are optional detail.' - Remove them and a deep network collapses to a single linear function - they're essential.

Key terms at a glance

TermPlain meaning
WeightHow much an input matters
BiasA tunable offset
ActivationThe non-linearity that enables curves
LossHow wrong the prediction is
GradientDirection to change a weight to reduce loss
EpochOne full pass over the training data

Common activation functions

FunctionBehaviorTypical use
ReLUPass positives, zero negativesMost hidden layers
SigmoidSquash to 0-1Binary probability output
SoftmaxTurn scores into a distributionMulti-class output
TanhSquash to -1..1Some recurrent nets
1

One training step

Weak prompt

Imagining the network is 'programmed' with rules for the task.
Better prompt

Strong prompt

It makes a prediction (forward pass), computes the loss, then backpropagation finds how each weight contributed to the error.

Output

Gradient descent nudges every weight a little to reduce the loss; after many steps, predictions get accurate - no hand-written rules.
2

How depth builds abstraction

Weak prompt

Expecting a single layer to recognize a cat from raw pixels.
Better prompt

Strong prompt

Stacked layers learn a hierarchy: edges, then textures and shapes, then object parts, then the whole.

Output

The output layer combines high-level features into 'cat' - each layer building on the one before.

From neural networks to LLMs

ConceptNeural networkLLM
UnitNeuronSame, at massive scale
LearningBackprop + gradient descentSame, over trillions of tokens
ArchitectureVariousTransformer
ScaleThousands-millions of weightsBillions of weights

Frequently asked questions

Do neural networks work like the brain?

They were loosely inspired by biological neurons, but artificial neurons are simple math functions. The analogy helps intuition; the mechanics are linear algebra plus calculus, not biology.

What is backpropagation, simply?

It is the method for figuring out how much each weight contributed to the error, so gradient descent knows which direction to nudge every weight to make the network less wrong.

Why do we need activation functions?

They add non-linearity. Without them, stacking layers still only produces a straight-line (linear) function, so the network couldn't learn complex, curved patterns.

What is overfitting?

When a model memorizes the training data instead of learning general patterns, so it scores well on training but poorly on new data. You watch validation performance to catch it.

How does this relate to LLMs?

An LLM is a very large neural network (a Transformer) trained with the same backpropagation and gradient descent - just scaled to billions of weights and trillions of training tokens.