[论文解读] Dancing along Battery: Enabling Transformer with Run-time Reconfigurability on Mobile Devices
本文提出 RT³,一种两级自动机器学习(AutoML)框架,结合块结构剪枝(BP)与基于强化学习的模式剪枝(PP),实现移动设备上 Transformer 模型的运行时可重构性。通过整合硬件(DVFS)与软件(动态模式集)的可重构性,RT³ 在 Transformer 模型上实现超过 4.9× 的电池续航延长,精度损失低于 1%,在 DistilBERT 上损失为 1.5%,同时通过 45ms 以内的模型切换时间保持实时性能。
A pruning-based AutoML framework for run-time reconfigurability, namely RT3, is proposed in this work. This enables Transformer-based large Natural Language Processing (NLP) models to be efficiently executed on resource-constrained mobile devices and reconfigured (i.e., switching models for dynamic hardware conditions) at run-time. Such reconfigurability is the key to save energy for battery-powered mobile devices, which widely use dynamic voltage and frequency scaling (DVFS) technique for hardware reconfiguration to prolong battery life. In this work, we creatively explore a hybrid block-structured pruning (BP) and pattern pruning (PP) for Transformer-based models and first attempt to combine hardware and software reconfiguration to maximally save energy for battery-powered mobile devices. Specifically, RT3 integrates two-level optimizations: First, it utilizes an efficient BP as the first-step compression for resource-constrained mobile devices; then, RT3 heuristically generates a shrunken search space based on the first level optimization and searches multiple pattern sets with diverse sparsity for PP via reinforcement learning to support lightweight software reconfiguration, which corresponds to available frequency levels of DVFS (i.e., hardware reconfiguration). At run-time, RT3 can switch the lightweight pattern sets within 45ms to guarantee the required real-time constraint at different frequency levels. Results further show that RT3 can prolong battery life over 4x improvement with less than 1% accuracy loss for Transformer and 1.5% score decrease for DistilBERT.
研究动机与目标
- 为解决在功耗受限的移动设备上部署大型、高精度 Transformer 模型并满足实时性能的挑战。
- 实现在运行时根据波动的功耗与性能需求,动态进行硬件与软件的可重构性调整。
- 联合优化模型压缩、能效与推理延迟,以适配移动端部署。
- 开发一种可扩展的自动化框架,支持在多个频率层级间实现轻量级模型切换。
提出的方法
- RT³ 采用块结构剪枝(BP)作为第一步压缩,以减小模型规模,并为后续模式剪枝提供‘热启动’搜索起点。
- 利用启发式方法基于 BP 处理后的模型生成压缩的模式集搜索空间,降低冗余的强化学习(RL)训练与搜索开销。
- 应用强化学习(RL)在缩减后的搜索空间中搜索最优模式集,对应于可用的 DVFS 频率层级。
- 该框架可在 45ms 内完成不同轻量级模式集之间的运行时切换,满足实时性要求。
- 将通过 DVFS 实现的硬件可重构性与通过模式集实现的软件可重构性相结合,以最大化节能效果。
- BP 之后主干模型保持不变,确保在运行时切换不同模式集时精度的一致性。
实验结果
研究问题
- RQ1结合块结构剪枝与模式剪枝的混合剪枝策略能否有效压缩 Transformer 模型,同时保持精度?
- RQ2强化学习能否在缩减后的搜索空间中高效搜索最优模式集,以实现轻量级的软件可重构性?
- RQ3如何联合优化硬件(DVFS)与软件(模式集)可重构性,以在移动设备上实现最大节能效果?
- RQ4在资源受限环境中,运行时可重构性在延长电池寿命的同时,能在多大程度上保持模型精度?
主要发现
- RT³ 在 Transformer 模型上实现电池续航 4.96× 的提升,精度损失仅为 0.95%。
- 对于 DistilBERT,RT³ 仅使性能得分下降 1.5%,同时实现超过 4.9× 的电池续航延长。
- 该框架可在 45ms 内完成不同模式集之间的模型切换,满足在不同 DVFS 频率层级下的实时性要求。
- 块结构剪枝将 WikiText-2 上的精度损失降低至 0.64%,优于随机剪枝(2.03% 损失),并有效实现搜索空间压缩。
- BP 与基于 RL 的 PP 联合策略在精度保持方面优于随机模式剪枝,精度损失为 4.88%,而随机方法达 11.07%。
- 可视化结果表明,RL 识别出的模式在不同稀疏度下均保留了结构特征,表明有效保留了模型特征。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。