arXiv:cs.CL· Sarah Pan, Ali Behrouz·· 16 小时前
Titan-Llama:用外部神经记忆模块改造预训练 LLM
Titan-Llama: Retrofitting Pre-trained LLMs with External Neural Memory Modules
AI 导读
Titan-Llama 是一种后训练方法,可为预训练注意力模型加装分层记忆架构,在保留近期 token 完整注意力的同时,将历史上下文压缩进固定大小的循环神经记忆模块(NMM),无需从头训练即可替换原有注意力层。
正文
Abstract:Transformers are efficient to pre-train at scale because attention permits parallel computation across sequence positions, but long-context inference requires increasingly large KV caches. Efficient recurrent alternatives reduce the asymptotic complexity of inference, but their sequential dependence limits token-wise parallelism during training, making them harder to scale. Further, the current paradigm of extending long context tasks creates competing notions of retaining information precisely and keeping long-context inference efficient. To address this gap, we introduce Titan-Llama, a post-training method for retrofitting attention-based language models with a hierarchical memory architecture that updates parameters at test-time. Titan-Llama applies a blockwise attention mask and preserves full-fidelity attention over recent tokens while compressing historical context into recurrent, fixed-size neural memory modules (NMMs). Our formulation allows pre-trained attention layers to be replaced without training a new language model from scratch. On Llama-3.2-1B-Instruct, Titan-Llama raises accuracy over segmented attention windows from 23.87\% to 40.51\% on QuALITY and from 14.50\% to 40.75\% on LongHealth. Inference benchmarks show more than 20\% faster prefill, 37\% faster decode at medium context lengths, and 24\% lower steady-state decode memory usage in the evaluated configurations. Together, these results demonstrate that incorporating memory architecture mechanisms that utilize test-time training effectively modulates long-context behavior of pre-trained models, offering a practical route to adapting pre-trained transformers for efficient long-context inference. Our code is released on Github \href{this https URL}{GitHub}
| Subjects: | Computation and Language (cs.CL); Artificial Intelligence (cs.AI) |
| Cite as: | arXiv:2610.19210 [cs.CL] |
| (or arXiv:2610.19210v1 [cs.CL] for this version) | |
| https://doi.org/10.48550/arXiv.2610.19210 arXiv-issued DOI via DataCite (pending registration) |
Submission history
From: Sarah Pan [view email]
[v1]
Tue, 13 Oct 2026 21:23:58 UTC (865 KB)
来源:arXiv:cs.CL · arxiv.org