arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2407.12077cs.CLcs.AI
收藏

GoldFinch:高性能RWKV/Transformer混合模型,具备线性预填充与极致KV缓存压缩

GoldFinch: High Performance RWKV/Transformer Hybrid with Linear Pre-Fill and Extreme KV-Cache Compression

EleutherAI;Recursal AI;Dalle Molle Institute for Artificial Intelligence USI-SUPSI(USI-SUPSI达勒·莫勒人工智能研究所);Tano Labs

Daniel Goldstein, Fares Obeid, Eric Alcaide, Guangyu Song, Eugene Cheah

AI总结:

GoldFinch混合线性注意力与Transformer,利用RNN线性预填充并压缩KV缓存达756-2550倍,显著提升建模性能,支持超长上下文推理。

摘要:

我们提出了GoldFinch,一种混合线性注意力/Transformer序列模型,它采用新技术,以相对于序列长度的线性时间和空间高效生成高度压缩且可复用的KV缓存。GoldFinch将我们新的GOLD Transformer堆叠在增强版Finch(RWKV-6)架构之上。我们训练了Finch、Llama和GoldFinch架构的模型,参数量最高达15亿级别,并发现其建模性能相比Finch和Llama均有显著提升。我们的缓存大小节省随模型层数线性增加,对于常见规模,比传统Transformer缓存小756至2550倍,使得即使在有限硬件上也能推理极长的上下文。尽管自回归生成因注意力机制每token具有O(n)时间复杂度,但由于使用循环神经网络(RNN)生成该缓存,对提交上下文的整个初始缓存状态的预填充计算每token仅需O(1)时间。我们根据Apache 2.0许可证发布训练权重和训练代码,供社区使用。

英文摘要:

We introduce GoldFinch, a hybrid Linear Attention/Transformer sequence model that uses a new technique to efficiently generate a highly compressed and reusable KV-Cache in linear time and space with respect to sequence length. GoldFinch stacks our new GOLD transformer on top of an enhanced version of the Finch (RWKV-6) architecture. We train up to 1.5B parameter class models of the Finch, Llama, and GoldFinch architectures, and find dramatically improved modeling performance relative to both Finch and Llama. Our cache size savings increase linearly with model layer count, ranging from 756-2550 times smaller than the traditional transformer cache for common sizes, enabling inference of extremely large context lengths even on limited hardware. Although autoregressive generation has O(n) time complexity per token because of attention, pre-fill computation of the entire initial cache state for a submitted context costs only O(1) time per token due to the use of a recurrent neural network (RNN) to generate this cache. We release our trained weights and training code under the Apache 2.0 license for community use.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑