MatMul-Free LM (ternary BitLinear, MLGRU + GLU)
A language model architecture that eliminates matrix multiplication, with ternary weights in some layers.
Language · 8,568 operations Checked
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
- Task
- Language
- Parameters
- 374.1M
- Operations
- 8,568
- Framework
- PyTorch
- Recurrent
- No
- Published
- 2024
- Cited by
- 67 (as of 12 November 2026)
- Authors
- Rui-Jie Zhu, Yu Zhang, Steven Abreu and others
- License
- Apache-2.0
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m1721
- Graph hash
- eeb7a2b1dec03547baebce971179ed206fa1af6bc6dc3393b673df9a0b0bfcae
- Skeleton hash
- 757164cc3955a32c999b4794965823acbb847cca0f3b89e8e9c901b8291ef5b8
- Architecture hash
- c8a60c9a2fc1c2638d3d095ba6572736123d9ccb768e462ba0603f800d6178bc
- Diagram SHA-256
- 5536a591a264c07817b953a68083be10c2c9224f71ecf6add8f571c4e60c2981
- 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 PyTorch
What it is
MatMul-Free LM is a language model architecture that eliminates the need for matrix multiplication (MatMul) operations. The paper's starting point is that the computational and memory cost of large language models comes mainly from their reliance on MatMul in the attention and feed-forward layers.
The models were tested at up to 2.7B parameters, and the paper reports that they are comparable to pre-trained Transformers, with the performance gap narrowing as model size increases. It also reports memory savings: a GPU-efficient implementation reduces memory consumption by up to 61% during training and by over 10x during inference. When the model is adapted for a multi-chip neuromorphic system, the paper reports 4x higher throughput with 10x less energy than edge GPUs.
According to the code repository, the model uses ternary weights in some layers. The repository compares 370M, 1.3B and 2.7B parameter models against Transformer++. Its 370M configuration is listed with 24 layers, a hidden dimension of 1024 and 15B trained tokens.
Key idea. Matrix multiplication can be eliminated from large language models, the paper shows, with performance comparable to pre-trained Transformers at up to 2.7B parameters.
- matmul-free lm
- mmfreelm
- matmul-free language model
- matmul free
- ternary weights
- ternary language model
- scalable matmul-free language modeling
- neuromorphic language model
- text generation
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{zhu2025scalablematmulfreelanguagemodeling,
title={Scalable MatMul-free Language Modeling},
author={Rui-Jie Zhu and Yu Zhang and Steven Abreu and Ethan Sifferman and Tyler Sheaves and Yiqiao Wang and Dustin Richmond and Sumit Bam Shrestha and Peng Zhou and Jason K. Eshraghian},
year={2025},
eprint={2406.02528},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2406.02528},
}