All models

Hrrformer-HRR

Self-attention rebuilt from HRR binding and unbinding, linear in sequence length; the LRA Text model.

Language · 691 operations Replay checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (335 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
15M
Operations
691
Framework
JAX
Recurrent
Yes
Published
ICML 2023
Cited by
3 (as of 16 October 2026)
Authors
Mohammad Mahmudul Alam, Edward Raff, Stella Biderman and others
License
Apache-2.0
Checked
Replay check passed: each recorded operation was replayed from its inputs. The whole model was not rerun against a known output.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m1371
Graph hash
1e2a3de036e95d4456871e81fcb530b715bc186dc4ec8e907125a673a728fc63
Skeleton hash
1e2a3de036e95d4456871e81fcb530b715bc186dc4ec8e907125a673a728fc63
Architecture hash
186b7da1fc0dd6fb00e71d142a102bf29ba42ef5ab71acc084cd06ddd11b1a48
Diagram SHA-256
6ae32118104bc7bd299c2533f843ab525acc4a88f9373484942d0b70b3e41e18
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in JAX

What it is

Hrrformer rebuilds self-attention out of Holographic Reduced Representations, a neuro-symbolic vector scheme, to get attention whose cost is linear in sequence length. The motivation was malware detection, where sequences of 100,000 or more tokens put ordinary transformers out of reach. It keeps the high-level shape of attention: queries matched against keys, returning a weighted response of the values.

HRR represents compositional structures using circular convolution, with binding and unbinding to store and retrieve concepts. All key-value pairs are bound and summed into a single superposition vector that represents the entire sequence. The result is O(T H log H) time and O(T H) space per layer, plus convergence in ten times fewer epochs. On Long Range Arena it reaches near state-of-the-art accuracy and can learn with just a single layer.

The official repository trains for 20 epochs on LRA, ten times fewer than prior works. Along with jax, flax and optax are used as higher-level libraries on top. The traced member is the LRA Text configuration, a byte-level classification task on IMDB movie reviews. That task is binary with a maximum sequence length of 4K. On the LRA table the single-layer Hrrformer scores 66.50 on Text.

Key idea. Self-attention recast with HRR binding and unbinding, giving linear-in-length time and space and single-layer learning on long sequences.

  • hrrformer
  • holographic reduced representations
  • hrr
  • vector symbolic architecture
  • neuro-symbolic attention
  • long range arena
  • lra text
  • linear self-attention
  • malware classification
  • alam
  • raff

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{alam2023recastingselfattentionholographicreduced,
      title={Recasting Self-Attention with Holographic Reduced Representations}, 
      author={Mohammad Mahmudul Alam and Edward Raff and Stella Biderman and Tim Oates and James Holt},
      year={2023},
      eprint={2305.19534},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2305.19534}, 
}