Machine Learning

The Curse of Dimensionality

Space stops behaving as soon as you add axes. Data spreads out until every point is alone, a ball abandons its middle for a paper-thin crust, every distance becomes the same distance, and any two directions you pick are almost certainly at right angles. Five different curses, one slider.

What to observe

  1. Empty space. Cut every axis into 10 bins and the number of cells is 10d. At d = 20 that is a hundred billion billion boxes, and your 600 points sit in 600 of them. The 2D picture still looks nicely filled, which is the trap: every low-dimensional projection lies about how crowded the real space is.
  2. Watch the curve on the right. To gather 10% of the data you must span63% of every axis at d = 5 and 89% at d = 20. A "local" neighbourhood stops being local, so anything built on neighbours (k-NN, kernels, histograms) quietly stops being local too.
  3. Volume in the crust. Drag d up and watch the dots evacuate the middle of the ball. The outer 5% shell holds under 10% of a 2D disc but over99% of a 100D ball. Nothing moved: it is just that volume scales like rd, so almost all of it is near the surface.
  4. All distances equal. The cloud around the query point collapses into a thin ring: by d = 60 the spread of the distances is only a few percent of their mean, and it keeps shrinking like 1/√d. Nearest and farthest stop being meaningfully different, which is why exact nearest-neighbour search loses its grip in high dimensions.
  5. Everything orthogonal. Two random directions have cos θ with mean 0 and standard deviation 1/√d. By d = 100 nearly every pair sits within a few degrees of 90°. High-dimensional space is roomy enough for enormous numbers of almost-orthogonal directions, which is exactly what makes random projections and superposition in embeddings work.
  6. Nothing but corners. The ball inscribed in a cube touches all 2d faces yet fills 1 part in 1028 of it at d = 50. All the volume hides in the 2d corners, and the cube's half-diagonal is √d while its inradius stays 1: the box is really a spiky sea urchin, not a box.

Shortcuts: space run/pause · s step · r reset · f fullscreen