Diffusion transformers have gained substantial interest in diffusion generative modeling due to their outstanding performance. However, their computational demands, particularly the quadratic complexity of attention mechanisms and multi-step inference processes, present substantial bottlenecks that limit their practical applications. To address these challenges, we propose TokenCache, a novel acceleration method that leverages the token-based multi-block architecture of transformers to reduce redundant computations. TokenCache tackles three critical questions: (1) Which tokens should be pruned and reused by the caching mechanism to eliminate redundancy? (2) Which blocks should be targeted for efficient caching? (3) At which time steps should caching be applied to balance speed and quality? In response to these challenges, TokenCache introduces a Cache Predictor that hierarchically addresses these issues by (1) Token pruning: assigning importance scores to each token to determine which tokens to prune and reuse; (2) Block selection: allocating pruning ratio to each block to adaptively select blocks for caching; (3) Temporal Scheduling: deciding at which time steps to apply caching strategies. Experimental results across various models demonstrate that TokenCache achieves an effective trade-off between generation quality and inference speed for diffusion transformers.


翻译:扩散Transformer因其卓越性能在扩散生成建模领域引起了广泛关注。然而,其计算需求——特别是注意力机制的二次复杂度与多步推理过程——构成了显著瓶颈,限制了实际应用。为应对这些挑战,我们提出TokenCache,一种利用Transformer基于令牌的多块架构来减少冗余计算的新型加速方法。TokenCache解决了三个关键问题:(1) 应通过缓存机制修剪和重用哪些令牌以消除冗余?(2) 应针对哪些模块实施高效缓存?(3) 应在哪些时间步应用缓存以平衡速度与质量?针对这些挑战,TokenCache引入了分层解决这些问题的缓存预测器,其通过以下方式实现:(1) 令牌修剪:为每个令牌分配重要性分数以确定修剪和重用的令牌;(2) 模块选择:为每个模块分配修剪比例以自适应选择缓存模块;(3) 时序调度:决定在哪些时间步应用缓存策略。跨多种模型的实验结果表明,TokenCache在扩散Transformer的生成质量与推理速度之间实现了有效权衡。

0
下载
关闭预览

相关内容

扩散模型中的缓存方法综述:迈向高效的多模态生成
专知会员服务
8+阅读 · 2025年10月23日
144页ppt!《Transformers》全面讲解,附视频
专知会员服务
117+阅读 · 2023年1月1日
【NeurIPS 2021】流形上的注意力机制:规范等变的Transformer
Transformer文本分类代码
专知会员服务
118+阅读 · 2020年2月3日
一文读懂Attention机制
机器学习与推荐算法
63+阅读 · 2020年6月9日
英伟达Faster Transformer:作者带你揭秘BERT优化
机器之心
14+阅读 · 2019年9月18日
深度学习的下一步:Transformer和注意力机制
云头条
56+阅读 · 2019年9月14日
多图带你读懂 Transformers 的工作原理
AI研习社
10+阅读 · 2019年3月18日
TensorFlow seq2seq中的Attention机制(续)
深度学习每日摘要
15+阅读 · 2017年11月16日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
Arxiv
0+阅读 · 2月15日
VIP会员
相关资讯
一文读懂Attention机制
机器学习与推荐算法
63+阅读 · 2020年6月9日
英伟达Faster Transformer:作者带你揭秘BERT优化
机器之心
14+阅读 · 2019年9月18日
深度学习的下一步:Transformer和注意力机制
云头条
56+阅读 · 2019年9月14日
多图带你读懂 Transformers 的工作原理
AI研习社
10+阅读 · 2019年3月18日
TensorFlow seq2seq中的Attention机制(续)
深度学习每日摘要
15+阅读 · 2017年11月16日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员