Memory Efficient Neural Processes via Constant Memory Attention Block

Leo Feng, Frederick Tung, Hossein Hajimirsadeghi, Yoshua Bengio, Mohamed Osama Ahmed
5/23/2023
cs.LGcs.CV

No official code found. Best implementation: BorealisAI/constant-memory-anp (2 stars, last commit 2024-07-08).

Abstract

Neural Processes (NPs) are popular meta-learning methods for efficiently modelling predictive uncertainty. Recent state-of-the-art methods, however, leverage expensive attention mechanisms, limiting their applications, particularly in low-resource settings. In this work, we propose Constant Memory Attentive Neural Processes (CMANPs), an NP variant that only requires constant memory. To do so, we first propose an efficient update operation for Cross Attention. Leveraging the update operation, we propose Constant Memory Attention Block (CMAB), a novel attention block that (i) is permutation invariant, (ii) computes its output in constant memory, and (iii) performs constant computation updates. Finally, building on CMAB, we detail Constant Memory Attentive Neural Processes. Empirically, we show CMANPs achieve state-of-the-art results on popular NP benchmarks while being significantly more memory efficient than prior methods.

View on arXivView PDF

Code Implementations(1)

20PythonMay 27, 20242 years agoNOASSERTION

Similar Papers

Cite this paper

@article{feng2023memory,
  title  = {Memory Efficient Neural Processes via Constant Memory Attention Block},
  author = {Leo Feng and Frederick Tung and Hossein Hajimirsadeghi and Yoshua Bengio and Mohamed Osama Ahmed},
  year   = {2023},
  eprint = {2305.14567},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2305.14567v3},
  journal = {ICML 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2305.14567.svg)](https://codeofpaper.com/paper/2305.14567)

Discussion