This paper presents a modular approach to accelerate inference in large language models (LLMs) by adding early exit heads at intermediate transformer layers. Each head is trained in a self-supervised manner to mimic the main model's predictions, allowing computation to stop early when a calibrated confidence threshold is reached. We evaluate several confidence metrics and show that entropy provides the most reliable separation between correct and incorrect predictions. Experiments on the Pythia model suite (70M to 2.8B parameters) demonstrate that our method significantly reduces inference cost while maintaining accuracy across multiple benchmarks. We further adapt this approach to speculative decoding, introducing Dynamic Self-Speculative Decoding (DSSD), which achieves 1.66x higher token acceptance than manually-tuned LayerSkip baselines with minimal hyperparameter tuning.


翻译:本文提出一种模块化方法,通过在Transformer中间层添加早期退出头来加速大型语言模型推理。每个退出头以自监督方式训练,以模拟主模型的预测结果,当达到校准后的置信度阈值时可提前终止计算。我们评估了多种置信度度量指标,证明熵能为正确与错误预测提供最可靠的区分度。在Pythia模型套件上的实验表明,该方法在保持多项基准测试精度的同时,显著降低了推理成本。我们进一步将该方法适配至推测解码场景,提出动态自推测解码方法,在最小化超参数调整的前提下,其词元接受率比人工调优的LayerSkip基线提高了1.66倍。

0
下载
关闭预览

相关内容

大语言模型算法演进综述
专知会员服务
81+阅读 · 2024年5月30日
专知会员服务
30+阅读 · 2020年9月18日
专知会员服务
45+阅读 · 2020年3月6日
绝对干货!NLP预训练模型:从transformer到albert
新智元
13+阅读 · 2019年11月10日
自然语言处理中的语言模型预训练方法
PaperWeekly
14+阅读 · 2018年10月21日
超全总结:神经网络加速之量化模型 | 附带代码
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
18+阅读 · 2012年12月31日
VIP会员
相关基金
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
18+阅读 · 2012年12月31日
Top
微信扫码咨询专知VIP会员