Constantin F. Aliferis

Author directory

2026

The embedding table is a quiet ceiling of nearly every neural network model. Its size grows with the vocabulary, its rows are tied to a single modality, and unseen inputs require adding parameters. This makes the table prohibitively large at scale, impossible to share across modalities, and unable to represent new tokens without retraining.

We remove this ceiling with SpinHash, an O(1) encoder in the vocabulary size that stays constant at about 0.2M parameters regardless of how many tokens or modalities it serves. Instead of storing a vocabulary dependent table, SpinHash hashes each token into a compact spin code and decodes it with one shared feedforward network. Our hash is not merely a compression mechanism, but also defines the geometry of the representation space, realized by a similarity preserving Spin-SimHash and an antiferromagnetic Ising Spin-Repulse.

Across text, DNA, and clinical codes, SpinHash matches embedding tables with 17 to 283x fewer parameters, reaching parity on IMDB, AG-News, Yelp, and both clinical fusion tasks. For k=22 DNA, where 4^22 table entries are infeasible, SpinHash achieves 98.3% promoter accuracy, outperforming same-size HyenaDNA-tiny and the 1000x larger Nucleotide Transformer.

This work shows that representations need not be tied to a vocabulary, and that we can compute them once and reuse them across vocabularies, modalities, and domains.