Recall presents a difficult choice: transformers have a linearly growing memory that slows each successive token, while linear RNNs typically have fixed costs but limited recall. We present Key-Value Means ("KVM"), a novel block-recurrence for attention that can accommodate either fixed-size or growing state. Equipping a strong transformer baseline with fixed-size KVM attention layers yields a strong $O(N)$ chunked RNN, while adding only an insignificant number of new parameters. We train a transformer with a growable KVM cache and show it performs competitively on long-context tests with only subquadratic prefill time and sublinear state growth. KVM is implementable with standard operations and without custom kernels, and supports chunk-wise parallelizable training and prefill. It provides many of the benefits of both traditional transformers (expandable context memory, chunk-wise parallelizable training and prefill) and RNNs in a single unified package. It can be used on every layer, saving KV-cache memory, and allowing a continuous range of choices of prefill time complexity between $O(N)$ and $O(N^2)$. We release our code at https://github.com/featherless-ai/KVM-paper and trained models at https://huggingface.co/collections/featherless-ai/kvm-paper under the Apache 2.0 license.
DART: Decoded Attention over Recurrent States for Efficient Long-Context Sequence Modeling
College of Control Science and Engineering, Zhejiang University(浙江大学控制科学与工程学院);National University of Singapore(新加坡国立大学);Hong Kong Polytechnic University(香港理工大学);School of Science, Huzhou Normal University(湖州师范学院理学院)
The Curious Case of In-Training Compression of State Space Models
CSAIL, MIT(MIT 资深研究所);Max Planck Institute for Intelligent Systems(智能系统马克斯·普朗克研究所);ETH Zürich(苏黎世联邦理工学院);ELLIS Institute(ELLIS研究所);Tübingen AI Center(图宾根人工智能中心);Liquid AI
Imperial College London, UK(伦敦帝国学院);University of Copenhagen, Denmark(哥本哈根大学);Shanghai University of Finance(上海金融学院);Canon Inc., Japan(日本佳能公司);Technical University of Denmark, Denmark(丹麦技术大学)
SinkRec: Mitigating Semantic State Sink in Long Sequence Recommendation with Memory-Conditioned Gated Delta Networks
Kuaishou Technology, Beijing, China(快手科技,北京,中国);Beijing University of Posts and Telecommunications, Beijing, China(北京邮电大学,北京,中国);Independent Researcher(独立研究员)