transskimmer:Transformer学习逐层略读
Transkimmer: Transformer Learns to Layer-wise Skim
摘要:
Transformer架构已经成为自然语言处理和计算机视觉中许多机器学习任务的事实模型。因此,提高其计算效率变得至关重要。基于Transformer的模型的主要计算效率低下之一是它们在所有层中花费相同的计算量。先前的工作已经提出用略读令牌的能力来增强Transformer模型以提高其计算效率。然而,它们遭受不具有离散撇取预测器的有效和端到端优化。为了解决上述限制,我们提出了Transkimmer架构,它学习识别隐藏的状态令牌,不需要由每一层。然后将略读的令牌直接转发到最终输出,从而减少后续层的计算。Transkimmer的关键思想是在每一层之前添加一个参数化的预测器,学习做出略读决策。我们还建议采用重新参数化的技巧,并添加脱脂损失的端到端的训练transskimmer。与基于普通BERT的基准相比,Transkimmer在GLUE基准上实现了10.97倍的平均加速,精度下降不到1%。
英文摘要:
Transformer architecture has become the de-facto model for many machine learning tasks from natural language processing and computer vision. As such, improving its computational efficiency becomes paramount. One of the major computational inefficiency of Transformer-based models is that they spend the identical amount of computation throughout all layers. Prior works have proposed to augment the Transformer model with the capability of skimming tokens to improve its computational efficiency. However, they suffer from not having effectual and end-to-end optimization of the discrete skimming predictor. To address the above limitations, we propose the Transkimmer architecture, which learns to identify hidden state tokens that are not required by each layer. The skimmed tokens are then forwarded directly to the final output, thus reducing the computation of the successive layers. The key idea in Transkimmer is to add a parameterized predictor before each layer that learns to make the skimming decision. We also propose to adopt reparameterization trick and add skim loss for the end-to-end training of Transkimmer. Transkimmer achieves 10.97x average speedup on GLUE benchmark compared with vanilla BERT-base baseline with less than 1% accuracy degradation.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。