From the Perceptron to Backpropagation
The perceptron learns a linear threshold from mistakes; a multilayer perceptron composes differentiable affine maps and nonlinearities. Backpropagation is the efficient chain-rule computation that assigns each parameter its contribution to loss, not a separate learning objective or a biological explanation.
A neural network is a parameterized composition of functions. The perceptron supplies the linear decision unit; nonlinear hidden layers let compositions represent boundaries a single hyperplane cannot; backpropagation computes gradients through that composition without separately redoing shared calculations for every parameter.
The perceptron is a mistake-driven linear classifier #
For , predict
When an example is misclassified, update
If a positive point is on the negative side, moves the score upward for similar points. If a negative point is predicted positive, moves it downward. With linearly separable data and suitable repeated presentation, the perceptron converges to some separating hyperplane—not necessarily the maximum-margin one.
If classes overlap, updates need not settle. The raw threshold also supplies no probability. Averaging iterates, using a margin loss, or moving to logistic/SVM objectives produces different algorithms rather than repairing the same guarantee.
Why a hidden layer changes expressiveness #
XOR labels and negative, but and positive. No line separates these sets. Hidden units can create intermediate half-spaces and combine them into a non-convex decision region.
A feedforward layer computes
where acts elementwise. Without nonlinear , stacking layers collapses:
still one affine map. ReLU, sigmoid, tanh, or other nonlinearities prevent this collapse. An MLP is therefore not powerful because it has many matrix multiplications; its alternating linear maps and nonlinearities create a learned piecewise or smoothly nonlinear representation.
Backpropagation is reverse-mode chain rule #
Suppose a network produces loss through intermediate values:
flowchart TD X["input x"] --> Z1["z₁ = W₁x + b₁"] Z1 --> H["h = φ(z₁)"] H --> Z2["z₂ = W₂h + b₂"] Z2 --> L["loss L(z₂, y)"]
The forward pass computes and stores intermediates. The reverse pass starts with and propagates adjoints backward. For the first-layer weights,
The algorithm reuses each downstream derivative for every upstream parameter. Reverse-mode automatic differentiation makes the cost of all parameter gradients a modest multiple of the forward computation, rather than one full perturbation per parameter.
Backprop computes gradients. An optimizer such as SGD or Adam decides how to update parameters from them. Cross-entropy or squared error defines what is optimized. These are separate layers of the training mechanism.
A scalar worked pass #
Take , first weight , ReLU activation, output weight , target , and
Forward:
Backward:
With a small learning rate, both weights move downward. If , the ReLU derivative is zero and this example sends no gradient through —the mechanism behind a “dead” ReLU.
Output layer and loss must agree #
Binary classification commonly uses one logit with binary cross-entropy; multiclass mutually exclusive outcomes use softmax cross-entropy; regression may use a linear output with squared or robust loss. Applying a sigmoid before a numerically stable “with logits” loss duplicates the transform and can damage gradients.
The loss encodes statistical and decision assumptions. Squared error emphasizes large residuals; cross-entropy rewards probability quality; class weights change the effective training distribution. A neural network does not infer the correct objective from labels.
Gradient checks and misconceptions #
Finite differences can check a small network:
Use double precision and a range of for diagnostics; finite differences are too expensive and noisy for ordinary training.
Backprop is not “the error flowing backward” as a physical substance, and unit activations are not automatically interpretable concepts. Universal approximation does not promise learnability, finite-data generalization, or efficient optimization. The architecture, initialization, objective, data, and optimizer determine which representable function is actually found.
Sources
- bookData Recognition and Classification: Lecture Notespdfnotes
- paperRumelhart, Hinton and Williams: Learning Representations by Back-Propagating Errors
- bookDeep Learning, Chapter 6: Deep Feedforward Networks