跳到正文
arXiv · Machine Learning· Nils Graef, Kayvan Zahiri, Andrew Wasielewski·· 8 小时前AI 评分47

Slim attention:通过 K-cache 将 MHA 上下文内存减半且不损失精度

Slim attention: cut your context memory in half without loss -- K-cache is all you need for MHA

AI 导读

Slim attention 为采用 MHA(多头注意力)的 Transformer 模型将上下文内存减少 2 倍,且与标准注意力机制在数学上完全等价,不损失模型精度。对于 Whisper 模型,内存可减少 8 倍,batch size 为 64 时 token 生成速度最高提升 5 倍;T5-11B 的内存可减少 32 倍。

来源:arXiv · Machine Learning · arxiv.org