AI & LLMs

Backpropagation

also: backprop

The algorithm that computes how much each weight contributed to the error, so the network knows which way to adjust.

Backpropagation is how a neural network learns: after a forward pass produces an output and a loss, it applies the chain rule backward through every layer to compute the gradient of the loss with respect to each weight — how much that weight nudged the error.

Worked example: think of a deep stack of functions; backprop reuses each layer’s local derivative and multiplies them from output to input, so one backward pass gives every gradient at once instead of perturbing weights one at a time. Gotcha: multiplying many small derivatives makes gradients vanish (or many large ones explode) in very deep nets — the reason for residual connections, normalization, and careful initialization.