arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2407.05010cs.CV
收藏

PRANCE:面向自适应 ViT 推理的联合令牌优化与结构化通道剪枝

PRANCE: Joint Token-Optimization and Structural Channel-Pruning for Adaptive ViT Inference

Tsinghua University(清华大学);The Chinese University of Hong Kong(香港中文大学)

Ye Li, Chen Tang, Yuan Meng, Jiajun Fan, Zenghao Chai, Xinzhu Ma, Zhi Wang, Wenwu Zhu

AI总结:

本文提出 PRANCE 框架,通过权重共享元网络、PPO 轻量选择器和 Result-to-Go 机制联合优化 ViT 通道与令牌,在减少约半数 FLOPs、保留约 10% 令牌时保持 Top-1 精度无损。

摘要:

我们提出 PRANCE,这是一个 Vision Transformer 压缩框架,可根据输入特征联合优化激活通道并减少令牌。具体而言,PRANCE 在给定计算预算下利用自适应令牌优化策略,旨在从统一的数据与架构视角加速 ViT 推理。然而,该联合框架在架构和决策两方面都带来挑战。首先,尽管 ViT 天然支持可变令牌推理,但并不便于针对可变通道进行动态计算。为克服这一限制,我们提出一种采用权重共享技术的元网络,以支持 Multi-head Self-Attention 和 Multi-layer Perceptron 层的任意通道,并将其作为架构决策的基础模型。其次,同时优化元网络结构与输入数据构成一个决策空间极大的组合优化问题,其规模最高约达 10^14,使监督学习不可行。为此,我们设计了一个采用 Proximal Policy Optimization 的轻量级选择器以实现高效决策。此外,我们引入新颖的“Result-to-Go”训练机制,将 ViT 推理过程建模为 Markov decision process,显著缩小动作空间并缓解训练中的延迟奖励问题。大量实验表明,PRANCE 可有效减少约 50% 的 FLOPs,仅保留约 10% 的令牌,同时实现无损 Top-1 准确率。此外,我们的框架被证明兼容多种令牌优化技术,例如剪枝、合并以及顺序剪枝—合并策略。代码位于 https://github.com/ChildTang/PRANCE。

英文摘要:

We introduce PRANCE, a Vision Transformer compression framework that jointly optimizes the activated channels and reduces tokens, based on the characteristics of inputs. Specifically, PRANCE~ leverages adaptive token optimization strategies for a certain computational budget, aiming to accelerate ViTs' inference from a unified data and architectural perspective. However, the joint framework poses challenges to both architectural and decision-making aspects. Firstly, while ViTs inherently support variable-token inference, they do not facilitate dynamic computations for variable channels. To overcome this limitation, we propose a meta-network using weight-sharing techniques to support arbitrary channels of the Multi-head Self-Attention and Multi-layer Perceptron layers, serving as a foundational model for architectural decision-making. Second, simultaneously optimizing the structure of the meta-network and input data constitutes a combinatorial optimization problem with an extremely large decision space, reaching up to around $10^{14}$, making supervised learning infeasible. To this end, we design a lightweight selector employing Proximal Policy Optimization for efficient decision-making. Furthermore, we introduce a novel "Result-to-Go" training mechanism that models ViTs' inference process as a Markov decision process, significantly reducing action space and mitigating delayed-reward issues during training. Extensive experiments demonstrate the effectiveness of PRANCE~ in reducing FLOPs by approximately 50\%, retaining only about 10\% of tokens while achieving lossless Top-1 accuracy. Additionally, our framework is shown to be compatible with various token optimization techniques such as pruning, merging, and sequential pruning-merging strategies. The code is available at \href{https://github.com/ChildTang/PRANCE}{https://github.com/ChildTang/PRANCE}.

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

↑