English

Constant Memory Attention Block

Machine Learning 2023-06-23 v1

Abstract

Modern foundation model architectures rely on attention mechanisms to effectively capture context. However, these methods require linear or quadratic memory in terms of the number of inputs/datapoints, limiting their applicability in low-compute domains. In this work, we propose Constant Memory Attention Block (CMAB), a novel general-purpose attention block that computes its output in constant memory and performs updates in constant computation. Highlighting CMABs efficacy, we introduce methods for Neural Processes and Temporal Point Processes. Empirically, we show our proposed methods achieve results competitive with state-of-the-art while being significantly more memory efficient.

Keywords

Cite

@article{arxiv.2306.12599,
  title  = {Constant Memory Attention Block},
  author = {Leo Feng and Frederick Tung and Hossein Hajimirsadeghi and Yoshua Bengio and Mohamed Osama Ahmed},
  journal= {arXiv preprint arXiv:2306.12599},
  year   = {2023}
}

Comments

Workshop version of arXiv:2305.14567

R2 v1 2026-06-28T11:11:20.774Z