跳到正文
AI NEWS JOURNAL
arXiv cs.CLAI NEWS / JOURNAL

LazyFlash:用于加速长上下文微调的前向密集、后向稀疏注意力机制

arXiv:2610.31911v1 发布类型:新 摘要:随着大型语言模型(LLMs)处理的序列长度不断增长,注意力机制已成为主要的计算瓶颈。稀疏注意力大多面向推理阶段,但许多方法在训练时仍采用密集模式,或无法支持稀疏训练;加之其额外的复杂性,使得稀疏性难以转化为实际的运行时间加速,因此在实践中密集注意力仍被广泛使用。本文提出了 LazyFlash,一种前向密集、后向稀疏的注意力机制,其核心基于这样一个观察:注意力机制的训练过程主要由反向传播阶段主导。LazyFlash 使前向传播保持完全密集,因此训练后的模型仍然是标准的密集模型,现有系统(如 vLLM)无需任何修改即可直接服务。对于反向传播阶段,LazyFlash 提出了一种梯度-a

对应语言译文排队中,完成后自动更新。

arXiv:2610.31911v1 Announce Type: new

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.

资料来源

arXiv cs.CL
← 继续阅读全部动态