arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2004.13542cs.CL
收藏

更快的深度自适应Transformers

Faster Depth-Adaptive Transformers

Pattern Recognition Center, WeChat AI, Tencent Inc(腾讯公司微信人工智能模式识别中心)

Yijin Liu, Fandong Meng, Jie Zhou, Yufeng Chen, Jinan Xu

摘要:

深度自适应神经网络可以根据输入词的难易程度动态调整深度,从而提高效率。主要的挑战是如何测量这种硬度并决定所需的深度(即,层)进行。以前的工作一般建立一个暂停单元,以决定是否计算应该继续或停止在每一层。由于没有对深度选择的具体监督,因此停止单元可能是欠优化的和不准确的,这导致在建模句子时的次优和不稳定的性能。在本文中,我们摆脱了停顿单元,并提前估计所需的深度,这产生了一个更快的深度自适应模型。具体地,提出了两种方法来显式地测量输入词的硬度并估计相应的自适应深度,即1)基于互信息(MI)的估计和2)基于重构损失的估计。我们对文本分类任务进行了实验,使用了24个不同大小和领域的数据集。结果证实,我们的方法可以加快香草Transformer(高达7倍),同时保持高精度。此外,效率和鲁棒性显着提高时,与其他深度自适应方法相比。

英文摘要:

Depth-adaptive neural networks can dynamically adjust depths according to the hardness of input words, and thus improve efficiency. The main challenge is how to measure such hardness and decide the required depths (i.e., layers) to conduct. Previous works generally build a halting unit to decide whether the computation should continue or stop at each layer. As there is no specific supervision of depth selection, the halting unit may be under-optimized and inaccurate, which results in suboptimal and unstable performance when modeling sentences. In this paper, we get rid of the halting unit and estimate the required depths in advance, which yields a faster depth-adaptive model. Specifically, two approaches are proposed to explicitly measure the hardness of input words and estimate corresponding adaptive depth, namely 1) mutual information (MI) based estimation and 2) reconstruction loss based estimation. We conduct experiments on the text classification task with 24 datasets in various sizes and domains. Results confirm that our approaches can speed up the vanilla Transformer (up to 7x) while preserving high accuracy. Moreover, efficiency and robustness are significantly improved when compared with other depth-adaptive approaches.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑