A Hippocampus for Linear Attention: An Exact Memory for What the Recurrent State Forgets
Summary
HOLA (Hippocampal Linear Attention) is a novel architecture designed to address the memory limitations of linear-attention and state-space language models. These models typically compress input prefixes into a fixed-size recurrent state, which often results in lossy memory and degraded recall of earlier information due to overwriting. Inspired by Complementary Learning Systems, HOLA integrates a delta-rule state for compressive memory with a bounded exact Key-Value (KV) cache. This semiparametric test-time memory allows the state to model linearly compressible structures while the cache stores critical associations. The cache writes tokens based on a large beta * ||e|| (prediction residual) and uses a decoupled RMSNorm-gamma read for sharp retrieval. Trained with 340M parameters on 15B SlimPajama tokens, HOLA reduced Wikitext perplexity from 27.32 to 22.92 (-16.1%), surpassing a full-attention Transformer++ (26.88). It also improved LAMBADA perplexity from 30.95 to 30.26 and demonstrated superior in-context retrieval and robustness on RULER needle-in-a-haystack recall up to 32k tokens.
Key takeaway
For Machine Learning Engineers developing long-context language models, HOLA presents a robust solution to memory degradation. If your current linear attention or state-space models struggle with needle recall over extended sequences, consider implementing a complementary exact KV cache. This approach significantly improves perplexity and in-context retrieval. It allows your models to maintain critical information over much longer contexts, up to 32k tokens, without complex learned eviction modules.
Key insights
HOLA enhances linear attention models with an exact KV cache, preventing memory loss and improving long-context recall.
Principles
- Combining compressive and exact memory improves recall.
- Prioritize cache storage for high prediction residuals.
- Decoupled cache reads enable sharp information retrieval.
Method
HOLA integrates a delta-rule state with a bounded exact KV cache. The cache writes tokens with large beta * ||e|| (prediction residual) and uses a decoupled RMSNorm-gamma read for sharp retrieval, avoiding soft averaging.
In practice
- Implement a dual-memory system for long contexts.
- Use prediction residuals to guide cache eviction.
- Apply RMSNorm-gamma for precise cache-based retrieval.
Topics
- Linear Attention
- State-Space Models
- Long-Context Memory
- Key-Value Cache
- Perplexity Reduction
- RULER Benchmark
Best for: Research Scientist, AI Scientist, Machine Learning Engineer
Related on AIssential
Editorial summary, takeaway, and curation by AIssential. Original article published by Artificial Intelligence.