Lune

NeurIPS2024Top-tier venue

NoMAD-Attention: Efficient LLM Inference on CPUs Through Multiply-add-free Attention

Tianyi Zhang, Jonah Yi, Bowen Yao, Zhaozhuo Xu, Anshumali Shrivastava

Abstract

Large language model inference on Central Processing Units (CPU) is challenging due to the vast quantities of expensive Multiply-Add (MAD) matrix operations in the attention computations. In this paper, we argue that there is a rare gem in modern CPUs, Single-Instruction-Multiple-Data (SIMD) registers, which allow for ultra-low-latency lookups in batch. We leverage this unique capability of CPUs to propose NoMAD-Attention, an efficient attention algorithm that replaces MAD operations with in-register lookups. Through hardware-aware algorithmic designs, NoMAD-Attention achieves the computation of attention scores using repeated fast accesses to SIMD registers despite their highly limited sizes. Moreover, NoMAD-Attention works with pre-trained attention-based LLMs without model finetuning. Empirical evaluations demonstrate that NoMAD-Attention maintains the quality of the original LLMs well, and speeds up the 4-bit quantized LLaMA-7B-based model by up to 2×\times at 16k context length. Our results are reproducible at https://github.com/tonyzhang617/nomad-dist.

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

  • 70% Size, 100% Accuracy: Lossless LLM Compression for Efficient GPU Inference via Dynamic-Length Float (DFloat11) cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
  • 70% Size, 100% Accuracy: Lossless LLM Compression for Efficient GPU Inference via Dynamic-Length Float (DFloat11) cites Sketch to Adapt: Fine-Tunable Sketches for Efficient LLM Adaptation
  • 70% Size, 100% Accuracy: Lossless LLM Compression for Efficient GPU Inference via Dynamic-Length Float (DFloat11) cites KV Cache is 1 Bit Per Channel: Efficient Large Language Model Inference with Coupled Quantization
  • 70% Size, 100% Accuracy: Lossless LLM Compression for Efficient GPU Inference via Dynamic-Length Float (DFloat11) cites LeanQuant: Accurate and Scalable Large Language Model Quantization with Loss-error-aware Grid
  • Big Bird: Transformers for Longer Sequences cites Reformer: The Efficient Transformer
  • FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness cites Big Bird: Transformers for Longer Sequences
  • FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness cites Reformer: The Efficient Transformer
  • H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
  • H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models cites Reformer: The Efficient Transformer
  • Nyströmformer: A Nyström-based Algorithm for Approximating Self-Attention cites Reformer: The Efficient Transformer
  • Sketch to Adapt: Fine-Tunable Sketches for Efficient LLM Adaptation cites KV Cache is 1 Bit Per Channel: Efficient Large Language Model Inference with Coupled Quantization
  • Sketch to Adapt: Fine-Tunable Sketches for Efficient LLM Adaptation cites LeanQuant: Accurate and Scalable Large Language Model Quantization with Loss-error-aware Grid
  • LeanQuant: Accurate and Scalable Large Language Model Quantization with Loss-error-aware Grid cites Sketch to Adapt: Fine-Tunable Sketches for Efficient LLM Adaptation
  • KV Cache is 1 Bit Per Channel: Efficient Large Language Model Inference with Coupled Quantization cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
  • KV Cache is 1 Bit Per Channel: Efficient Large Language Model Inference with Coupled Quantization cites H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models
  • LeanQuant: Accurate and Scalable Large Language Model Quantization with Loss-error-aware Grid cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
  • LeanQuant: Accurate and Scalable Large Language Model Quantization with Loss-error-aware Grid cites KV Cache is 1 Bit Per Channel: Efficient Large Language Model Inference with Coupled Quantization
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers4

  1. KV Cache is 1 Bit Per Channel: Efficient Large Language Model Inference with Coupled QuantizationTianyi Zhang, Jonah Yi, Zhaozhuo Xu, Anshumali ShrivastavaNeurIPS 2024 · 97 citations
  2. 70% Size, 100% Accuracy: Lossless LLM Compression for Efficient GPU Inference via Dynamic-Length Float (DFloat11)Tianyi Zhang, Mohsen Hariri, Shaochen (Henry) Zhong, Vipin Chaudhary et al.NeurIPS 2025 · 1 citation
  3. Sketch to Adapt: Fine-Tunable Sketches for Efficient LLM AdaptationTianyi Zhang, Junda Su, Aditya Desai, Oscar Wu et al.ICML 2025
  4. LeanQuant: Accurate and Scalable Large Language Model Quantization with Loss-error-aware GridTianyi Zhang, Anshumali ShrivastavaICLR 2025

Builds on12

  1. FlashAttention: Fast and Memory-Efficient Exact Attention with IO-AwarenessTri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra et al.NeurIPS 2022 · 5,493 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. H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language ModelsZhenyu Zhang, Ying Sheng, Tianyi Zhou, Tianlong Chen et al.NeurIPS 2023 · 1,003 citations
  5. Nyströmformer: A Nyström-based Algorithm for Approximating Self-AttentionYunyang Xiong, Zhanpeng Zeng, Rudrasis Chakraborty, Mingxing Tan et al.AAAI 2021 · 675 citations

Related papers

  1. SALE : Low-bit Estimation for Efficient Sparse Attention in Long-context LLM PrefillingXiaodong Ji, Hailin Zhang, Fangcheng Fu, Bin CuiICML 2026 · 3 citations
  2. MILLION: MasterIng Long-Context LLM Inference Via Outlier-Immunized KV Product QuaNtizationZongwu Wang, Peng Xu, Fangxin Liu, Yiwei Hu et al.DAC 2025 · 6 citations
  3. Gated Linear Attention Transformers with Hardware-Efficient TrainingSonglin Yang, Bailin Wang, Yikang Shen, Rameswar Panda et al.ICML 2024 · 390 citations
  4. Fast Matrix Multiplications for Lookup Table-Quantized LLMsHan Guo, William Brandon, Radostin Cholakov, Jonathan Ragan-Kelley et al.EMNLP Findings 2024 · 5 citations
  5. QiMeng-Attention: SOTA Attention Operator is generated by SOTA Attention AlgorithmQirui Zhou, Shaohui Peng, Weiqiang Xiong, Haixin Chen et al.ACL Findings 2025 · 1 citation
Dusk over the sea between two cliffs drawn in fine vertical lines