One neuron can only draw a line. Stacking them lets the network redraw the map first.
A single artificial neuron does two things: take a weighted sum of its inputs, then squash that sum through a curve. Weighted sum alone is just a line — such a neuron can only split the world into two halves with a straight cut, which is why the perceptron famously choked on XOR.
The fix is embarrassingly simple: put a layer of neurons in between. Each hidden neuron draws its own line; the next layer takes their outputs as new coordinates and draws a line in that space. Geometrically, the hidden layer warps and folds the input space until the two classes can be separated by something flat.
That's the whole idea. Everything else — depth, activations, backprop — is machinery for making the warping learnable. With enough hidden units, an MLP can approximate any continuous function, which is the universal approximation theorem.
Every neuron computes the same thing: output = squash( w₁x₁ + w₂x₂ + … + bias )
Fully connected — every neuron sees every neuron of the previous layer. The squash (tanh, ReLU) is what makes depth worth having: without it, stacking linear layers collapses back into a single linear layer, no matter how many you use.
Two inputs (x, y), one output (which colour). The background shows the network's current prediction everywhere. Start with 0 hidden layers on XOR or spiral — it can only manage a single straight cut and stalls near 50%. Add one hidden layer and the boundary starts to curve.
Training loss. Backprop nudges every weight in the direction that lowers it.
Each tile is one neuron of the first hidden layer, showing where it fires across the input space. Every tile is a straight-edged half-plane — that's all a single neuron can be. The next layer adds and subtracts these slabs, and their overlap is the curved boundary above. Complexity is built from very dumb parts.
Train the network above and watch the tiles rotate into position. With ReLU the edges are hard creases; with tanh they're soft ramps.
Width buys you more folds; depth lets folds compose, so deep-and-narrow usually beats shallow-and-wide for the same parameter count.
The MLP is still the workhorse layer inside almost everything modern — roughly two-thirds of a Transformer's parameters sit in plain feed-forward MLP blocks between the attention layers.