Lune

ICML2023Top-tier venue

Recasting Self-Attention with Holographic Reduced Representations

Mohammad Mahmudul Alam, Edward Raff, Stella Biderman, Tim Oates, James Holt

Abstract

In recent years, self-attention has become the dominant paradigm for sequence modeling in a variety of domains. However, in domains with very long sequence lengths the O(T2)\mathcal{O}(T^2) memory and O(T2H)\mathcal{O}(T^2 H) compute costs can make using transformers infeasible. Motivated by problems in malware detection, where sequence lengths of T≥100,000T \geq 100,000 are a roadblock to deep learning, we re-cast self-attention using the neuro-symbolic approach of Holographic Reduced Representations (HRR). In doing so we perform the same high-level strategy of the standard self-attention: a set of queries matching against a set of keys, and returning a weighted response of the values for each key. Implemented as a ``Hrrformer'' we obtain several benefits including O(THlog⁡H)\mathcal{O}(T H \log H) time complexity, O(TH)\mathcal{O}(T H) space complexity, and convergence in 10×10\times fewer epochs. Nevertheless, the Hrrformer achieves near state-of-the-art accuracy on LRA benchmarks and we are able to learn with just a single layer. Combined, these benefits make our Hrrformer the first viable Transformer for such long malware classification sequences and up to 280×280\times faster to train on the Long Range Arena benchmark. Code is available at https://github.com/NeuromorphicComputationResearchProgram/Hrrformer

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

4 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention cites Reformer: The Efficient Transformer
  • A Walsh Hadamard Derived Linear Vector Symbolic Architecture cites MIMONets: Multiple-Input-Multiple-Output Neural Networks Exploiting Computation in Superposition
  • Big Bird: Transformers for Longer Sequences cites Reformer: The Efficient Transformer
  • Efficiently Modeling Long Sequences with Structured State Spaces cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
  • MIMONets: Multiple-Input-Multiple-Output Neural Networks Exploiting Computation in Superposition cites Efficiently Modeling Long Sequences with Structured State Spaces
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers4

  1. MIMONets: Multiple-Input-Multiple-Output Neural Networks Exploiting Computation in SuperpositionNicolas Menet, Michael Hersche, Geethan Karunaratne, Luca Benini et al.NeurIPS 2023 · 32 citations
  2. A Walsh Hadamard Derived Linear Vector Symbolic ArchitectureMohammad Mahmudul Alam, Alexander Oberle, Edward Raff, Stella Biderman et al.NeurIPS 2024 · 10 citations
  3. Beyond Raw Bytes: Towards Large Malware Language ModelsLuke Kurlandski, Harel Berger, Yin Pan, Matthew WrightNDSS 2026 · 5 citations
  4. FoGE: Fock Space inspired encoding for graph promptingTakis Chytas, Rudrasis Chakraborty, Vikas SinghNeurIPS 2025

Builds on15

  1. Efficiently Modeling Long Sequences with Structured State SpacesAlbert Gu, Karan Goel, Christopher RéICLR 2022 · 3,482 citations
  2. Big Bird: Transformers for Longer SequencesManzil Zaheer, Guru Guruganesh, Kumar Avinava Dubey, Joshua Ainslie et al.NeurIPS 2020 · 3,159 citations
  3. Reformer: The Efficient TransformerNikita Kitaev, Lukasz Kaiser, Anselm LevskayaICLR 2020 · 2,878 citations
  4. Transformers are RNNs: Fast Autoregressive Transformers with Linear AttentionAngelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, François FleuretICML 2020 · 2,665 citations
  5. Combining Recurrent, Convolutional, and Continuous-time Models with Linear State Space LayersAlbert Gu, Isys Johnson, Karan Goel, Khaled Saab et al.NeurIPS 2021 · 1,280 citations

Related papers

  1. Nyströmformer: A Nyström-based Algorithm for Approximating Self-AttentionYunyang Xiong, Zhanpeng Zeng, Rudrasis Chakraborty, Mingxing Tan et al.AAAI 2021 · 675 citations
  2. H-Transformer-1D: Fast One-Dimensional Hierarchical Attention for SequencesZhenhai Zhu, Radu SoricutACL 2021
  3. Classifying Sequences of Extreme Length with Constant Memory Applied to Malware DetectionEdward Raff, William Fleshman, Richard Zak, Hyrum S. Anderson et al.AAAI 2021 · 70 citations
  4. Long Range Arena : A Benchmark for Efficient TransformersYi Tay, Mostafa Dehghani, Samira Abnar, Yikang Shen et al.ICLR 2021 · 881 citations
  5. Treeformer: Dense Gradient Trees for Efficient Attention ComputationLovish Madaan, Srinadh Bhojanapalli, Himanshu Jain, Prateek JainICLR 2023
Dusk over the sea between two cliffs drawn in fine vertical lines