25 November 2026 · 3 min readInteractive 3D
What if a straight line cannot separate data?
Some groups cannot be split by any flat wall. Why that limit shaped the history of AI, and how neural networks get round it.
A flat wall works brilliantly when two groups sit on opposite sides of the space. But some patterns wrap around each other, or sit in alternating corners. No single wall can split them.
The famous example
Take two switches and a light that is on when exactly one switch is up. Plot the four cases on a square: the two “on” cases sit in opposite corners, and so do the two “off” cases. No straight line separates them. This puzzle, called XOR, showed in the 1960s that a single neuron has hard limits, and it slowed AI research for years.
The way out
- Add layers: a hidden layer bends the space so a straight wall works afterwards.
- Add new measurements: lift the data into another dimension where it becomes separable.
- Use curved boundaries: methods such as decision trees cut the space into many pieces.
Neural networks do the first of these automatically. Each layer moves the data a little, until the last layer can split it with a simple wall.
XOR, worked out
XOR says yes when exactly one input is 1: (0, 1) and (1, 0) are yes; (0, 0) and (1, 1) are no. Plot them and the yes points sit on one diagonal, the no points on the other. No single straight line puts both yes points on one side and both no points on the other.
Fixing it with one extra feature
Add a third number, x × y. Now (1, 1) gets 1 and every other point gets 0. In 3D, the point (1, 1, 1) is lifted above the others, and a flat plane can slice it away. The data was not separable in 2D but became separable in 3D.
- Points: (0,0,0), (0,1,0), (1,0,0), (1,1,1)
- Rule: yes if x + y − 2xy > 0.5
- (0,1): 1 − 0 = 1 → yes; (1,0): yes
- (0,0): 0 → no; (1,1): 2 − 2 = 0 → no
How neural networks do it automatically
A hidden layer is a set of neurons that invent new features like x × y on their own. Each hidden neuron draws one line; the output neuron combines them. Two hidden neurons are enough to solve XOR, and many layers can bend the space so that very tangled data becomes separable.
Kernel methods, such as support vector machines, do the same trick of adding dimensions, but with a mathematical shortcut instead of learned neurons.
A circle example
Points inside a circle of radius 1 are class A, outside are class B. No line separates them. Add the feature r² = x² + y². Now the rule is simply r² < 1, a flat cut in the new direction. This is the same lift-and-slice trick as XOR.
A brief history
In 1969 Minsky and Papert showed that single-layer perceptrons cannot learn XOR, which slowed neural network research for years. Multi-layer networks trained by backpropagation, popularised in 1986, overcame the limit.
Glossary
- Linearly separable: splittable by a straight line or plane.
- Feature engineering: designing new inputs by hand.
- Hidden layer: neurons between input and output.
Try these yourself
- Q1. Points inside a circle versus outside: which feature helps? x² + y²
- Q2. Is AND linearly separable? Yes
- Q3. Is XOR? No, without extra features
- Q4. Minimum hidden neurons for XOR: 2
In short
When data cannot be split by a line, lift it into more dimensions with new features. Hidden layers learn those features automatically.
Keep going
Questions people ask
Why can a single neuron not solve XOR?
Because XOR’s two classes sit on opposite diagonals, and no single straight line separates them.
How do you separate data that is not linearly separable?
Add new features (dimensions) such as products or squares of the inputs, or use a neural network with hidden layers.
What does a hidden layer do?
It creates new features from the inputs, bending the space so the final layer can separate the classes with a straight boundary.