BEExformer: 一种快速推理的二值化Transformer与早退出机制
BEExformer: A Fast Inferencing Binarized Transformer with Early Exits
AI总结:
BEExformer通过二值化和早退出机制提升Transformer推理效率,减少模型大小并提高准确性,经多任务验证展现最优性能与效率平衡。
摘要:
基于Transformer的大型语言模型在多种应用中取得突破性成果,但其庞大尺寸和处理需求限制了在受限资源上的部署。为提高效率,二值化和早退出(EE)已被证明是有效的解决方案。然而,二值化可能导致性能损失,因为降低的精度会影响梯度估计和参数更新。此外,EE机制的研究仍处于初级阶段。为解决这些问题,我们引入了二值化早退出Transformer(BEExformer),这是一种首次提出的选择性学习基于的Transformer,整合了二值化感知训练(BAT)与EE,以实现高效且快速的文本推理。每个Transformer块都有一个集成的Selective-Learn Forget Network(SLFN)来增强上下文保留并消除无关信息。BAT采用可微的二次近似来符号函数,使梯度计算能够捕捉权重的符号和幅度。这有助于将模型大小减少21.30倍。EE机制依赖于中间Transformer块中的熵减少分数,通过软路由损失估计。这通过减少52.27%的FLOPs并甚至提高3.22%的准确性,解决了深度网络中的“过度思考”问题。通过与SOTA方法和多个NLP任务的九个数据集的广泛评估,证明了其帕累托最优性能-效率权衡。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。