MKA: Memory-Keyed Attention for Efficient Long-Context Reasoning

arXiv cs.LG / 3/24/2026

💬 OpinionSignals & Early TrendsIdeas & Deep AnalysisModels & Research

Key Points

  • The paper identifies that long-context language modeling is increasingly bottlenecked by the memory and compute costs of maintaining and attending to large KV caches during both training and inference.
  • It proposes Memory-Keyed Attention (MKA), a hierarchical attention approach that combines local, session, and long-term KV caches and dynamically learns how to route attention among them.
  • It also introduces Route-Fused MKA (FastMKA), a broadcast-routed variant that fuses memory sources prior to attention computation to reduce runtime overhead.
  • Experiments report that FastMKA matches MLA’s perplexity while improving training throughput by up to 5× and reducing evaluation latency by about 1.8×, suggesting a strong accuracy–efficiency trade-off.
  • The authors position MKA as a practical and extensible framework for efficient long-context attention beyond the specific variants tested.

Abstract

As long-context language modeling becomes increasingly important, the cost of maintaining and attending to large Key/Value (KV) caches grows rapidly, becoming a major bottleneck in both training and inference. While prior works such as Multi-Query Attention (MQA) and Multi-Latent Attention (MLA) reduce memory by sharing or compressing KV features, they often trade off representation quality or incur runtime overhead. We propose Memory-Keyed Attention (MKA), a hierarchical attention mechanism that integrates multi-level KV caches (local, session, and long-term) and learns to route attention across them dynamically. We further introduce Route-Fused MKA (FastMKA), a broadcast-routed variant that fuses memory sources before attention computation for improved efficiency. Experiments on different sequence lengths show that FastMKA achieves a favorable accuracy-efficiency trade-off: comparable perplexity to MLA while achieving up to 5x faster training throughput and 1.8x lower evaluation latency. These results highlight MKA as a practical and extensible framework for efficient long-context attention.