arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.05305cs.CVcs.AIcs.CL
收藏

FlashBlock:用于高效长上下文块扩散的注意力缓存

FlashBlock: Attention Caching for Efficient Long-Context Block Diffusion

Monash University(墨尔本大学);Zhejiang University(浙江大学)

Zhuokun Chen, Jianfei Cai, Bohan Zhuang

AI总结:

研究长内容生成中块扩散在长上下文设置下的注意力计算开销问题,提出FlashBlock机制,利用块外注意力输出稳定性复用注意力,减少计算与缓存访问,提升效率且不影响质量。

摘要:

生成诸如分钟级视频和扩展文本等长格式内容对现代生成模型越来越重要。块扩散通过KV缓存和逐块因果推理提高推理效率,已广泛应用于扩散语言模型和视频生成。然而,在长上下文设置中,块扩散仍因在不断增长的KV缓存上重复计算注意力而产生大量开销。我们发现了块扩散一个未被充分探索的特性:块内注意力的跨步冗余。我们的分析表明,当前块之外的令牌的注意力输出在扩散步骤中基本保持稳定,而块内注意力变化很大。基于这一观察,我们提出了FlashBlock,一种缓存的块外注意力机制,它重用稳定的注意力输出,在不修改扩散过程的情况下减少注意力计算和KV缓存访问。此外,FlashBlock与稀疏注意力正交,可以作为一种互补的残差重用策略进行组合,在激进的稀疏化下显著提高模型准确性。在扩散语言模型和视频生成上的实验表明,令牌吞吐量提高了1.44倍,注意力时间减少了1.6倍,对生成质量的影响可以忽略不计。项目页面:this https URL。

英文摘要:

Generating long-form content, such as minute-long videos and extended texts, is increasingly important for modern generative models. Block diffusion improves inference efficiency via KV caching and block-wise causal inference and has been widely adopted in diffusion language models and video generation. However, in long-context settings, block diffusion still incurs substantial overhead from repeatedly computing attention over a growing KV cache. We identify an underexplored property of block diffusion: cross-step redundancy of attention within a block. Our analysis shows that attention outputs from tokens outside the current block remain largely stable across diffusion steps, while block-internal attention varies significantly. Based on this observation, we propose FlashBlock, a cached block-external attention mechanism that reuses stable attention output, reducing attention computation and KV cache access without modifying the diffusion process. Moreover, FlashBlock is orthogonal to sparse attention and can be combined as a complementary residual reuse strategy, substantially improving model accuracy under aggressive sparsification. Experiments on diffusion language models and video generation demonstrate up to 1.44$\times$ higher token throughput and up to 1.6$\times$ reduction in attention time, with negligible impact on generation quality. Project page: https://caesarhhh.github.io/FlashBlock/.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑