跳到正文
arXiv (AI + Vision + Imaging)· Matthias Seeger, Zeyu Zhang, Vihang Patil, Konstantinos Benidis, Sebastian Schelter·· 1 天前AI 评分45

面向长上下文稀疏注意力的微调方法:让模型学会遗忘

Learning how to Forget: Fine-tuning for Long-Context Sparse Attention

AI 导读

一种新的稀疏注意力微调方法可适配任意 KV cache 策略,在单张 40 GB 显存的 Nvidia A100 上即可运行,并让模型与策略协同适应,效果常优于精确注意力训练。研究同时给出 H2O 稀疏注意力的高效实现及专用 scaled dot product attention kernel 支持,相关代码集成于开源库 KeysAndValues。

正文 · 原文

arXiv:2608.19920v3 Announce Type: replace Abstract: A lot of prior work addressed key-value (KV) cache selection and compression by sparse attention to enable long-context inference for transformer language models without excessive hardware budgets. We provide a new method for fine-tuning models with sparse attention. It works for any KV cache policy, runs on a moderate hardware budget (e.g., a single Nvidia A100 GPU with 40 GB RAM), and allows the model to co-adapt with the policy, often outperforming models trained with exact attention (sequence parallelism). We also provide an efficient implementation of H2O sparse attention (the leading policy in our experiments) with dedicated scaled dot product attention kernel support. KeysAndValues (https://github.com/awslabs/keys_values), a new open source library for long-context inference and fine-tuning, provides easy-to-use and performant code for all methods discussed here.

来源:arXiv (AI + Vision + Imaging) · arxiv.org