The blessing of dimensionality

Jonathan “No Trump” Falk writes:

Your post this week on Integration and Differentiation got me thinking, never a good sign. Adding to this, I only really learned in January what Attention means, the foundation of LLM. And what it means is that in a vector space of 14,000 dimensions or so, you can express all manner of nuance… enough to start vitriolic arguments about the humanity of the output.

As I started thinking about this, and as your post crystallized, I have spent 50 years fighting the Curse of Dimensionality. I know this curse in my marrow. Brilliant inferences await me, but the space in which these insights are found is simply too vast to explore. So we simplify, reducing the dimensionality to something that while still vast, is confined to a hyperplane where we can, like Plato, see the projections of truth, not the truth itself.

But then what LLMs and their generation have taught me is that nuance, which is really just the inverse of inference (in that it’s the vast set of all things consistent with some inference) has an amazing boon of dimensionality. There appears to be no thought that can’t be described by a 14,000 dimension or so vector whose tuning has the huge advantage that 14,000-dimensional space is so empty that tiny nuances can be readily distinguished in such a space, so that you can hide uniqueness in the vastness of 14000-dimensional space that you couldn’t recover in a raw search in that same space.

I’m sure this inversion of the Curse of dimensional search into the Boon of nuance in high dimensions is not original to me, but I think it’s worth noting, and your post was the impetus.

I replied by pointing to our of our very earliest blog posts, The blessing of dimensionality, where I wrote:

The phrase “curse of dimensionality” has many meanings (with 18800 references, it loses to “bayesian statistics” in a googlefight, but by less than a factor of 3). In numerical analysis it refers to the difficulty of performing high-dimensional numerical integrals.

But I am bothered when people apply the phrase “curse of dimensionality” to statistical inference.

In statistics, “curse of dimensionality” is often used to refer to the difficulty of fitting a model when many possible predictors are available. But this expression bothers me, because more predictors is more data, and it should not be a “curse” to have more data. Maybe in practice it’s a curse to have more data (just as, in practice, giving people too much good food can make them fat), but “curse” seems a little strong.

With multilevel modeling, there is no curse of dimensionality. When many measurements are taken on each observation, these measurements can themselves be grouped. Having more measurements in a group gives us more data to estimate group-level parameters (such as the standard deviation of the group effects and also coefficients for group-level predictors, if available).

In all the realistic “curse of dimensionality” problems I’ve seen, the dimensions–the predictors–have a structure. The data don’t sit in an abstract K-dimensional space; they are units with K measurements that have names, orderings, etc.

For example, Marina gave us an example in the seminar the other day where the predictors were the values of a spectrum at 100 different wavelengths. The 100 wavelengths are ordered. Certainly it is better to have 100 than 50, and it would be better to have 50 than 10. (This is not a criticism of Marina’s method, I’m just using it as a handy example.)

For an analogous problem: 20 years ago in Bayesian statistics, there was a lot of struggle to develop noninformative prior distributions for highly multivariate problems. Eventually this line of research dwindled because people realized that when many variables are floating around, they will be modeled hierarchically, so that the burden of noninformativity shifts to the far less numerous hyperparameters. And, in fact, when the number of variables in a a group is larger, these hyperparameters are easier to estimate.

I’m not saying the problem is trivial or even easy; there’s a lot of work to be done to spend this blessing wisely.

It’s been over 20 years so worth sharing the point again.

7 thoughts on “The blessing of dimensionality

  1. No idea where Falk got 15K, but it’s off by 8 or 9 orders of magnitude. Frontier LLMs are now over a trillion parameters. Even the distillations I can run locally are tens of billions of parameters. The state instantiated for every query is huge because transformers are applied sequentially. The vocabulary of tokens is on the order 50K and that is the basis of the categorical generation of the next token. I posted on the blog here a couple years ago with pseudocode for GPT 3.5 written for people who know a bit about stats and matrices, but don’t know ML/NumPy notation (for whom there are great executable notebook introductions such as Karpathy’s on YouTube).

    • Maybe he’s referring to the token’s embedding dimensionality since that’s the relevant dimensionality of the attention matrix multiply? But then SOTA Qwen 3.5-27B is as “little” as 5120 dimensions. Anyways, I the embedding dimensionality of a token is significant. Expressiveness of a linear space scales exponentially with dimension as a consequence of the Johnson Lindestrauss lemma (significant for a lemma!). The number of vectors which can be almost orthogonal to each other scales increases very quickly with dimension. That means in “only” 5120 dimensions, you can express that a very large number of concepts are nearly unrelated to each other, or else add together to transform in extremely minor ways.

    • > No idea where Falk got 15K, but it’s off by 8 or 9 orders of magnitude. Frontier LLMs are now over a trillion parameters.

      The number would indeed be off by several orders of magnitude if it was the number of parameters. That suggests that the number was something else!

      Different numbers are used to describe the architecture of LLM. For example, for “GPT-3” ( https://arxiv.org/pdf/2005.14165 )

      n_params = 175.0B is the total number of trainable parameters,

      n_layers = 96 is the total number of layers,

      d_model = 12288 is the number of units in each bottleneck layer (we always have the feedforward layer four times the size of the bottleneck layer, dff = 4 ∗dmodel),

      n_head = 96 is the number of heads,

      and d_head =128 is the dimension of each attention head.

      The model uses a context window of n_ctx = 2048 tokens.

  2. I can’t help but notice the elegance with which this statement perfectly sums up the thinking behind p-values:

    “Brilliant inferences await me, but the space in which these insights are found is simply too vast to explore. So we simplify, reducing the dimensionality to something that while still vast, is confined to a hyperplane where we can, like Plato, see the projections of truth, not the truth itself.”

  3. The blessing/curse glass half full/half empty type metaphor I find applies to AI more generally. It has been said that “with AI what used to take a half hour, now takes 3 hours.” I find that true in many ways – it is due to the immensely greater background and capability that AI has compared with me. It does not replace me – without me, AI is likely to make mistakes, hallucinate, and misinterpret – with potentially serious consequences. But before AI, I satisfied myself with less sophisticated models – the ‘curse’ was more the norm. Now the ‘blessing’ is more apparent. At least until I think about how others may (will) use this blessing badly.

  4. I guess,

    “I replied by pointing to our of our very earliest blog posts,”

    should be

    “I replied by pointing to one of our very earliest blog posts,”

Leave a Reply

Your email address will not be published. Required fields are marked *