MemoryFormer: Minimize Transformer Computation by Removing Fully-Connected Layers
Not on the map. Why?
Abstract (arXiv)
In order to reduce the computational complexity of large language models, great efforts have been made to to improve the efficiency of transformer models such as linear attention and flash-attention. However, the model size and corresponding computational complexity are constantly scaled up in pursuit of higher performance. In this work, we present MemoryFormer, a novel transformer architecture which significantly reduces the computational complexity (FLOPs) from a new perspective. We eliminate nearly all the computations of the transformer model except for the necessary computation required by the multi-head attention operation. This is made possible by utilizing an alternative method for feature transformation to replace the linear projection of fully-connected layers. Specifically, we first construct a group of in-memory lookup tables that store a large amount of discrete vectors to replace the weight matrix used in linear projection. We then use a hash algorithm to retrieve a correlated subset of vectors dynamically based on the input embedding. The retrieved vectors combined together will form the output embedding, which provides an estimation of the result of matrix multiplication operation in a fully-connected layer. Compared to conducting matrix multiplication, retrieving data blocks from memory is a much cheaper operation which requires little computations. We train MemoryFormer from scratch and conduct extensive experiments on various benchmarks to demonstrate the effectiveness of the proposed model.
Key facts. Cited by 4 papers in the map (data through 7 Oct 2026). Builds on 20 of its 29 references that are in the map. First posted on arXiv 20 Nov 2024.
Builds on
20 of 29 references.
References · 20
- 2017Attention Is All You Needcited by 59,932
- 2018Think you have Solved Question Answering? Try ARC, the AI2 Reasoning Challengecited by 4,710
- 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,611
- 2023Mistral 7Bcited by 3,065
- 2019PIQA: Reasoning about Physical Commonsense in Natural Languagecited by 2,818
- 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,346
- 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 1,979
- 2023Pythia: A Suite for Analyzing Large Language Models Across Training and Scalingcited by 1,734
- 2020Reformer: The Efficient Transformercited by 1,658
- 2020Rethinking Attention with Performerscited by 1,584
- 2020Linformer: Self-Attention with Linear Complexitycited by 1,462
- 2020Retrieve, Program, Repeat: Complex Knowledge Base Question Answering via Alternate Meta-learningcited by 216
8 more
- 2022cosFormer: Rethinking Softmax in Attentioncited by 212
- 2019SLIDE : In Defense of Smart Algorithms over Hardware Acceleration for Large-Scale Deep Learning Systemscited by 46
- 2013Beyond Locality-Sensitive Hashingcited by 23
- 2021You Only Sample (Almost) Once: Linear Cost Self-Attention Via Bernoulli Samplingcited by 17
- 2023Accelerating Deep Neural Networks via Semi-Structured Activation Sparsitycited by 10
- 2024LookupFFN: Making Transformers Compute-lite for CPU inferencecited by 8
- 2024HiRE: High Recall Approximate Top-k Estimation for Efficient LLM Inferencecited by 7
- 2014Revisiting Kernelized Locality-Sensitive Hashing for Improved Large-Scale Image Retrievalcited by 1
Built on by
Citing papers per year: 2025: 2; 2026: 2.
4 papers.
- 2025Overcoming Long-Context Limitations of State-Space Models via Context-Dependent Sparse Attentioncited by 5
- 2026MeKi: Memory-based Expert Knowledge Injection for Efficient LLM Scalingcited by 5
- 2026Do Value Vectors in Deep Layers Need Context from the Residual Stream?cited by 1
- 2025Exchangeability in Neural Network and its Application to Dynamic Pruningcited by 0
- 2026Do Value Vectors in Deep Layers Need Context from the Residual Stream?1 Jun 2026
- 2026MeKi: Memory-based Expert Knowledge Injection for Efficient LLM Scaling3 Feb 2026
- 2025Overcoming Long-Context Limitations of State-Space Models via Context-Dependent Sparse Attention1 Jul 2025
- 2025Exchangeability in Neural Network and its Application to Dynamic Pruning2 Jun 2025