当有疑问时,召唤泰坦:大型模型的有效推理
When in Doubt, Summon the Titans: Efficient Inference with Large Models
摘要:
将神经网络缩放到具有数十亿参数的“大”尺寸,已被证明在许多具有挑战性的问题上产生令人印象深刻的结果。然而,这样的大型模型所产生的推理成本往往会阻止它们在大多数现实世界中的应用。在本文中,我们提出了一个基于蒸馏的两阶段框架,实现了大型模型的建模优势,同时在很大程度上保留了更轻量级模型的推理计算优势。简而言之,我们使用大型教师模型来指导轻量级学生模型只对“简单”示例的子集进行正确的预测;对于“困难”示例,我们回到教师。这种方法使我们能够有效地在实际场景中使用大型模型,其中简单的例子比罕见的硬例子更频繁。我们建议使用蒸馏来只处理简单的实例,这允许在学生规模上进行更积极的权衡,从而降低了推断的摊销成本,并实现了比标准蒸馏更好的准确性。从经验上讲,我们证明了我们的方法在图像分类和自然语言处理基准上的好处。
英文摘要:
Scaling neural networks to "large" sizes, with billions of parameters, has been shown to yield impressive results on many challenging problems. However, the inference cost incurred by such large models often prevents their application in most real-world settings. In this paper, we propose a two-stage framework based on distillation that realizes the modelling benefits of the large models, while largely preserving the computational benefits of inference with more lightweight models. In a nutshell, we use the large teacher models to guide the lightweight student models to only make correct predictions on a subset of "easy" examples; for the "hard" examples, we fall-back to the teacher. Such an approach allows us to efficiently employ large models in practical scenarios where easy examples are much more frequent than rare hard examples. Our proposed use of distillation to only handle easy instances allows for a more aggressive trade-off in the student size, thereby reducing the amortized cost of inference and achieving better accuracy than standard distillation. Empirically, we demonstrate the benefits of our approach on both image classification and natural language processing benchmarks.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。