HDC Overview
Take a vector with ten thousand dimensions and fill it at random. Take another one. They are almost orthogonal, and so is the next one, and the next thousand. Add two of them and the sum still resembles both. Bind two of them and you get a third vector that resembles neither, and from which, given one of the two, you can get the other back.1 That is hyperdimensional computing (HDC), also called vector-symbolic architectures (VSA): you compute with whole vectors and their superpositions, not with single bits.
I came to it from the brain side. Neuronal ensembles look hyperdimensional to me: many small parts, pattern completion, mixtures of half-active ideas [Braitenberg], [Buzsáki]. Then I stayed for the programming side, because Kanerva says you can build a Lisp out of it.2 But can you, really? Some of the pages below are me finding out.
This page is the hub for all my HDC/VSA work: posts, two notebook series, code, and what comes next.
Posts
- High-Dimensional Computing With Sparse Vectors Using Clojure: the big one. Binary sparse block codes in Clojure, a sparse distributed memory (SDM) with a multi-value mode, a k-fold sequence memory, and my argument that Kanerva's address decoder is a reader-centric cell assembly seen from the reader: the decoder is the reader, the input patterns within its radius are its assemblies.
- Machine Learning Diary: classifying Iris with a sparse distributed memory, in exploration mode.
- Neuronal Ensemble Memetics: the very large pile of notes on cell assemblies where HDC first showed up, as the more principled take on some of the same ideas.
- Neuronal Memetics Overview: the short version. Ensembles as active data structures, a hyperspace as concept space.
- Current Stuff | November 2024: a snapshot, with a section on HDC, SDM and associative models.
Series: A Vector-Symbolic Clojure
A small Clojure in which every value is one vector of 2048 numbers: lists, maps, sets, integers, closures, and the environment the evaluator runs in. It carries Tomkins-Flanagan and Kelly's Hey Pentti, We Did It!, a Lisp 1.5 built from holographic reduced representations, over to Clojure,3 and then runs it until it breaks. The overview and the build-up are notebooks whose numbers the code computes live. Code.
- A Vector-Symbolic Clojure: the overview. The design, how robust it is, superposition programming, and the five traps I fell into.
- Building a Vector-Symbolic Interpreter: from random vectors to
(fact 5), step by step. - How the Vector-Symbolic Clojure Got Here: what broke, roughly in the order I found it, and what changed.
- Reproducing the Traps in the Original Code: the five traps, run against the original authors' own code, which shows which of them apply there, with errata for the authors.4
Series: HDC Time Series
HDC-MiniROCKET is the work of Kenny Schlegel, Peer Neubert and Peter Protzel, all at TU Chemnitz at the time. Schlegel is still there; Neubert is now at the University of Koblenz.5 MiniROCKET turns a time series into about 10,000 features that ignore when something happened. HDC-MiniROCKET binds the features at each time step to a vector that encodes that time, and one scale parameter s sets how fine the time resolution is (s = 0 is plain MiniROCKET).6 A later paper by Schlegel, Rachkovskij, Kleyko and coauthors gives three real-valued versions of the position encoding; one of them, Sinusoid, has an exact shift operator.7 The ideas are theirs. This series reproduces their work and pulls on threads they left open. Four parts, with negative results stated as negative:
- Reproducing HDC-MiniROCKET: a clean-room reimplementation, run on all 128 UCR datasets. The authors' published per-dataset accuracies reproduce exactly from their code as it was before a 2022 bug fix. The three real-valued encodings are not significantly different. The shift operator moves positions; it does not predict the vector of a shifted signal.8
- Choosing the Time Scale: how to pick
swithout peeking at the test set. A development run on 20 datasets with three seeds, in my encoding and also in the authors' own encoding and pipeline: no method I tried beats the automatic choice from their 2025 follow-up paper, and that choice does not significantly beat leaving the time encoding out either. More than half of the oracle's gain is selection on test-set noise. The 20 datasets lean towards time encoding, so these are development results, not conclusions.9 - Streaming HDC-MiniROCKET: keep the sequence vector up to date in O(D) per sample with the shift operator. It equals the batch vector of the prefix once the edge is flushed, and at windows of 256 to 4096 samples a push is tens to hundreds of times cheaper than re-encoding, if you predict on every sample. Negative: on prefixes of a series, HDC does no better than plain MiniROCKET features, and a classifier trained on whole series cannot read prefixes.10
- Finding the Shift: align two series by sweeping the shift between their vectors, the whole similarity curve in one transform. Negative: for locating a planted copy in a stream it finds the copy less often than the plain MASS algorithm, even with far more memory than the raw stream, and with no more memory than the stream it finds it in 10 % of cases against 93 % for MASS. Retrieving series of the same class comes close to MASS on average, but not on every dataset.11
Code
All of these are public on GitHub.
- vector-symbolic-clj: the code behind the Vector-Symbolic Clojure series.
- vsa-binary-sparse-distributed-segments-clj: binary sparse segmented vectors after Laiho et al.,12 the SDM, and small examples of programming in superposition: What is the dollar in Mexico?, nondeterministic automata, trees, analogies.
- hdc-anomaly-skab: anomaly detection on the SKAB sensor benchmark. F1 0.71, against 0.78 for the best leaderboard methods, with one-pass training and a 1.2 KB model. My threshold is tuned on the test split, while the leaderboard notebooks set theirs without the test labels, so the 0.71 is optimistic.13
- clj-hdc-push: a Clojure HDC exploration library on PyTorch: MAP, HRR, FHRR and block codes, resonator networks. Meant as the HDC layer for Push-style genetic programming.
- hdc-wolfram: the beginnings of an HD/VSA framework for Wolfram, driven from Clojure via Wolframite, with notebooks.
- hyper-substrates: visualizing ensemble-like neuronal nets (blerps), on the way to putting a biological substrate together with HDC and associative memory.
Planned
- Time scale on held-out data. Freeze the methods from the development run, then run the 108 held-out UCR datasets with three seeds. Only then does any claim about
scount. - Streaming on a real stream. Human activity data instead of synthetic streams, and a real early-classification policy that stops when it is confident, with its earliness/accuracy trade-off.
- Shift-invariant similarity. The maximum over shifts as a similarity between series, for 1-nearest-neighbour classification, against Euclidean distance and DTW.
- Better location. Fix the tail of the shift estimator, which is right at the median and grossly wrong too often.
Open questions
- Is a neuronal ensemble a hypervector, or does it only look like one from far away?
- The shift search says the vectors carry what well and where poorly. Is that a limit of the dimension, or of smooth signals that put their energy at a few frequencies?
- Is a fixed
s = 7really that good, or is that the small development set talking? - Does early classification need one classifier per prefix length, or is there an encoding in which a prefix is just a noisy whole?
- Where does programming in superposition stop being cheaper than plain search?
- What plays the role of the cleanup memory in a brain?
Footnotes:
Kanerva, "Hyperdimensional Computing: An Introduction to Computing in Distributed Representation with High-Dimensional Random Vectors", Cognitive Computation 1(2), 2009: two random 10,000-bit vectors differ in about 5,000 ± 50 bits, "we run out of time before we run out of vectors"; a sum is similar to the vectors added, a product is dissimilar to the vectors multiplied. Getting the other factor back is exact for self-inverse binding (XOR, bipolar multiplication) and approximate in HRR (Plate 1995), where a cleanup memory snaps the result to the nearest known vector. doi:10.1007/s12559-009-9009-8
Kanerva, "Computing with 10,000-bit words", Allerton 2014, discusses how a vector-symbolic Lisp might be built (doi); the quote "We could implement Lisp" at the top of my sparse vectors post is from his Stanford seminar "Computing with High-Dimensional Vectors" (video). Tomkins-Flanagan and Kelly built one (see below).
Eilene Tomkins-Flanagan and Mary A. Kelly, "Hey Pentti, We Did It!: A Fully Vector-Symbolic Lisp", an abstract at MathPsych/ICCM 2024, on arXiv since October 2025. It builds the elementary functions of Lisp 1.5 from holographic reduced representations (Plate 1995) and a cleanup memory. D = 2048 is the default in vector-symbolic-clj and can be changed. arXiv 2510.17889
The original code is holis (eilene-ftf/holis, commit db208d7), from "Hey Pentti, We Did It!", and residuelisp (hanleyc01/residuelisp, commit 09864c7), from the follow-up "Hey Pentti, We Did (More of) It!" (arXiv 2511.08767). Not every trap applies to their code; the page says which do.
Schlegel, Neubert, Protzel, "HDC-MiniROCKET: Explicit Time Encoding in Time Series Classification with Hyperdimensional Computing", IJCNN 2022; the paper lists all three at Chemnitz University of Technology. Schlegel's later papers still list Chemnitz. Neubert heads a group at the University of Koblenz. arXiv 2202.08055, Neubert, Koblenz
Same paper, sections III and IV: MiniROCKET's averaging step (PPV) is a kind of bundling that throws away global timing. HDC-MiniROCKET binds the 9,996-dimensional feature vector of each time step to a timestamp vector made by fractional binding and sums over time. With s = 0 all timestamps are equal and it is MiniROCKET again.
Schlegel, Rachkovskij, Kleyko, Loutfi, Streif, Osipov, "Real-Valued Hyperdimensional Sequence Representations with Hadamard Product Binding and Shift Equivariance", August 2026. The three variants are an inverse-Fourier baseline, Sinusoid and Cosine-only; only Sinusoid shifts an encoded sequence without encoding it again. arXiv 2608.28334
Details in part 1; the sources are in its repo hdc-ts-core, docs/ERRATA.md E3 and E8, results/summary.json. The per-dataset numbers are the authors' published spreadsheet: all 896 dataset/scale cells match. The paper's Table II is close to it, not equal. "Not significantly different" is a Friedman/Nemenyi test with the best s per dataset.
Details in part 2; the sources are in its repo hdc-ts-scale, docs/DESIGN.md §6, results/ucr_subset20_summary.json and results/ucr_subset20_p2code_summary.json. Mean accuracy over 20 datasets and seeds 0 to 2, first in my reimplementation (encoding A, the 2022 ridge pipeline), then with the authors' encoding and the 2025 pipeline: no time encoding 0.8730 / 0.8724, the 2025 automatic choice 0.8743 / 0.8727, all scales concatenated 0.8817 / 0.8707, oracle 0.8877 / 0.8848. The 2025 rule is the leave-one-out choice of Schlegel, Rachkovskij, Kleyko, Gayler, Protzel, Neubert, Data Mining and Knowledge Discovery 39(6), 2025 (doi). The noise estimate picks s by test accuracy on one seed and scores it on another.
Details in part 3; the sources are in its repo hdc-ts-streaming, docs/DESIGN.md and results/exp2_cost.json. The timings are numpy on a shared machine and moved by up to 2.6 times between runs, so only their order of magnitude counts; with short windows or small D the push can be slower than re-encoding. A sliding window does not equal batch encoding of the window, because batch sees zeros before the window starts. The flushed stream equals the batch vector to 6e-8. Retrained per prefix length, HDC and plain MiniROCKET are within about a point of each other on 20 UCR datasets, one seed.
Details in part 4; the sources are in its repo hdc-ts-shift-search, docs/DESIGN.md §5 and results/exp2_motif_location.json (6 UCR datasets). The closed-form curve is the usual FHRR similarity; what the part adds is computing all shifts at once with a non-uniform FFT and measuring how well that locates things. The 10 % against 93 % are the configurations at noise 0.3 that store no more floats than the raw stream. On the Trace dataset, same-class retrieval stays more than 10 points behind MASS.
Laiho, Poikonen, Kanerva, Lehtonen, "High-dimensional computing with sparse vectors", IEEE BioCAS 2015: segmented sparse binary vectors with one active bit per segment. PDF
Leaderboard: waico/SKAB, outlier detection: Conv-AE and MSET F1 0.78, T²+Q 0.76, LSTM-AE 0.74. The reference notebooks set their threshold from training residuals times a fixed factor, or as a constant (MSET), e.g. ConvAE.ipynb. In the repo's own rerun, Conv-AE also reaches 0.71, and the HDC model trains in one pass (163 ms) to 1.2 KB binarized.
Generated by Claude on Benjamin Schwerdtner's behalf.