On the Fundamental Limits of Prefill-Based Decoding Length Prediction

📄 arXiv: 2610.40541v1 📥 PDF

作者: Haowen Shi, Xuzhe Yan, Fahao Chen, Peng Li

分类: cs.AI, cs.CL, cs.IT

发布日期: 2026-10-29

备注: 26 pages, 4 figures

🔗 代码/项目: GITHUB


💡 一句话要点

提出基于预填充阶段的解码长度预测方法以解决推理调度问题

🎯 匹配领域: 支柱二:RL算法与架构 (RL & Architecture) 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 解码长度预测 大型语言模型 推理调度 随机过程 系统误差

📋 核心要点

  1. 现有方法在不同模型、数据集或采样配置下表现不稳定,导致准确性下降。
  2. 论文提出将解码视为停止的随机过程,并推导出每种预填充方法的界限。
  3. 实验证明,所提出的正态法则能在几个百分点内重现解码长度分布的中心质量。

📝 摘要(中文)

本文探讨了如何仅使用预填充阶段的隐藏状态来预测大型语言模型(LLM)将解码的令牌数量,这是推理调度的关键基础。我们指出当前基准测试混淆了预测器质量与任务难度:当目标模型、数据集或采样配置变化时,报告的准确性会崩溃,尽管预测器保持不变。我们将这种不稳定性追溯到一个被忽视的错误来源——自回归解码的固有随机性,并推导出每种预填充侧方法必须遵循的界限。我们的分析将解码视为一个停止的随机过程,响应的每步停止概率并非恒定,而是在数百步中逐渐上升。

🔬 方法详解

问题定义:本文旨在解决如何准确预测大型语言模型在推理调度中解码的令牌数量。现有方法在不同条件下表现不稳定,导致预测准确性下降。

核心思路:我们将解码过程视为一个停止的随机过程,推导出每种预填充方法必须遵循的界限,并分析解码长度的中心极限定理。

技术框架:整体架构包括预填充阶段的隐藏状态提取、解码过程的随机性分析以及预测器的设计与评估。主要模块包括数据预处理、模型训练和性能评估。

关键创新:最重要的技术创新在于将解码视为随机过程,提出了每步停止概率逐步上升的模型,揭示了系统误差主导模型误差的现象。

关键设计:在设计中,我们使用了多种预测器(如MLP、EGTP等),并通过固定模型、数据和采样条件来评估相对误差和绝对误差。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果表明,在固定模型、数据和采样条件下,广泛设计空间的预测器(如MLP、EGTP等)在接近理论界限的情况下表现相似,确认了系统误差主导模型误差的结论。所提出的正态法则在每个提示的平均绝对误差上与实际分布相符,偏差仅在几个百分点内。

🎯 应用场景

该研究的潜在应用领域包括自然语言处理中的推理调度、对话系统和文本生成等。通过提高解码长度预测的准确性,可以优化模型的推理效率,降低计算资源消耗,进而提升用户体验和系统性能。

📄 摘要(原文)

Predicting how many tokens a large language model (LLM) will decode, using only prefill-phase hidden states, is a key primitive for inference scheduling. We show that current benchmarks conflate predictor quality with task hardness: when the target model, dataset, or sampling configuration changes, reported accuracy collapses even though the predictor is unchanged. We trace this instability to an overlooked error source---the inherent stochasticity of autoregressive decoding---and derive bounds that every prefill-side method must obey. Our analysis treats decoding as a stopped stochastic process. The per-step stopping probability of a response is not constant but ramps up over hundreds of steps, so the decode length inherits a central limit theorem from the many local decisions that determine where a response ends; this yields per-prompt normality with an explicit error term, together with an affine variance law $σ=αμ+b$ whose slope is the coefficient of variation of the number of response segments. Empirically, the normal law reproduces the per-prompt MAE and the central mass of the decode-length distribution to within a few percent, and the residual departures from normality (mild right skew, slight excess kurtosis) are the ones predicted by the sampling-noise correction. Under fixed model, data, and sampling conditions, a broad design space of predictors (MLP, EGTP, FiLM, soft-label, and Mixture-of-Experts variants) converges to similar performance close to the bound, confirming that \emph{system error dominates model error}. We argue for a benchmarking protocol that fixes the model, data, and sampling parameters and that reports relative-error metrics alongside absolute ones. Code and analysis tools are available at https://github.com/ShwStone/DecodingPredict.