跳到正文
arXiv · ML· Nils Graef, Kayvan Zahiri, Andrew Wasielewski·· 4 小时前AI 评分29

Slim Attention 实现 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 · ML · arxiv.org