Concepts

Learn the basics

Hyperdimensional computing turns roles, values, and associations into high-dimensional hypervectors. Once they're in the same space, binding, bundling and permutation let us compose, retrieve and compare them. On this page, we'll demonstrate how that works with a simple example.

  1. 01 EncodeA role, value or record becomes a hypervector
  2. 02 ComposeSimple algebra preserves (and recovers) structure
  3. 03 RetrieveCosine similarity finds what's relevant

Example

A simple dataset

Let's begin with a simple dataset of connected entities. Maya and Noah are two people who know each other. Each has a name, an age, and a list of interests, and they share two interests. We'll use this example to explore encoding, composition, and associative search.

M Person 1

Maya

name
“Maya”
age
29
interests
sports music hiking
N Person 2

Noah

name
“Noah”
age
32
interests
music hiking photography
M KNOWS N

(Maya) -[KNOWS]→ (Noah)

The highlighted labels indicate a connection or overlap. We aren't adding a special “similar people” field. Instead, we'll let the encoded representation capture that overlap for us.

Step 1 · encode

Transform roles, values, and entity records into the same space

An encoder is an adapter that transforms raw data into hypervectors. It accepts the different types in our data and returns a hypervector with the specified dimensionality. Here we'll use 10,000 dimensions. The output shape remains fixed, whether the input is one string, one number, or a whole list.

Strings

Stable identities

A deterministic mapping assigns “Maya” or “music” the same random-looking hypervector every time. Hypervectors for different strings begin almost orthogonal, so accidental collisions are unlikely.

E("music") → vmusic

Numbers

Nearby stays nearby

Encoders can model ordinal values by changing the hypervector gradually across a range. Ages 29 and 32 stay similar, while ages 29 and 82 are much farther apart.

cos(E(29), E(32)) = 0.97

Lists

Many become one

Encode each item, then add the hypervectors together. The resulting bundle remains similar to every item in the list, so membership is still visible through cosine similarity.

E([a,b,c]) = E(a) ⊕ E(b) ⊕ E(c)

Why use so many dimensions?

There’s space to keep things distinct

In a very high-dimensional space, two random hypervectors are near-orthogonal. Their cosine similarity is near zero. Across the 500 deterministic random pairs used here, the mean cosine similarity is -0.001. Unrelated hypervectors have similarity near zero, so shared structure produces a clear signal.

E(“music”) · first 44 hypervector values d = 10,000
E(“hiking”) · first 44 hypervector values cos = -0.01

What the hypervector actually contains

An array of numbers

The strips shown above are visual shorthand. In practice, a person's hypervector is an array with 10,000 values. Here, each value is bipolar: either −1 or +1. Other HDC models use binary values (0 or 1) or real-valued numbers (floats). In every case, the same broad concepts can be represented and manipulated in the same high-dimensional space using simple operations.

PMaya = [ −1+1+1−1−1−1−1+1+1−1+1−1−1+1−1−1 … ]

first 16 of 10,000 values shown

Step 2 · compose

Combining binding, bundling and permutation

Binding attaches roles to values. Each role–value pair in the metadata gets its own hypervector. For example, “Maya” is bound to the name role, 29 to age, and “hiking” to interest. Bundling then collects those facts. Permutation lets us preserve position or order. We'll use it when we encode who knows whom. We can compose all three operations.

Bind · associate

Attach a field to its value

Binding is elementwise multiplication. The result is dissimilar from either input. Because bipolar binding is self-inverse, we can recover a value by binding the result with its role again.

role interest
value music
bound fact interest ⊗ music

Bundle · collect

Keep several facts together

Bundling is elementwise addition. The resulting hypervector remains similar to each input hypervector. We threshold the sum back to a bipolar hypervector to keep its shape convenient.

fact 1 name ⊗ Maya
fact 3 interest ⊗ sports
person hypervector P_Maya

Permute · order

Encode position and order

Permutation shifts the values in a hypervector using a fixed, reversible pattern. In our example, we'll use it to give Maya, KNOWS, and Noah different positions before we bind them. This lets us distinguish “Maya knows Noah” from “Noah knows Maya.” If we apply the same permutation to two hypervectors, their similarity stays the same. However, a hypervector and its permuted form will usually be dissimilar.

ρ

The complete record of a "person" in hypervector space

Every term has the same width, and the finished person hypervector still has 10,000 elements. The representation doesn't grow when we add fields. Each field's value, no matter its type, retains its signal and shares the same space.

Beyond entity metadata

Modeling connected data

We already have hypervectors for the persons Maya and Noah. HDC lets us also give the relationship predicate KNOWS its own hypervector. Before we bind the triple, we leave Maya as-is, permute KNOWS once and Noah twice. This gives each part a different position. The whole triple becomes one hypervector.

MsubjectPMaya
Kpredicateρ(RKNOWS)
Nobjectρ²(PNoah)
one relationship hypervector T_Maya,KNOWS,Noah

Query the relationship

Who does Maya know?

We can bind the stored triple with the parts we know. Maya and the permuted KNOWS hypervector cancel out, leaving Noah in the object's position. We then reverse that permutation to recover the hypervector for Noah.

Recovered object

Noah

N

cos(recovered, PNoah) = 1.00

Where this leads

From search to associative memory

We've seen how to use associative search to find the most similar hypervector to a given query. The same representation can also learn from examples. Using the fixed encoder, we transform a small number of new data samples into hypervectors, then bundle the hypervectors for examples with the same label into a prototype.

New samples are classified by similarity to those prototypes, which together form an associative memory. The learning is online: each arriving sample is encoded on the fly and added to its prototype. This form of learning is different from deep learning, which typically learns its encoder during a separate training phase. With HDC, the encoder stays fixed and only the prototypes change.

01encodea few labeled samples
02bundleone prototype per class
03comparefind the nearest prototype

A prototype accumulates what its examples share while smoothing away their individual differences. It can begin with one or a handful of samples, grow one update at a time, and remain immediately usable between updates. We don't need to retrain on the full dataset whenever a new example arrives.

Contact

Have a representation problem in mind?

We're actively helping teams push the boundaries of what's possible, aligning real-world use cases with where these techniques best fit. The applications of HDC are broad and varied, from associative search to memory and efficient online learning systems.

Get in touch

We usually reply within two business days.