arXiv cs.CL· Keqi Deng, Ruchao Fan, Jinyu Li·· 12 小时前AI 评分38
LazyFlash:前向稠密、反向稀疏的注意力机制加速长上下文微调
LazyFlash: Forward-Dense, Backward-Sparse Attention for Accelerated Long-Context Fine-Tuning
AI 导读
LazyFlash 提出一种前向稠密、反向稀疏的注意力训练方法,前向保持完全稠密以保证模型仍可被 vLLM 等现有系统直接部署,反向则按注意力输出梯度范数对 query 块排序并跳过贡献可忽略的块。
正文 · 原文
Abstract:As large language models (LLMs) process increasingly long sequences, attention becomes a major computational bottleneck. Sparse attention mostly targets inference, yet many methods still train densely or cannot support sparse training, and their added complexity makes sparsity hard to turn into wall-clock speedups, leaving dense attention widely used in practice. This paper introduces LazyFlash, a forward-dense, backward-sparse attention method built on the observation that attention training is dominated by the backward pass. LazyFlash keeps the forward pass exactly dense, so the trained model remains a standard dense model that existing systems such as vLLM can serve without any change. For the backward pass, LazyFlash proposes a gradient-aware block sparsification design that ranks query blocks by their attention-output gradient norms and skips those contributing negligibly to parameter updates, turning the dense backward into a block-sparse one. A gradient-mass budget adapts the amount of skipped computation to each head and training step, while importance sampling preserves the dense gradient in expectation. These designs are implemented inside the tiled FlashAttention backward kernel, where skipped blocks are never loaded or computed, translating gradient sparsity into real wall-clock acceleration. Experiments on long-context text and speech LLMs show that LazyFlash maintains downstream performance while achieving up to 5.7x attention-backward speedup over FlashAttention and 1.7x end-to-end training speedup.
| Subjects: | Computation and Language (cs.CL) |
| Cite as: | arXiv:2610.31911 [cs.CL] |
| (or arXiv:2610.31911v1 [cs.CL] for this version) | |
| https://doi.org/10.48550/arXiv.2610.31911 arXiv-issued DOI via DataCite (pending registration) |
Submission history
From: Keqi Deng [view email]
[v1]
Thu, 22 Oct 2026 21:04:07 UTC (209 KB)
来源:arXiv cs.CL · arxiv.org