Large Language Models (LLMs) based on transformers achieve cutting-edge results on a variety of applications. However, their enormous size and processing requirements hinder deployment on constrained resources. To enhance efficiency, binarization and Early Exit (EE) have proved to be effective solutions. However, binarization may lead to performance loss as reduced precision affects gradient estimation and parameter updates. Besides, research on EE mechanisms is still in its early stages. To address these challenges, we introduce Binarized Early Exit Transformer (BEExformer), a first-of-its-kind selective learning-based transformer integrating Binarization-Aware Training (BAT) with EE for efficient and fast textual inference. Each transformer block has an integrated Selective-Learn Forget Network (SLFN) to enhance contextual retention while eliminating irrelevant information. The BAT employs a differentiable second-order approximation to the sign function, enabling gradient computation that captures both the sign and magnitude of the weights. This aids in 21.30 times reduction in model size. The EE mechanism hinges on fractional reduction in entropy among intermediate transformer blocks with soft-routing loss estimation. This accelerates inference by reducing FLOPs by 52.27% and even improves accuracy by 3.22% by resolving the "overthinking" problem inherent in deep networks. Extensive evaluation through comparison with the SOTA methods and various ablations across nine datasets covering multiple NLP tasks demonstrates its Pareto-optimal performance-efficiency trade-off.


翻译:基于Transformer架构的大型语言模型在各种应用中取得了尖端成果。然而,其庞大的规模和计算需求限制了在资源受限环境下的部署。为提高效率,二值化和早期退出已被证明是有效的解决方案。然而,二值化可能因精度降低而影响梯度估计和参数更新,导致性能损失。此外,针对早期退出机制的研究仍处于初步阶段。为解决这些挑战,我们提出了二值化早期退出Transformer(BEExformer),这是首个融合二值化感知训练与早期退出的选择性学习Transformer,旨在实现高效快速的文本推理。每个Transformer模块集成了选择性学习遗忘网络,以增强上下文保留能力同时消除无关信息。二值化感知训练采用符号函数的可微二阶近似,实现同时捕捉权重符号和幅度的梯度计算,从而将模型体积缩减21.30倍。早期退出机制基于中间Transformer模块间熵的分数阶递减,结合软路由损失估计。该方法通过减少52.27%的FLOPs加速推理,并通过解决深度网络中固有的“过度思考”问题提升3.22%的准确率。通过与最先进方法的广泛比较及覆盖九大数据集的多项消融实验(涵盖多种自然语言处理任务),证明了该方法在性能与效率之间实现了帕累托最优权衡。

0
下载
关闭预览

相关内容

【CMU博士论文】长度可外推的Transformer,149页pdf
专知会员服务
27+阅读 · 2024年6月30日
Transformer推理的全栈优化综述
专知会员服务
83+阅读 · 2023年3月4日
最新《Transformers》报告,Google Lucas Beyer 报告
专知会员服务
69+阅读 · 2022年9月13日
【Google】高效Transformer综述,Efficient Transformers: A Survey
专知会员服务
66+阅读 · 2022年3月17日
专知会员服务
45+阅读 · 2020年3月6日
绝对干货!NLP预训练模型:从transformer到albert
新智元
13+阅读 · 2019年11月10日
英伟达Faster Transformer:作者带你揭秘BERT优化
机器之心
14+阅读 · 2019年9月18日
从头开始了解Transformer
AI科技评论
25+阅读 · 2019年8月28日
百闻不如一码!手把手教你用Python搭一个Transformer
大数据文摘
18+阅读 · 2019年4月22日
深入理解BERT Transformer ,不仅仅是注意力机制
大数据文摘
22+阅读 · 2019年3月19日
多图带你读懂 Transformers 的工作原理
AI研习社
10+阅读 · 2019年3月18日
BERT大火却不懂Transformer?读这一篇就够了
大数据文摘
12+阅读 · 2019年1月8日
国家自然科学基金
9+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
18+阅读 · 2012年12月31日
VIP会员
最新内容
学习数据的几何:形状空间分析数学综述
专知会员服务
4+阅读 · 6月17日
定向能反无人机系统最新发展动态
专知会员服务
7+阅读 · 6月17日
从燃煤战舰到算法战争:水面指挥的永恒要求
专知会员服务
4+阅读 · 6月17日
相关VIP内容
相关资讯
绝对干货!NLP预训练模型:从transformer到albert
新智元
13+阅读 · 2019年11月10日
英伟达Faster Transformer:作者带你揭秘BERT优化
机器之心
14+阅读 · 2019年9月18日
从头开始了解Transformer
AI科技评论
25+阅读 · 2019年8月28日
百闻不如一码!手把手教你用Python搭一个Transformer
大数据文摘
18+阅读 · 2019年4月22日
深入理解BERT Transformer ,不仅仅是注意力机制
大数据文摘
22+阅读 · 2019年3月19日
多图带你读懂 Transformers 的工作原理
AI研习社
10+阅读 · 2019年3月18日
BERT大火却不懂Transformer?读这一篇就够了
大数据文摘
12+阅读 · 2019年1月8日
相关基金
国家自然科学基金
9+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
18+阅读 · 2012年12月31日
Top
微信扫码咨询专知VIP会员