Pre-training and then fine-tuning large language models is commonly used to achieve state-of-the-art performance in natural language processing (NLP) tasks. However, most pre-trained models suffer from low inference speed. Deploying such large models to applications with latency constraints is challenging. In this work, we focus on accelerating the inference via conditional computations. To achieve this, we propose a novel idea, Magic Pyramid (MP), to reduce both width-wise and depth-wise computation via token pruning and early exiting for Transformer-based models, particularly BERT. The former manages to save the computation via removing non-salient tokens, while the latter can fulfill the computation reduction by terminating the inference early before reaching the final layer, if the exiting condition is met. Our empirical studies demonstrate that compared to previous state of arts, MP is not only able to achieve a speed-adjustable inference but also to surpass token pruning and early exiting by reducing up to 70% giga floating point operations (GFLOPs) with less than 0.5% accuracy drop. Token pruning and early exiting express distinctive preferences to sequences with different lengths. However, MP is capable of achieving an average of 8.06x speedup on two popular text classification tasks, regardless of the sizes of the inputs.


翻译:培训前和再微调大型语言模型通常用于在自然语言处理(NLP)任务中实现最先进的表现。 然而,大多数经过预先训练的模型都具有低推力速度。 将大型模型用于带有潜伏限制的应用是具有挑战性的。 在这项工作中,我们侧重于通过有条件计算加速推论。 为了实现这一点,我们提出了一个新颖的想法,即Magic Pyramid(MP),通过象征性的裁剪和提前退出基于变压器的模型,特别是BERT,减少宽度和深度计算。前者设法通过删除非静态符号来节省计算,而后者可以通过在达到最后层之前提前终止推断来完成计算减少。如果符合退出条件,我们的经验研究表明,与以往的艺术状态相比,MP不仅能够实现快速可调控的推算,而且通过将70%的悬浮点操作(GULOPs)降低到低于0.5%的精确度,而后者可以在到达最后层之前通过终止推算来完成计算。 然而,在两种不同的变形的顺序上,Token pass pass sqent squal squal squal squal squal laction.

0
下载
关闭预览

相关内容

专知会员服务
22+阅读 · 2021年9月20日
Google-EfficientNet v2来了!更快,更小,更强!
专知会员服务
18+阅读 · 2021年4月4日
最新《Transformers模型》教程,64页ppt
专知会员服务
292+阅读 · 2020年11月26日
知识图谱本体结构构建论文合集
专知会员服务
103+阅读 · 2019年10月9日
Transferring Knowledge across Learning Processes
CreateAMind
26+阅读 · 2019年5月18日
已删除
架构文摘
3+阅读 · 2019年4月17日
学术会议 | 知识图谱顶会 ISWC 征稿:Poster/Demo
开放知识图谱
5+阅读 · 2019年4月16日
AI/ML/DNN硬件加速设计怎么入门?
StarryHeavensAbove
10+阅读 · 2018年12月4日
基于Lattice LSTM的命名实体识别
微信AI
47+阅读 · 2018年10月19日
视觉机械臂 visual-pushing-grasping
CreateAMind
3+阅读 · 2018年5月25日
【推荐】YOLO实时目标检测(6fps)
机器学习研究会
20+阅读 · 2017年11月5日
最佳实践:深度学习用于自然语言处理(三)
待字闺中
3+阅读 · 2017年8月20日
【学习】Hierarchical Softmax
机器学习研究会
4+阅读 · 2017年8月6日
Arxiv
7+阅读 · 2021年10月12日
VIP会员
相关资讯
Transferring Knowledge across Learning Processes
CreateAMind
26+阅读 · 2019年5月18日
已删除
架构文摘
3+阅读 · 2019年4月17日
学术会议 | 知识图谱顶会 ISWC 征稿:Poster/Demo
开放知识图谱
5+阅读 · 2019年4月16日
AI/ML/DNN硬件加速设计怎么入门?
StarryHeavensAbove
10+阅读 · 2018年12月4日
基于Lattice LSTM的命名实体识别
微信AI
47+阅读 · 2018年10月19日
视觉机械臂 visual-pushing-grasping
CreateAMind
3+阅读 · 2018年5月25日
【推荐】YOLO实时目标检测(6fps)
机器学习研究会
20+阅读 · 2017年11月5日
最佳实践:深度学习用于自然语言处理(三)
待字闺中
3+阅读 · 2017年8月20日
【学习】Hierarchical Softmax
机器学习研究会
4+阅读 · 2017年8月6日
Top
微信扫码咨询专知VIP会员