Paul’s learnings

Neural networks › The neuron and the perceptron

The neuron and the perceptron

Rosenblatt's 1958 Perceptron established the foundation of supervised machine learning: adjusting weights from error feedback. This chapter derives the perceptron update rule, states Novikoff's convergence theorem, gives the exact algebraic impossibility proof for XOR parity, and shows how hidden layers resolve it via coordinate transformation.

Linear threshold units and the decision boundary

A single perceptron takes an input vector x∈ℝd, computes an inner product with a weight vector w, adds a scalar bias b, and applies a step function (Heaviside step):

z=wTx+b=∑i=1dwixi+b y^=f(z)={1z>00z≤0

The decision boundary is the affine hyperplane wTx+b=0. The weight vector w is the normal vector perpendicular to the boundary, determining its orientation, while the bias b determines the perpendicular offset from the origin:

distance from origin to boundary=|b|‖w‖2

The perceptron learning rule and Novikoff's convergence bound

For binary classification with labels y∈{0,1} and learning rate η>0, when the perceptron predicts y^≠y on sample x, parameters update as:

w←w+η(y−y^)x,b←b+η(y−y^)

If y=1 but y^=0 (false negative), the rule adds ηx to w, rotating the normal vector towards x so that wTx increases. If y=0 but y^=1 (false positive), it subtracts ηx.

Novikoff's Theorem (1962)

If a training dataset D={(xk,yk)}k=1N is linearly separable by an optimal hyperplane w* with margin γ>0 (where ‖w*‖=1 and yk(w*Txk+b*)≥γ), and all inputs lie within a bounding sphere of radius R=maxk‖xk‖2, then the total number of mistake updates M made by the perceptron is strictly bounded:

M≤(Rγ)2

The perceptron is guaranteed to converge in a finite number of steps if the data is separable. However, if the data is not linearly separable, γ does not exist, and the learning rule oscillates indefinitely without converging.

Enable JavaScript to use this local playground. The explanation and sources below work without it.

Algebraic impossibility proof: why a single neuron cannot solve XOR

In 1969, Minsky and Papert highlighted that a single perceptron cannot learn the XOR (exclusive OR) parity function. Here is the formal algebraic proof using system inequalities:

Input (x_1, x_2)Target yCondition on w1x1+w2x2+bInequality
(0, 0)0w1(0)+w2(0)+b≤0(1) b≤0
(0, 1)1w1(0)+w2(1)+b>0(2) w2+b>0
(1, 0)1w1(1)+w2(0)+b>0(3) w1+b>0
(1, 1)0w1(1)+w2(1)+b≤0(4) w1+w2+b≤0

Summing inequalities (2) and (3):

(w2+b)+(w1+b)>0⇒w1+w2+2b>0

Subtracting inequality (4) from this result:

(w1+w2+2b)−(w1+w2+b)>0−0⇒b>0

This directly contradicts inequality (1) (b≤0). No real numbers w1,w2,b can satisfy this system of inequalities simultaneously. A single linear threshold unit is fundamentally incapable of separating XOR.

The two-layer resolution: coordinate transformation

XOR can be factored algebraically into elementary boolean operators: XOR(x1,x2)=AND(OR(x1,x2),NAND(x1,x2)). A two-layer network uses two hidden units to map the input space into a new coordinate representation (h1,h2):

h1=step(x1+x2−0.5)(OR unit) h2=step(−x1−x2+1.5)(NAND unit) y=step(h1+h2−1.5)(Output AND unit)

The hidden layer transforms the geometry: both positive points (0, 1) and (1, 0) map to the exact same hidden point (1, 1), while the negative points map to (0, 1) and (1, 0). In hidden space, a single linear threshold boundary separates the two classes cleanly.

Sources and further reading