HeadMem: Turning an LLM's Retrieval Heads into a Compact Memory for Later Question
HeadMem proposes using an LLM's retrieval heads, detected once per model, as a compact long-context memory. It stores only the compressed keys of these heads, using 290x less memory than the KV cache of Llama-3.1-8B, with no training and no additional model. For each question, the heads' softmax selects tokens for the model to re-read, and the method reportedly beats four KV compression approaches on multi-question RULER-style contexts. It can share a token budget with StreamingLLM or SnapKV and, when fused with BM25 or a dense retriever, outperforms BM25 and reranked dense RAG at 128k tokens.
Why it matters: It offers a training-free way to reduce long-context memory costs while preserving evidence retrieval, with reported compatibility with existing KV compression and RAG methods.