arXiv:2507.16260cs.CVcs.LG2025-07

让视觉Transformer在低资源设备上更高效,通过延迟冻结和重用不重要令牌。

ToFe: Lagged Token Freezing and Reusing for Efficient Vision Transformer Inference

  • 提出滞后冻结与重用机制,保留早期被丢弃的令牌供后期使用。
  • 在LV-ViT上减少50%计算量,准确率损失小于2%。
  • 适合部署在算力受限设备上的视觉Transformer模型优化。

尽管视觉变换器(ViT)在各类视觉任务中表现卓越,但其计算成本高昂的自注意力机制限制了其在资源受限设备上的部署。令牌压缩通过前向传播中丢弃不重要令牌来提升模型效率,但现有方法不可逆地处理这些令牌,无法在后续层中重用。考虑到变换器在不同层级关注的信息不同,早期被压缩的令牌可能在后期仍有价值。为解决此问题,本文提出一种新型令牌冻结与重用(ToFe)框架:在每阶段识别重要令牌并暂时冻结不重要令牌,允许其在后续阶段滞后重用。设计了令牌识别预测模块与冻结令牌恢复近似模块,并通过考虑计算预算的端到端训练联合优化主干网络。实验表明,ToFe使LV-ViT的计算成本降低50%,Top-1准确率下降不足2%,在性能与复杂度之间实现了优于现有方法的平衡。

原文摘要 · Abstract (English)

Although vision transformers (ViT) have shown remarkable success in various vision tasks, their computationally expensive self-attention hinder their deployment on resource-constrained devices. Token reduction, which discards less important tokens during forward propagation, has been proposed to enhance the efficiency of transformer models. However, existing methods handle unimportant tokens irreversibly, preventing their reuse in subsequent blocks. Considering that transformers focus on different information among blocks, tokens reduced in early blocks might be useful later. Furthermore, to adapt transformer models for resource-constrained devices, it is crucial to strike a balance between model performance and computational overhead. To address these challenges, in this paper, we introduce a novel Token Freezing and Reusing (ToFe) framework, where we identify important tokens at each stage and temporarily freeze the unimportant ones, allowing their lagged reusing at a later stage. Specifically, we design a prediction module for token identification and an approximate module for recovery of the frozen tokens. By jointly optimizing with the backbone through computation budget-aware end-to-end training, ToFe can adaptively process the necessary tokens at each block, thereby reducing computational cost while maintaining performance. Extensive experiments demonstrate that ToFe reduces the computational cost of LV-ViT model by 50% with less than 2% drop in Top-1 accuracy, achieving a better trade-off between performance and complexity compared to state-of-the-art methods.

视觉Transformer模型压缩高效推理

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。