The Curse of Dimensionality

Add enough features and every point becomes roughly as far as every other.

🟡 intermediate5 min readtheory
As you add more features, the space your data lives in grows explosively, so the same number of data points ends up spread incredibly thin. Worse, in very high dimensions the distances between points become almost the same, so your nearest neighbour is barely nearer than the furthest one. That breaks methods built on distance, like k-nearest neighbours and k-means. The usual fixes are reducing dimensions with methods like PCA, choosing fewer and better features, or collecting much more data.

What is the Curse of Dimensionality?

When feature dimension dd grows large (e.g. d=10,000d = 10,000 in text embeddings or gene data), geometry in Rd\mathbb{R}^d behaves in non-intuitive, counter-intuitive ways.

  1D Space (Line): 10 bins        2D Space (Grid): 10x10 = 100 bins    3D Space (Cube): 10^3 = 1000 bins
  ├─┼─┼─┼─┼─┼─┼─┼─┼─┤              ┌───┬───┬───┐                         ┌───┬───┐
                                   ├───┼───┼───┤                         │   │   │ /
                                   └───┴───┴───┘                         └───┴───┘

For d=100d = 100 dimensions, dividing each feature axis into 10 regions requires 1010010^{100} grid cells to maintain sample coverage density!

Because datasets have at most millions of rows, high-dimensional spaces are almost entirely empty vacuum.

The 3 Geometric Illusions of High Dimensions

1. Distance Concentration (Equidistance)

Beyer et al. (1999) proved that in high dimensions, the distance between any two randomly chosen points converges to nearly the same value:

lim⁡d→∞distmax⁡−distmin⁡distmin⁡=0\lim_{d \to \infty} \frac{\text{dist}_{\max} - \text{dist}_{\min}}{\text{dist}_{\min}} = 0

If every data point is equally far away from every other point:

2. Hypersphere Crust Concentration

The volume of a dd-dimensional sphere of radius rr is V(r)∝rdV(r) \propto r^d.

Consider an outer shell between radius 0.990.99 and 1.001.00:

Volume Ratio=1−(0.99)d\text{Volume Ratio} = 1 - (0.99)^d

Almost all data mass concentrates in a razor-thin outer crust near the boundary.

3. Orthogonality of Random Vectors

Two random vectors drawn independently in high-dimensional space are almost guaranteed to be 90 degrees orthogonal (cos⁡(θ)≈0\cos(\theta) \approx 0).

Solutions to the Curse

  1. Dimensionality Reduction: Project data onto low-dimensional manifolds (k≪dk \ll d) using PCA, t-SNE, UMAP, or Autoencoders.
  2. Cosine Similarity over Euclidean: Cosine similarity handles high-dimensional directional alignment better than L2L_2 Euclidean distance.
  3. L1 Regularization (Lasso): Forces sparse feature selection, dropping uninformative noise dimensions.

Say this out loud

The Curse of Dimensionality describes how high-dimensional space becomes exponentially sparse. Euclidean distances concentrate so that all points become nearly equidistant, breaking algorithms like k-NN and k-means. Volume concentrates entirely in the outer crust of hyperspheres. We solve the curse using PCA, UMAP, or autoencoders to project data onto lower-dimensional manifolds.

Follow-ups to expect

Check yourself

Question 1 of 3

What happens to the ratio of distance to nearest neighbor versus distance to farthest neighbor in high-dimensional Euclidean space as d -> infinity?

More in Math & Statistics

See all →
Bayes’ Theorem4 minCentral Limit Theorem4 minLaw of Large Numbers4 min