Reproduce “MoNe: Modular Neural Memory for Efficient Long Context Inference” on OpenResearch

Run Claude Code, Codex or any coding agent as a research agent: literature, hypotheses and experiments on your laptop, cluster or cloud GPUs.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

Wonguk Cho, Kyubyung Chae, Tribhuvanesh Orekondy, Sunghyun Park, Hyoungwoo Park, Jeongho Kim, Arash Behboodi, Kyuwoong Hwang and 1 more

A modular neural memory (MoNe) from Qualcomm AI Research empowers existing, frozen Transformer models to process and reason over extremely long contexts with high efficiency. It achieved near-perfect scores on long-context reasoning tasks and significantly reduced peak GPU memory by up to 80% and computational FLOPs by up to 81% at 128K tokens compared to In-Context Learning.

Key insights

  • The two-phase O(N) preprocessing and O(1) inference design, coupled with constant peak GPU memory regardless of context length, effectively decouples the computational and memory burdens from the overall context length.
  • Layer-localized gradient updates to nonlinear memory modules, combined with segment-local Rotary Positional Embeddings (RoPE), enable robust generalization to context lengths significantly beyond the model's training distribution (e.g., 32x extrapolation).
  • Employing a nonlinear SwiGLU MLP for the memory module allows for encoding richer associative structures, which facilitates complex reasoning over distributed information, surpassing the limitations of embedding-based retrieval.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.