Deconstructing XOR: How Neural Networks Warp Space

2-2-1 Architecture Interactive Educational Laboratory

Epoch:0
Loss (MSE):0.000
Accuracy:0%

1. Input Space & Boundary (x₁, x₂)

Class 0 (0.0) Class 1 (1.0)

Linear perceptrons fail here because no single straight line can separate diagonal classes.

2. Network Synapses & Activations 2 → 2 → 1

■ Positive Weight (+) ■ Negative Weight (−)

3. Hidden Feature Space (h₁, h₂)

The hidden layer folds coordinate space, allowing the output neuron to cut them with a single line.

How a hidden layer can separate XOR

Read the explanation

The source’s four XOR examples label zero zero and one one as zero, and zero one and one zero as one. The positive examples have coordinate sum one; the negative examples have sums zero and two. A single threshold on a straight line cannot surround that middle band while excluding both opposite corners. Two hidden neurons can instead create features that are combined by the output. As a mathematical illustration, choose hidden sigmoid features ten times the input sum minus five, and ten times the sum minus fifteen. At sums zero, one and two, the first feature is about zero point zero zero seven, zero point nine nine three and one. The second is about zero, zero point zero zero seven and zero point nine nine three. The difference is small at both ends and large in the middle. These illustrative weights are not a claimed trained run of this randomly initialized source. The original network has two inputs, two hidden neurons and one sigmoid output. It reports mean squared error across all four examples and classifies at output zero point five. If all four outputs equal zero point five, squared error is one quarter for every point, while thresholding labels every point one and yields fifty percent accuracy for XOR. Step applies one full batch update. Activation and learning rate change the training dynamics, so convergence must be observed rather than assumed.

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.