The High-Dimensional Amusement Park

Your intuition stops at 3D

You grew up in three dimensions, so your gut feelings about space are tuned for three. Machine learning, statistics and physics routinely work in thousands. Up there, oranges are all peel, random arrows are always perpendicular, and a ball can outgrow the box it is locked inside.

Every ride below is a live simulation running on your machine. Grab a dial.

This is a cube. Literally: all 2d corners of a d-dimensional cube, slowly rotating, with their shadows cast onto your screen. At d = 3 you recognise it. Push the dial to 16 and 65,536 corners melt into a fuzzy ball with a bell-curve profile. Hold that thought until Ride 12.

Land I

The Funhouse

Balls and cubes, the simplest shapes there are, stop behaving.

Ride 01You must be this tall to ride: d ≥ 7

Oranges are all peel

Take an orange whose peel is 10% of its radius. In our three-dimensional world, the peel is 27% of the orange's volume. Most of what you're eating is fruit.

Area-true drawing: each ring's share of the disc's area on screen equals its share of the orange's volume in d dimensions. The thin lines mark every 10% of the radius. Watch them crowd toward the centre: the inner 90% of the radius holds almost nothing.

Why

Volume grows like radiusd. Shrink a ball's radius by 10% and in 3D you lose 27% of its volume. In 100D you lose all but 0.003% of it. So in high dimensions almost all of any ball's volume sits in a thin layer just under its surface. Half the weirdness on this page comes from this one fact.

Ride 02You must be this tall to ride: d ≥ 6

The incredible shrinking ball

A ball of radius 1 has diameter 2 in every dimension. Its volume is 2 in 1D (a segment), π in 2D, 4.19 in 3D. Keep going and the volume peaks at d = 5, then shrinks forever toward zero. The ball doesn't get any narrower. It just stops filling anything.

Why

Going up two dimensions multiplies the ball's volume by 2π/d, while the cube around it gains a factor of 4. Once d passes 2π ≈ 6.3, every step makes the ball smaller. The ball still touches the middle of every wall of its cube, but the cube's volume is out in its corners, and there are 2d of them.

Ride 03You must be this tall to ride: d ≥ 4

Cubes are sea urchins

The walls of a unit cube are ½ from its centre. Its corners are √d / 2 away. In 100 dimensions that is 5 units, so the corners stick out ten times farther than the walls. A high-dimensional cube looks less like a box and more like a sea urchin: a small core with 2d long spikes.

How to read it: the outline is the cube's surface, measured along 900 random directions from its centre. The spikes are corners (there are 2d; we draw 48). The solid circle is the ball that fits inside, touching every wall. The dashed ring is where a randomly chosen point of the cube typically is.

Why

A random point in the cube has d independent coordinates, each somewhere between −½ and ½. Its squared distance from the centre is a sum of d terms averaging 1/12 each, so it sits at about √(d/12). For d ≥ 4 that's outside the inscribed ball. The walls are close, but only in 2d directions. In the overwhelming majority of directions you travel a long way before you hit anything.

Ride 04You must be this tall to ride: d ≥ 10

The sphere that escapes its box

Take a 4×4 box. Put a ball of radius 1 in each corner, so they fill the box and touch each other. Now squeeze the biggest ball you can into the gap in the middle. In 2D it's tiny: radius 0.41. Do the same in d dimensions with 2d corner balls and the middle ball has radius √d − 1.

What your brain draws

Closer to the truth (true distances)

Left: the textbook picture, with the middle ball drawn at its true radius. Past d = 4 it overlaps the corner balls, which can't happen. So the picture is lying. Right: the same scene with true distances. The walls (red) are 2 from the centre straight along an axis, but the corner balls sit √d away along the diagonals, deep in the box's spikes. That leaves a growing hole in the middle, and at d = 10 the middle ball pushes through the walls.

Why

Each corner ball's centre is at (±1, ±1, …, ±1), a distance √d from the middle. Subtract its radius of 1 and that's the room left for the middle ball. The walls stay put at distance 2. At d = 9 the middle ball touches every wall; from d = 10 on it bulges out through all of them, while still touching every corner ball. By d = 1,206 it holds more volume than the entire box.

Snack bar
88.2°

The diagonal is perpendicular to everything

The long diagonal of a 1,000-dimensional cube makes an angle of 88.2° with every one of its edges. In general cos θ = 1/√d, which goes to zero.

Snack bar
266

More corners than atoms

A 266-dimensional cube has 2266 ≈ 1.2×1080 corners, more than the estimated number of atoms in the observable universe.

Snack bar
10100

The curse of the grid

Ten sample points per axis is a coarse grid. In 100 dimensions that's a googol points. That's why nobody tunes a neural network by grid search over its weights.

Land II

The Hall of Averages

Add up enough independent random things and the result becomes boringly predictable. In high dimensions that predictability takes strange geometric shapes. Mathematicians call it concentration of measure.

Ride 05You must be this tall to ride: d ≥ 5

Gaussians are soap bubbles

The bell curve peaks at its centre. In any number of dimensions, the single most likely spot for a Gaussian sample is the origin. Yet in 1,000 dimensions you could draw samples for the age of the universe and never land near it. Every sample sits on a thin shell at radius √d, like a soap bubble.

How to read it: 1,500 samples from a standard Gaussian in d dimensions. Each dot sits at its true distance from the centre, spun to a random angle (direction can't be drawn honestly, but distance can). The cross is the peak of the density. Toggle “averages” to add the midpoint of random pairs of samples.

Why

Density is highest at the centre, but there's almost no room there. Ride 01 again: the volume at radius r grows like rd−1, and that growth overwhelms the falling density everywhere except a narrow band around √d. The most likely point and the most likely distance are completely different things.

Why ML people care: average two latent vectors of a diffusion model or GAN and the midpoint lands at radius √(d/2), inside the bubble where no real sample lives. You get washed-out mush. That's why people interpolate along the shell with slerp (spherical interpolation) instead of a straight line.

Ride 06You must be this tall to ride: d ≥ 10

Everything is on the equator

Pick a north pole on a high-dimensional sphere. Nearly all of the sphere's surface lies in a thin belt around the equator. Now pick a different north pole. Nearly all of the surface is near that equator too. Both are true at once, for every equator you could choose.

How to read it: 1,200 uniformly random points on the sphere in d dimensions, shown by their first two coordinates (their shadow on a plane). Horizontal belt: the band around equator #1 that holds 90% of the sphere's surface. Vertical belt: the same for equator #2. The points pile up where the belts cross. They are near both equators at once.

Why

A random point on the unit sphere has d coordinates whose squares add up to 1, so each is about 1/√d in size. Being close to an equator just means one coordinate is small. In high dimensions every coordinate is small, so every point is close to every equator. Earth would be in for a surprise: if it were 1,000-dimensional, 90% of its surface would lie within a few hundred kilometres of the equator.

Ride 07You must be this tall to ride: d ≥ 20

Random arrows are perpendicular

Throw two arrows in random directions. In 2D, every angle between 0° and 180° is equally likely. In 3D they're already biased toward 90°. Keep going.

How to read it: each needle is the angle between one freshly drawn random pair of directions in d dimensions. The bars along the rim are a histogram of every pair so far.

Why

The cosine of the angle is a sum of d small products of random coordinates, which mostly cancel out. It's a random walk scaled down by d, so it lands within about 1/√d of zero. Zero cosine means 90°. This is also why the cosine similarity of two unrelated embeddings hovers near 0, and why “0.3” can be a strong match.

Ride 08You must be this tall to ride: d ≥ 50

Room for billions of almost-perpendicular arrows

In 3D you can have at most 3 arrows that are all exactly perpendicular to each other. In d dimensions, at most d. But relax “exactly 90°” to “somewhere between 85° and 95°” and the count explodes, roughly exponentially in d. Let's try it: keep drawing random arrows, and keep each one only if it's nearly perpendicular to every arrow kept so far.

Live: greedy packing in your browser

Capacity by dimension (log scale)

Right: the number of arrows random greedy packing fits, computed from the exact angle distribution, with the hidden widths of some well-known language models marked. These are lower bounds; cleverer constructions do better.

Why it matters

A neural network with a 4,096-dimensional hidden layer seems to have room for 4,096 independent “features”. Yet interpretability research finds models represent far more concepts than they have dimensions. The leading explanation is superposition: features get almost-perpendicular directions instead of exactly perpendicular ones, accept a little interference, and pack in exponentially more.

Ride 09You must be this tall to ride: d ≥ 30

Everyone is equally far away

Scatter 300 random points in a cube and measure how far each one is from a randomly chosen point. In 2D, your nearest neighbour might be 100 times closer than your farthest. In 1,000D the nearest and the farthest are almost the same distance away. The phrase “nearest neighbour” stops meaning much.

How to read it: each tick is the distance from the reference point to one of 300 others, all uniform in the d-dimensional unit cube. Green is the nearest neighbour, red the farthest.

Why

A squared distance is a sum of d independent per-axis contributions. Sums concentrate: the typical size grows like d but the wobble only like √d, so the relative spread shrinks like 1/√d. This is the real reason k-nearest-neighbours on raw high-dimensional data struggles, and why embeddings learn low-dimensional structure first.

Land III

The Infinite Maze

Space gets big fast. So big that “nearby” and “typical” stop meaning what you think.

Ride 10You must be this tall to ride: d ≥ 10

Your neighbourhood is the whole town

Your data is spread evenly through a cube. You want a “local” neighbourhood: a small box that captures just 10% of the data. In 1D, that box covers 10% of the axis. In 10D, it has to cover 79% of every axis. “Local” has stopped being local.

How to read it: each bar is one axis of the space, and the coloured part is how much of that axis your neighbourhood has to span to capture the chosen fraction of the data. Up to 64 axes are drawn.

Ride 11You must be this tall to ride: d ≥ 20

Gradient descent lives on saddles

People used to worry that neural networks would get stuck in bad local minima. But a flat spot on a d-dimensional landscape is only a minimum if it curves upward in all d directions. If each direction were a coin flip, the odds would be 1 in 2d. A modern network has billions of directions.

How to read it: each row is a random flat point. Each cell is one direction: gold curves up (a valley), dark curves down (an escape route). A minimum needs a row that is entirely gold.

Why it matters

Real loss landscapes aren't coin flips, but the picture holds up: Dauphin et al. (2014) found that high-error critical points are overwhelmingly saddles, and that true minima tend to have low loss. The practical challenge is escaping long, flat saddles, not avoiding bad valleys. For random symmetric matrices the odds are even worse than coin flips, shrinking like e−c·d².

Snack bar
d ≥ 3

Stein's paradox

Estimating three or more unrelated averages (wheat yields, batting averages, tea prices)? Pulling all of them a little toward their common mean beats using each one's own average, in total expected error, every time. In 1D and 2D you can't beat the plain average.

Snack bar
0.003%

Peel, revisited

Peel a 100-dimensional orange whose peel is 10% of its radius and you throw away 99.997% of it. Your fruit bowl now holds air.

Snack bar
√2

Everyone's the same distance apart

Two random points on a high-dimensional unit sphere are almost always √2 ≈ 1.414 apart, the distance between two perpendicular unit arrows.

Land IV

The Shadow Theatre

Not all of it is a curse. Some of the strangeness is useful. It's why random projections, embeddings and wide neural networks work at all.

Ride 12You must be this tall to ride: d ≥ 8

Every shadow is a bell curve

Remember the melting cube at the top? Shine a light on a high-dimensional object from a random direction, and its shadow looks like a Gaussian. That's true for cubes, for most data sets, and for nearly every direction you could pick. This was proved by Diaconis and Freedman in 1984, and it's a headache for anyone hunting for the “interesting” view of their data.

How to read it: all 2d corners of a d-cube, projected onto one random line and binned into a histogram. The curve is a bell curve with the same spread. Press “new direction” to look from somewhere else.

Why

A shadow coordinate is a weighted sum of the object's d coordinates. Sums of many small independent-ish pieces are Gaussian (the central limit theorem). A related theorem from 1961, Dvoretzky's, says something even stranger: every high-dimensional convex shape, even a spiky cube, has slices that are almost perfectly round.

Ride 13You must be this tall to ride: any d

Squash 5,000 dimensions into 50

Here are 60 points in 5,000 dimensions. Multiply them by a matrix of pure random noise to squash them down to k dimensions. Surely that scrambles everything? It doesn't. Every one of the 1,770 pairwise distances survives almost intact. The Johnson–Lindenstrauss lemma says the k you need depends only on how many points you have, not on the original dimension.

How to read it: each dot is one pair of points: original distance across, distance after the random projection up. Perfect preservation is the diagonal line. The projection is computed live in your browser from 5,000 × k random numbers.

Why

Projecting a fixed vector onto k random directions measures its length k separate times, with independent noise. Averaging k noisy measurements makes the error shrink like 1/√k. A union bound over all pairs adds only a log(n) factor. That's the whole trick, and it underpins compressed sensing, sketching algorithms and fast nearest-neighbour search.

Land V

The Lost & Found

Some dimensions have personalities. Three is where you can get lost. Four is plain bizarre. Eight and twenty-four are miracles.

Ride 14You must be this tall to ride: d ≥ 3

A drunk man finds his way home. A drunk bird might not.

A random walker takes unit steps along a grid, choosing a direction uniformly at random each time. In 1D and 2D, it is certain to come back to where it started eventually. In 3D, only 34% of walkers ever return. The rest drift off forever. George Pólya proved this in 1921; Shizuo Kakutani summed it up with the line in this ride's title.

How to read it: 3,000 walkers per dimension, all running live. Each bar is the share that has made it back home so far; the tick is the exact long-run answer. The 1D and 2D bars keep creeping toward 100%; the others stall.

Ride 15You must be this tall to ride: d = 8 or 24

8 and 24 are magic

How tightly can you pack equal balls? In 3D it's the grocer's orange pyramid, and proving that took until 1998. In every dimension above 3, the answer is unknown, except two. In 8D the E8 lattice packs balls so perfectly that each one touches 240 others. In 24D the Leech lattice manages 196,560. Maryna Viazovska proved both optimal in 2016, and won the 2022 Fields Medal.

This is real 8D geometry: the centres of the 240 balls touching one ball in the E8 packing, projected onto the one plane that shows its 30-fold symmetry. Lines join neighbours that also touch each other.

Dimension 4
0 knots

Knots fall apart in 4D

Any knotted loop of string can be untied in four dimensions without cutting it. The extra direction lets one strand pass “around” another. To knot something in 4D you need to knot a 2D surface instead.

Dimension 4
Combable

The hairy ball gets a haircut

You can't comb a hairy 3D ball flat without a cowlick somewhere. The 4D version, a hairy 3-sphere, combs perfectly smoothly.

Dimension 4
L → R

Gloves change hands

No rotation in 3D turns a left glove into a right glove. A rotation through the fourth dimension does it, like flipping a paper cut-out of a hand over.

Dimension 4
∞ (uncountable)

Exotic space

Every ℝn has exactly one way to do calculus on it, except ℝ4, which has uncountably many inequivalent ones. Ours is the dimension where smooth geometry is wildest.

Regular solids
∞, 5, 6, 3, 3, 3…

The Platonic solids run out

Regular polygons: infinitely many. Regular solids in 3D: 5. In 4D: 6, including the 24-cell, which has no 3D analogue. In every dimension from 5 up: only 3 (simplex, cube and cross-polytope).

Packing
0.19%

The best packing is mostly empty

The Leech lattice is the densest packing in 24D, yet its balls fill only 0.19% of space. In 3D, oranges fill 74%. High-dimensional balls are terrible at filling space (see Ride 02).