Skip to content

Our differences from VSA/HDC

tl;dr: There is some resemblance, but the differences outweigh it

People often point out that our approach looks very similar to VSA/HDC. Indeed, at a glance, there is some resemblance. Still, we believe the differences outweigh the similarities.

From what I gathered from the paper by Kleyko and Kanerva:

The main idea of VSA: let us take LOOONG vectors of 𝑁=103∼106 elements or more, and for each concept generate a random dense vector of the same length, {−1,0,1}×𝑁 for ℝ or {0,1}×𝑁 for binary, and then obtain a giant hypervector of description by mixing the individual seed vectors of individual concepts. The authors define various operations that help encode associations between concepts, positions, and so on.

For example, for graphs this would be one dense hypervector combining the vectors of all the edges. For images, a hypervector containing the information about the entire image, and so on.

By taming such a monster, one can — much like with a Bloom filter — run search operations, do clustering, and so on.

Now, about us. Yes, the first chapter of our paper is very similar to what Kanerva writes. Associations, lists, graphs and the rest really are encoded in a similar fashion. But there are important differences, too.

I wrote that chapter because it was important to me to show how our vectors can be worked with, and what kind of information can be encoded. Honestly, it never even occurred to me that the vectors by themselves could be something significant enough to warrant a whole paper. In computer science, we have been dealing with Boolean algebra, masks, and groups of flags for nearly 80 years now.

Unlike VSA/HDC, our vectors are considerably shorter. We operate with vectors of 128–256 bits, not millions of floats. We do not aim to merge all elements into a single hypervector; according to our model that is redundant and kinda pointless. We formulate the length–density–sensitivity trilemma and show how it can be resolved on short codes with color coding. If all vectors were random, we too would, indeed, have no other choice but to make gigantic vectors.

The length of 128–256 bits did not come out by accident. The whole point is that the human neocortex is represented by a regular structure of cortical minicolumns, each containing about 100–200 neurons (depending on the cortical region). We adhere to the concept of population coding and assume that the activation of a column’s neurons encodes the concept “raised” at that location in the cortex. This is equivalent to activating a point in the code space of our models. Importantly, both the activation pattern of minicolumns and our codes are sparse. That is, out of 128 bits in a single concept, only around 12 to 25 bits are activated per code. It may seem like little, but in practice one finds ways to handle the density and obtain a coding system that is at once sensitive to small changes and avoids oversaturation of the codes.

We try to stay within compact codes, because that lets us transform the codes without combinatorial explosion, and eventually, implement active memory for their efficient processing. The method of random subspaces makes it possible to transform one code into another, thereby dramatically simplifying the training of models (more on that later).

A single bit vector of resonable length can encode 5 concepts at most. Complex concepts are encoded hierarchically, using memory, structural and semantic generalizations.

This correlates with our subjective experience. Humans typically able to attend to, and to retain no more than 5–7 unrelated objects or concepts at once. To do more, we need training.

Think of yourself. When you have to dive into something radically new (say, a foreign language from a distant language family, or even something like cross-stitching or knitting if you have never once held a knitting needle, etc) it is genuinely hard at first: hard not so much to grasp the meaning of what is happening, but often just to remember anything. A foreign tongue (especially of tonal languages) seems utterly incomprehensible at first. But as your experience grows, you eventually start to discern individual structural elements, but still without understanding a thing. At long last, after extensive practice, you find yourself being able not to understand it (yet), but at the very least, to navigate in the domain. Only then you can actually start learning and internalizing the subject properly. Once it’s finally behind, your initial struggles seem absurd and laughable (“it’s just so obvious!”).

Our models adhere to, and embrace this very principle. First we memorize the primary stimuli (without trying to understand them), then we organize them in the code space and reduce its dimensionality thanks to the properties of the codes themselves. With the space organized, we gain the ability to describe a stimulus in new codes, specific to that domain. By having such codes at hand, the task of finding patterns in the domain (for example, for English it could be something like: helpful suggestion, thoughtful, decision, beautiful abstraction, etc.) becomes significantly combinatorially simpler.

So, our coding system is built precisely to make learning convenient and effective. At every layer we reduce the dimensionality and transform the topology of raw stimuli to their domain specific description. The primary codes are mapped into the code space, with similar codes getting neighboring places in that space.

As far as I know, in VSA no dimensionality reduction is performed, so they essentially have to deal with poorly organized data of monstrous dimensionality on top of it.

We rely on the manifold hypothesis, which suggests that a real domain usually has a much smaller dimensionality than the space in which it is perceived. For instance, MNIST has a dimensionality of 25628×28. That is an unimaginably huge number. But in the end, it reduces to just 10 classes, because the data itself has that inherent structure (the digits 0–9).

So, with a hierarchy of detectors laid over the unfolded code space, we apply LSH coding, which yields a compact yet still sparse code specific to that space. Honestly, I have not seen anything like it anywhere yet. Usually, dimensionality reduction is used for visualizing data and meditating over their structure. We use it to encode the next level of the hierarchy. This, again, is made possible by the properties of our codes.

There is an important point here: in our case the structural code of a stimulus arises as a superposition of the space’s reaction to that very stimulus. In a sense, all the stimuli seen before, together decide how to describe the current stimulus in their terms. At the same time, each point gets its place in the code space in the appropriate neighborhood.

And again, this differs from VSA, where the codes essentially conflict and compete instead of working together. If they do not do dimensionality reduction, the clustering will be rather dismal. The curse of dimensionality will make itself felt. Classical methods like k-means force you to say in advance how many classes you need. Density-based methods, like DBSCAN, feel like they would help little, given how scattered the points are.

On the other hand, we want the data itself to tell us what its structure is and what its classes are.

This note is also available in Russian: Отличия нашего подхода от VSA/HDC.