The mechanics beneath every language model

Build the tiny network that makes the big ideas click.

Initialize weights. Run the forward pass. Backpropagate the error. Watch a neural network learn, one honest update at a time.

2 inputs2 hidden neurons1 output0 hidden steps

From code to convergence.

Every number below comes from a real 2-2-1 network running in your browser. Change the task, inspect the state, and train it yourself.

Training workbench

Choose the truth you want it to learn.

Initialized with seed 17. Ready for a forward and backward pass.
InputTargetPredictionClass
Learning signal

Loss should fall. Accuracy should hold.

0.00000mean loss
0%accuracy
0 updates completed · state saved locally
Last forward and backward pass

Nothing hidden.

A language model is vast, but its learning loop still rhymes with this: predict, measure the error, move the parameters, repeat.

One loop. Four visible moves.

Hover or focus a stage to open it. The same chain rule that trains this tiny network scales into the systems AI engineers build on every day.

INPUT

Represent

Two binary features enter as x₀ and x₁. The network sees numbers, never the human name of the logical rule.

FORWARD

Predict

Each hidden neuron computes a weighted sum and sigmoid activation. The output neuron combines those activations into a probability.

x₀x₁h₀h₁ŷ
LOSS

Measure

Binary cross-entropy turns the distance between prediction and target into one scalar objective. Lower is better.

BACKWARD

Update

The chain rule assigns responsibility to every weight. Gradient descent moves each parameter in the direction that reduces loss.

The stack beneath the abstraction.

Frameworks compress these operations. Understanding them expands your ability to debug, design, and reason.

Forward is a composition.

h = sigmoid(W₁x + b₁) ŷ = sigmoid(W₂h + b₂)

Loss gives direction.

L = -[y log(ŷ) + (1-y) log(1-ŷ)] dL/dz₂ = ŷ - y

Backprop assigns credit.

∂L/∂W₂ = dz₂ · h ∂L/∂W₁ = (W₂ᵀdz₂ ⊙ h(1-h)) · x

Stop treating the model like magic.

Train it, break it, reset it, and export the trace. First principles become useful when you can see every step.

Run the network
Super generates helpful tools and automates fact-checking across the internet proactively. If you enjoyed this tool, build your own with Super and share it with a friend.