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

SHARCS:通过动态宽度子网络路由实现高效Transformers

SHARCS: Efficient Transformers through Routing with Dynamic Width Sub-networks

University of Washington(华盛顿大学);Allen Institute for Artificial Intelligence(艾伦人工智能研究所)

Mohammadreza Salehi, Sachin Mehta, Aditya Kusupati, Ali Farhadi, Hannaneh Hajishirzi

AI总结:

提出SHARCS自适应推理方法,通过在transformer上训练路由器将不同样本导向动态宽度子网络,在保持准确率的同时显著提升推理效率。

摘要:

我们引入了SHARCS,用于考虑输入样本难度的自适应推理。SHARCS可以在任何transformer网络上训练路由器,使模型能够将不同样本导向具有不同宽度的子网络。我们的实验表明:(1)在准确率与FLOPs方面,SHARCS在各种分类任务中优于或补充了现有的逐样本自适应推理方法;(2)SHARCS在不同架构间具有泛化能力,甚至可应用于压缩和高效的transformer编码器以进一步提升其效率;(3)SHARCS可在准确率微降的情况下提供2倍的推理加速。

英文摘要:

We introduce SHARCS for adaptive inference that takes into account the hardness of input samples. SHARCS can train a router on any transformer network, enabling the model to direct different samples to sub-networks with varying widths. Our experiments demonstrate that: (1) SHARCS outperforms or complements existing per-sample adaptive inference methods across various classification tasks in terms of accuracy vs. FLOPs; (2) SHARCS generalizes across different architectures and can be even applied to compressed and efficient transformer encoders to further improve their efficiency; (3) SHARCS can provide a 2 times inference speed up at an insignificant drop in accuracy.

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

↑