Skip to main content
QUICK REVIEW

[论文解读] Early Exiting with Ensemble Internal Classifiers

Tianxiang Sun, Yunhua Zhou|arXiv (Cornell University)|May 28, 2021
Topic Modeling参考文献 38被引用 14
一句话总结

本文通过集成学习与信息论,提出了一种新颖的训练目标及基于投票的推理策略,用于预训练语言模型的早期退出。该方法联合优化模型各层内部分类器的准确率与多样性,相较于先前方法实现了更优的准确率-速度权衡,在 ALBERT 上实现了 2.0× 加速时高达 82.4% 的准确率。

ABSTRACT

As a simple technique to accelerate inference of large-scale pre-trained models, early exiting has gained much attention in the NLP community. It allows samples to exit early at internal classifiers without passing through the entire model. Most existing work usually trains the internal classifiers independently and employs an exiting strategy to decide whether or not to exit based on the confidence of the current internal classifier. However, none of these works takes full advantage of the fact that the internal classifiers are trained to solve the same task therefore can be used to construct an ensemble. In this paper, we show that a novel objective function for the training of the ensemble internal classifiers can be naturally induced from the perspective of ensemble learning and information theory. The proposed training objective consists of two terms: one for accuracy and the other for the diversity of the internal classifiers. In contrast, the objective used in prior work is exactly the accuracy term of our training objective therefore only optimizes the accuracy but not diversity. Further, we propose a simple voting-based strategy that considers predictions of all the past internal classifiers to infer the correct label and decide whether to exit. Experimental results on various NLP tasks show that our proposed objective function and voting-based strategy can achieve better accuracy-speed trade-offs.

研究动机与目标

  • 解决现有早期退出方法仅优化准确率而未考虑内部分类器之间多样性的问题,以应对效率低下。
  • 通过将早期退出建模为集成学习问题,提升推理速度与准确率。
  • 提出一种新的训练目标,利用信息论平衡内部分类器的准确率与多样性。
  • 提出一种基于投票的退出策略,利用所有先前通过的内部分类器的预测结果来决定是否退出。
  • 在多个 NLP 基准测试中,实现优于当前最先进方法(如 DistilBERT 和 LayerDrop)的准确率-速度权衡。

提出的方法

  • 将早期退出建模为集成学习问题,将不同层的内部分类器组合以提升预测可靠性。
  • 提出一种新型损失函数,包含两项:一项最大化真实标签的似然(准确率),另一项最小化分类器预测之间的互信息(多样性)。
  • 利用信息论推导出内部分类器联合预测与真实标签之间互信息的下界,该下界由损失函数进行优化。
  • 引入动态软标签目标 {1−λpc, λpc} 用于多样性正则化,类似于标签平滑,但按层自适应调整。
  • 设计一种基于投票的退出策略,聚合所有先前通过的内部分类器的预测结果,以推断最终标签并决定是否退出。
  • 将所提出的损失函数与策略与任意主干模型(如 BERT、ALBERT)集成,支持即插即用式部署。

实验结果

研究问题

  • RQ1联合优化内部分类器的准确率与多样性是否能提升早期退出性能?
  • RQ2与标准交叉熵损失相比,所提出的基于信息论的损失函数在泛化能力与速度-准确率权衡方面表现如何?
  • RQ3是否基于所有过往内部分类器的投票退出策略优于基于置信度或耐心度的策略?
  • RQ4所提方法对超参数选择(λ 和 k)在不同模型与数据集上的鲁棒性如何?
  • RQ5多样性正则化在多大程度上缓解了预训练模型深层中的过度自信问题?

主要发现

  • 在 ALBERT 上进行多分类文本分类任务时,该方法在 2.0× 加速下实现了 95.2% 的准确率与 82.4% 的 F1 分数,优于先前方法(包括 PABEE 和 DistilBERT)。
  • 在 SST-2 开发集上,采用所提损失函数与投票策略的模型在 2.0× 加速下达到 97.0% 的准确率,准确率超过 Oracle 基线,同时速度更快。
  • 消融实验表明,λ = 0.2 时实现最佳的准确率-速度权衡;而设置 λ = 0(移除多样性损失)时性能最差。
  • 在加速比低于 1.4× 时,基于投票的策略始终优于基于耐心度与基于熵的策略,证明其在早期退出决策中的有效性。
  • 实证分析表明,多样性正则化使深层中的目标更加柔和,降低过度自信,提升泛化能力。
  • 多样性损失主要作用于相邻层,因其预测相关性最高,验证了其在促进层间多样性方面的高效性。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。