Dynamic-TinyBERT:利用动态序列长度提高TinyBERT的推理效率
Dynamic-TinyBERT: Boost TinyBERT's Inference Efficiency by Dynamic Sequence Length
摘要:
有限的计算预算通常会阻止Transformers用于生产并使其高精度得到利用。Tiny BERT通过将BERT自蒸馏成具有较少层和较小内部嵌入的较小Transformer表示来解决计算效率。然而,当我们将层数减少50%时,TinyBERT的性能会下降,当我们将层数减少75%时,对于高级NLP任务(如span问答),TinyBERT的性能会下降得更厉害。此外,必须为每个具有不同计算预算的推理场景训练单独的模型。在这项工作中,我们提出了动态TinyBERT,TinyBERT模型,利用序列长度减少和超参数优化,以提高推理效率的任何计算预算。Dynamic-Tiny BERT仅训练一次,其性能与BERT相当,并实现优于任何其他高效方法的准确性-加速比权衡(高达3.3倍,损失率<1%)。在出版后,复制我们工作的代码将是开源的。
英文摘要:
Limited computational budgets often prevent transformers from being used in production and from having their high accuracy utilized. TinyBERT addresses the computational efficiency by self-distilling BERT into a smaller transformer representation having fewer layers and smaller internal embedding. However, TinyBERT's performance drops when we reduce the number of layers by 50%, and drops even more abruptly when we reduce the number of layers by 75% for advanced NLP tasks such as span question answering. Additionally, a separate model must be trained for each inference scenario with its distinct computational budget. In this work we present Dynamic-TinyBERT, a TinyBERT model that utilizes sequence-length reduction and Hyperparameter Optimization for enhanced inference efficiency per any computational budget. Dynamic-TinyBERT is trained only once, performing on-par with BERT and achieving an accuracy-speedup trade-off superior to any other efficient approaches (up to 3.3x with <1% loss-drop). Upon publication, the code to reproduce our work will be open-sourced.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。