找到 SWEET 点:低资源环境下自适应推理的分析与改进
Finding the SWEET Spot: Analysis and Improvement of Adaptive Inference in Low Resource Settings
AI总结:
针对低资源下 Early-Exit 与 Multi-Model 自适应推理的权衡问题,提出权重分离微调方法 SWEET,在快速推理下优于两类基线并降低 NLP 推理成本。
摘要:
自适应推理是一种降低推理成本的简单方法。该方法通过维护多个不同容量的分类器,并根据每个测试实例的难度为其分配资源来工作。在本研究中,我们在训练数据有限的情况下比较了自适应推理的两种主要方法:Early-Exit(早退)和 Multi-Model(多模型)。首先,我们观察到,对于具有相同架构和规模的模型,单个 Multi-Model 分类器的性能平均比对应的 Early-Exit 分类器高出 2.3%。我们表明,这一差距是由 Early-Exit 分类器在训练期间共享模型参数造成的,这会导致模型权重的梯度更新相互冲突。我们发现,尽管存在这一差距,但由于 Multi-Model 方法的开销,Early-Exit 仍然提供了更好的速度-准确率权衡。为了解决这些问题,我们提出了 SWEET(Separating Weights in Early Exit Transformers,在早退 Transformer 中分离权重),这是一种 Early-Exit 微调方法,它为每个分类器分配自己独有的一组模型权重,这些权重不会被其他分类器更新。我们将 SWEET 的速度-准确率曲线与标准 Early-Exit 和 Multi-Model 基线进行比较,发现它在快速推理时优于这两种方法,同时在慢速推理时保持与 Early-Exit 相当的分数。此外,SWEET 的单个分类器平均比 Early-Exit 分类器高出 1.1%。SWEET 兼具两种方法的优势,为进一步降低 NLP 中的推理成本铺平了道路。
英文摘要:
Adaptive inference is a simple method for reducing inference costs. The method works by maintaining multiple classifiers of different capacities, and allocating resources to each test instance according to its difficulty. In this work, we compare the two main approaches for adaptive inference, Early-Exit and Multi-Model, when training data is limited. First, we observe that for models with the same architecture and size, individual Multi-Model classifiers outperform their Early-Exit counterparts by an average of 2.3%. We show that this gap is caused by Early-Exit classifiers sharing model parameters during training, resulting in conflicting gradient updates of model weights. We find that despite this gap, Early-Exit still provides a better speed-accuracy trade-off due to the overhead of the Multi-Model approach. To address these issues, we propose SWEET (Separating Weights in Early Exit Transformers), an Early-Exit fine-tuning method that assigns each classifier its own set of unique model weights, not updated by other classifiers. We compare SWEET's speed-accuracy curve to standard Early-Exit and Multi-Model baselines and find that it outperforms both methods at fast speeds while maintaining comparable scores to Early-Exit at slow speeds. Moreover, SWEET individual classifiers outperform Early-Exit ones by 1.1% on average. SWEET enjoys the benefits of both methods, paving the way for further reduction of inference costs in NLP.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。