Learning how to Forget: Fine-tuning for Long-Context Sparse Attention
Matthias Seeger, Zeyu Zhang, Vihang Patil, Konstantinos Benidis, Sebastian Schelter
Key points
From the paper's conclusion- We also provide an efficient implementation of H2O sparse attention (the leading policy in our experiments) with dedicated scaled dot product attention kernel support.
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.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Stratified Sparse Attention: Reducing the Sparse-to-Dense Gap at Extreme SparsityarXiv · 2026
- HyScale: Scaling Long-Context Training for Learned Sparse AttentionarXiv · 2026
- RefineKV: Query-Adaptive KV Cache Compression via Attention-Error BoundsarXiv · 2026
- KV-Kaizen: Learning Context-Adaptive Cache Compression ChoicesarXiv · 2026
- PatchKV: Weight-Space Compensation of KV CachearXiv · 2026
- SlimKV: Joint Token-Feature KV Cache Compression with Reconstruction-Free Beacon AttentionarXiv · 2026