LazyFlash:通过前向稠密、反向稀疏注意力加速长上下文微调

arXiv cs.CL 论文

摘要

LazyFlash 提出一种前向稠密、后向稀疏的注意力机制,通过梯度感知的块稀疏化在保持模型性能的同时,实现最高 5.7x 的注意力反向加速和 1.7x 的端到端训练加速,适用于长上下文 LLM 微调。

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.
查看原文

相似文章

使用 LLMON 对大语言模型进行后训练

arXiv cs.AI

IBM Research 推出了 LLMON(LLM 对象表示法),这是一种将可执行指令与被动数据分离的后训练方法。在微调 Granite-4.1 模型时,该方法将提示注入攻击的成功率从 53–100% 降至 0.02–5.6%,同时保留了模型的通用能力。

SkillMem:用于隐式多智能体推理的紧凑外部技能记忆

arXiv cs.AI

SkillMem 为潜在空间中的多智能体推理引入了一种紧凑的外部潜在记忆,用于存储可复用技能。在使用 4B 至 14B 参数规模的 Qwen3 模型进行的各项基准测试中,其存储空间需求降至原来的 1/38,推理速度最高提升至原来的 4.23 倍。

WebAnything:从开放网络到可扩展的智能体环境

arXiv cs.AI

WebAnything 提出了一个全自动框架,可根据真实 URL 重建以源网站为依据、可复用的网页智能体环境,构建了 244 个网站实例,支持 12,984 项任务,并表明使用其交互轨迹对 Qwen3.5-9B 进行微调能够提高网页智能体在多个基准测试中的任务成功率。

Qwen3.8 27b 循环测试:int4 awq 对比 int8

Reddit r/LocalLLaMA

一位实践者基于两周的大量智能体日志,对比了采用 INT8 与 INT4 AWQ 量化运行的 Qwen3 27B,发现 INT4 会显著提高推理循环发生率(从每千次调用 1.9 次增至 4.7 次),使任务成功率从 92% 降至 78%,而且在超过 10 万 token 的长上下文中,差距会进一步扩大。INT8 甚至 BF16 也会出现循环,因此量化只是加剧了这一问题,而非其根源。

@shao__meng: 9集、230分钟 @jbhuang0604 系列视频「AI Training and Inference」把基座模型训练和推理基础讲清楚了,覆盖整个训推架构:单卡显存 → 千卡并行 → 便宜微调 → 推理加速 → 小模型蒸馏 → 推理 R…

X AI KOLs Timeline

博主分享 Jia-Bin Huang 制作的 9 集、230 分钟系列视频「AI Training and Inference」,系统覆盖基座模型训推架构:从 ZeRO/FSDP 显存优化、五维并行、LoRA 变体、投机解码、On-policy 蒸馏、GRPO 强化学习,到 AdamW/Muon 优化器及 LLM 服务。