arXiv:2610.40541cs.AIOct 2026

Manuscript Offprint

arXiv:2610.40541

On the Fundamental Limits of Prefill-Based Decoding Length Prediction

Haowen Shi, Xuzhe Yan, Fahao Chen, Peng Li

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original. This text is shared under the same licence.

Abstract

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\sigma = \alpha\mu + 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 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.

1 Introduction

Large language model (LLM) inference consists of two distinct phases: a compute-bound prefill phase that processes the input prompt in parallel, and a memory-bound decode phase that generates output tokens autoregressively [Kwon et al., 2023, Yu et al., 2022]. Because the decode phase dominates end-to-end latency and energy consumption [Zhong et al., 2024], knowing how many tokens will be decoded before decoding begins is invaluable for batch scheduling, PD disaggregation, and resource provisioning [Shahout et al., 2024, Qiu et al., 2024, Zheng et al., 2023].

Motivated by this need, a growing body of work proposes to predict decoding length from prefill-phase information. Early approaches train external proxy models on surface features [Qiu et al., 2024]. More recent methods reuse the target LLM's own internal activations: Shahout et al. [2024] schedule requests with intermediate-layer embeddings; Piotrowski et al. [2025] build a graph convolutional regressor over layer-wise hidden states; and the concurrent EGTP framework [Xie et al., 2026] introduces Entropy-Guided Token Pooling (EGTP) over on-the-fly hidden states, achieving state-of-the-art results on the newly released ForeLen benchmark.

The fairness problem. Despite these advances, we observe that published numbers are difficult to compare. A predictor may achieve MAE ≈\approx 80 on ForeLen's long-sequence split with Qwen2.5-7B, yet the same architecture degrades to MAE > 150 on ShareGPT with Qwen3-32B, or to MAE > 260 on RL-sampled data. The root cause is that the inherent randomness of autoregressive generation—not predictor design—is the dominant error source. When a query has high decode-length variance, no prefill-side predictor can forecast a single deterministic length with high accuracy, because the length itself is a random variable.

Our contributions. We make three contributions.

  1. A theory of where the error comes from. We model decoding as a stopping time with a non-constant hazard and show that the decode length is asymptotically normal, with an explicit Berry–Esseen error term ( §3\S3). The same analysis yields the affine variance law σ=αμ+b\sigma = \alpha\mu + b and identifies the fitted slope as the coefficient of variation of the number of response segments. From the normal law we then derive bounds that hold for every prefill-side predictor, including sharpened MAE and pass-rate bounds and an exact decomposition of the excess risk into a system and a model term.

  2. Empirical validation, including where the law fails. On 300 ShareGPT prompts with 200 decodes each, we test the normal approximation against the quantities that the bounds actually use: the per-prompt MAE matches the Gaussian value σ2/π\sigma\sqrt{2/\pi} to within 1.9%, and the central mass matches to within two percentage points ( §4\S4).

The residual departures from normality (median skewness +0.27, excess kurtosis +0.35) are those predicted by the sampling-noise correction of our analysis. We also confirm that σ\sigma follows the affine law in μ\mu, with coefficients (α,b)(\alpha, b) that vary markedly across models and post-training recipes (Table 1).

  1. Architecture-agnostic evaluation. We benchmark a wide range of predictor designs—MLP regression on concatenated hidden states, EGTP-style entropy pooling, FiLM conditioning, soft-label classification, and MoE routing—under fixed model, data, and sampling settings. All methods converge to similar performance close to the theoretical bound ( §5§5).

Finally, we argue that existing benchmarks such as ForeLen conflate predictor quality with task hardness, and we recommend a controlled evaluation protocol that reports relative-error metrics alongside absolute ones ( §6§6).

References (31)