Artificial Neural Networks
The Multi-Layer Perceptron and Backpropagation
A multi-layer perceptron (MLP) stacks an input layer, one or more HIDDEN layers, and an output layer, with every neuron in one layer connected to every neuron in the next (feedforward, fully connected). Crucially, each hidden-layer neuron uses a NON-LINEAR activation function (sigmoid, tanh, or ReLU in modern practice — never a linear one) — if every layer's activation were linear, the entire multi-layer stack would collapse mathematically into an equivalent SINGLE linear layer, gaining nothing over a single perceptron; it is the non-linearity at each hidden layer that actually lets an MLP represent non-linearly-separable functions like XOR. Backpropagation is the algorithm that trains an MLP: it computes the output error, then propagates that error BACKWARD through the network layer by layer using the chain rule of calculus, computing how much each individual weight contributed to the error (its gradient), and updates every weight by GRADIENT DESCENT (moving it a small step in the direction that reduces the error) — this is what makes training a network with many hidden layers computationally tractable, rather than needing to guess weights or search them exhaustively.
Supervised, Unsupervised and Reinforcement Learning
| Paradigm | What the network is given | Standard ANN example |
|---|---|---|
| Supervised | Input-output pairs with the correct (target) output labelled | MLP trained by backpropagation |
| Unsupervised | Only inputs, no labelled target — the network must discover structure on its own | Self-organizing map (SOM) |
| Reinforcement | No labelled examples at all — only a scalar REWARD signal received after acting, and the network must learn a policy (which action to take) that maximises cumulative reward over time through trial and error | Not itself named for an ANN architecture in this syllabus item, but the paradigm applies broadly across AI |
Self-Organizing Maps and the Hopfield Network
- A Self-Organizing Map (SOM, Kohonen network) trains UNSUPERVISED, projecting high-dimensional input data onto a low-dimensional (typically 2D) grid of neurons while preserving TOPOLOGICAL relationships — inputs that are similar in the original high-dimensional space are mapped to neurons that are near each other on the grid. Training repeatedly finds the BEST-MATCHING UNIT (the grid neuron whose weight vector is closest to the current input) and updates that neuron's weights AND its neighbours' weights to move them closer to the input, with the neighbourhood radius and update magnitude both shrinking over training — this neighbourhood-based update is precisely what produces the map's topology-preserving property, unlike ordinary clustering which has no notion of which clusters are 'near' each other.
- A Hopfield network is a fully-connected, single-layer RECURRENT network (every neuron connects to every other, symmetric weights, no self-connections) used as ASSOCIATIVE (content-addressable) MEMORY: it can be trained (via a Hebbian-style rule) to store a set of patterns as STABLE STATES of its own dynamics, and when given a corrupted or partial version of a stored pattern as a starting state, its neurons update iteratively until the whole network settles into the nearest stored pattern — RECALLING the complete original from a noisy or partial cue, unlike an MLP, which computes a single feedforward pass with no memory of a settling process at all.
Key takeaways
- A single perceptron is a linear classifier, provably unable to learn a non-linearly-separable function like XOR; the perceptron learning rule converges only if the data is linearly separable.
- An MLP needs non-linear hidden-layer activation, or it collapses mathematically to a single linear layer; backpropagation trains it via the chain rule and gradient descent.
- Supervised (labelled), unsupervised (unlabelled) and reinforcement (delayed reward) are the three learning paradigms — the same supervised/unsupervised axis as classification versus clustering.
- A SOM does unsupervised, topology-preserving dimensionality reduction; a Hopfield network does associative memory/pattern completion — genuinely different jobs.
- The single-perceptron/XOR limitation historically stalled neural network research until multi-layer networks and backpropagation resolved it.
Practice questions (8)
Attempt each one before opening the answer. Every explanation names the tempting wrong option as well as the right one, because that is where marks are lost.
A single perceptron fails to learn the XOR function chiefly because:
Show answer
Answer: A — XOR's four points are not linearly separable, and a single perceptron is a linear classifier
No single straight line can separate XOR's two output-1 points from its two output-0 points, and since a single perceptron can only represent a linear decision boundary, it fundamentally cannot represent this function — this is exactly what Minsky and Papert proved rigorously in 1969.The perceptron convergence theorem guarantees the perceptron learning rule finds separating weights in finite steps:
Show answer
Answer: A — If and only if the data is actually linearly separable
If the data is not linearly separable (like XOR), the perceptron learning rule never converges and oscillates indefinitely — convergence is conditional on linear separability, not universal.If every layer of a multi-layer perceptron used a purely linear activation function, the network would:
Show answer
Answer: A — Mathematically collapse into an equivalent single linear layer, gaining nothing over a single perceptron
A composition of purely linear functions is itself linear, so stacking linear layers with no non-linearity adds depth without adding any representational power beyond a single linear layer — the non-linearity at hidden layers is what actually enables representing functions like XOR.In supervised learning, a neural network is trained using:
Show answer
Answer: A — Input-output pairs with the correct target output labelled
Supervised learning needs labelled target outputs to compute an error signal for backpropagation; unsupervised learning uses only inputs (as in a SOM), and reinforcement learning uses a delayed scalar reward instead of labelled examples.A self-organizing map (SOM), compared to a Hopfield network, is best described as solving:
Show answer
Answer: A — Unsupervised, topology-preserving dimensionality reduction, not associative memory/recall
A SOM projects high-dimensional data onto a low-dimensional grid while preserving similarity relationships, answering a genuinely different question from a Hopfield network's pattern-completion/associative-recall job — the two should never be conflated.Which of the following are true of a Hopfield network? (More than one option may be correct.)
Show answer
Answer: A — It is a fully-connected, recurrent, single-layer network; B — It can recall a complete stored pattern from a corrupted or partial version of it; C — It settles iteratively into a stable state rather than computing a single feedforward pass
A Hopfield network is trained to store patterns as stable states via a Hebbian-style rule, not via labelled input-output supervision in the MLP sense — its recall by iterative settling toward a stable state is exactly what distinguishes it from a feedforward MLP.Name the algorithm that trains a multi-layer perceptron by propagating the output error backward through the network using the chain rule, then applying gradient descent to each weight.
Numerical answer — type the value.
Show answer
Answer: backpropagation
Backpropagation is what made training networks with hidden layers computationally practical, resolving the historical single-perceptron/XOR limitation once combined with a multi-layer architecture.A self-organizing map updates not only the best-matching unit's weights but also its neighbours' weights, with the neighbourhood shrinking over training. This is chiefly why it:
Show answer
Answer: A — Preserves topology, so similar inputs map to nearby neurons on the grid
Updating a neighbourhood rather than only the single best-matching neuron is precisely the mechanism that produces the SOM's topology-preserving property, unlike ordinary clustering which has no notion of clusters being 'near' each other.