The long-tailed distribution of sequence lengths in LLM serving and reinforcement learning (RL) sampling causes significant computational waste due to excessive padding in batched inference. Existing methods rely on auxiliary models for static length prediction, but they incur high overhead, generalize poorly, and fail in stochastic "one-to-many" sampling scenarios. We introduce a lightweight framework that reuses the main model's internal hidden states for efficient length prediction. Our framework features two core components: 1) Entropy-Guided Token Pooling (EGTP), which uses on-the-fly activations and token entropy for highly accurate static prediction with negligible cost, and 2) Progressive Length Prediction (PLP), which dynamically estimates the remaining length at each decoding step to handle stochastic generation. To validate our approach, we build and release ForeLen, a comprehensive benchmark with long-sequence, Chain-of-Thought, and RL data. On ForeLen, EGTP achieves state-of-the-art accuracy, reducing MAE by 29.16\% over the best baseline. Integrating our methods with a length-aware scheduler yields significant end-to-end throughput gains. Our work provides a new technical and evaluation baseline for efficient LLM inference.


翻译:大语言模型服务与强化学习采样中序列长度的长尾分布,因批处理推理中过度的填充操作而导致显著的计算浪费。现有方法依赖辅助模型进行静态长度预测,但存在开销高、泛化能力差且在随机"一对多"采样场景中失效的问题。本文提出一种轻量级框架,通过复用主模型的内部隐藏状态实现高效长度预测。该框架包含两个核心组件:1) 熵引导令牌池化(EGTP),利用实时激活值与令牌熵实现高精度静态预测且计算成本可忽略;2) 渐进式长度预测(PLP),在解码过程中动态估计剩余生成长度以处理随机生成场景。为验证方法有效性,我们构建并开源了ForeLen基准数据集,涵盖长序列、思维链及强化学习数据。在ForeLen测试中,EGTP实现了最优预测精度,其平均绝对误差较最佳基线降低29.16%。将本方法与长度感知调度器集成后,可获得显著的端到端吞吐量提升。本研究为高效大语言模型推理提供了新的技术与评估基准。

0
下载
关闭预览

相关内容

决策智能中的时间序列预测大模型
专知会员服务
34+阅读 · 1月7日
大语言模型在序列推荐中的应用
专知会员服务
19+阅读 · 2024年11月12日
Llama-3-SynE:实现有效且高效的大语言模型持续预训练
专知会员服务
36+阅读 · 2024年7月30日
大语言模型评估技术研究进展
专知会员服务
48+阅读 · 2024年7月9日
一文速览大语言模型提示最新进展
专知会员服务
80+阅读 · 2023年12月24日
LLM in Medical Domain: 大语言模型在医学领域的应用
专知会员服务
103+阅读 · 2023年6月17日
《大语言模型进展》69页ppt,谷歌研究科学家Jason Wei
专知会员服务
86+阅读 · 2022年10月29日
「知识增强预训练语言模型」最新研究综述
专知
18+阅读 · 2022年11月18日
绝对干货!NLP预训练模型:从transformer到albert
新智元
13+阅读 · 2019年11月10日
自然语言处理中的语言模型预训练方法
PaperWeekly
14+阅读 · 2018年10月21日
超全总结:神经网络加速之量化模型 | 附带代码
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
VIP会员
相关VIP内容
决策智能中的时间序列预测大模型
专知会员服务
34+阅读 · 1月7日
大语言模型在序列推荐中的应用
专知会员服务
19+阅读 · 2024年11月12日
Llama-3-SynE:实现有效且高效的大语言模型持续预训练
专知会员服务
36+阅读 · 2024年7月30日
大语言模型评估技术研究进展
专知会员服务
48+阅读 · 2024年7月9日
一文速览大语言模型提示最新进展
专知会员服务
80+阅读 · 2023年12月24日
LLM in Medical Domain: 大语言模型在医学领域的应用
专知会员服务
103+阅读 · 2023年6月17日
《大语言模型进展》69页ppt,谷歌研究科学家Jason Wei
专知会员服务
86+阅读 · 2022年10月29日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员