Neural Network Playground
Build a tiny network, train it in your browser with real backpropagation, and watch the decision boundary bend.
61.3% on the training set after 0 epochs, with 17 parameters. Press Train and watch it move; press Reset and it starts from the same weights every time.
- Epochs run
- 0
- Parameters
- 17
- Training points
- 160
- Training accuracy
- 61.3%
- Held-out accuracy
- 45.0%
- Training loss (cross-entropy)
- 0.6648
- Held-out loss
- 0.7189
Set hidden units to 1 and pick the circle dataset, then train as long as you like. It will not work, and the reason is visible rather than asserted: one tanh unit followed by a linear output can only produce a single soft threshold across the plane, so the boundary is a straight line and a circle cannot be a straight line. This is the same wall the field hit in 1969 with the perceptron and XOR. Now move the slider to 3. The boundary bends. Nothing else changed.
That is what a hidden layer buys: each unit contributes one oriented soft step, and the output layer takes a weighted sum of them, so with enough units you can enclose a region by adding steps from several directions. It also explains why the improvement flattens — going from 1 to 3 units changes what is representable at all, while going from 8 to 12 mostly changes how quickly it is found. Watch the two accuracy rows rather than the picture: past a point, extra capacity starts helping the training number more than the held-out one, which is the same U-curve the overfitting demo draws explicitly.
What this leaves out is scale and everything that comes with it: no mini-batches, no depth, no normalisation, no attention, and 49 parameters where a modern model has hundreds of billions. The mechanism is genuinely the same — a forward pass, a loss, gradients by the chain rule, a small step downhill, repeated — but do not read the training dynamics here as a miniature of a real training run. They are not.