arXiv:2610.41359cs.AIOct 2026

Manuscript Offprint

arXiv:2610.41359

LEAP: Efficient LLM Inference Scheduling with Generalizable Length Prediction

Kwan Yan, Jialun Zhong, Yanzeng Li

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Length-aware scheduling reduces request latency in LLM serving by prioritizing shorter requests. However, despite their large model sizes, length predictors can suffer degraded ranking performance under domain and task shifts, and adapting them can require costly retraining. Their prediction overhead can further offset the benefits of scheduling. To improve the generalization and efficiency of length-aware scheduling, we propose LEAP, a length prediction system with fast online adaptation and asynchronous CPU execution. LEAP reuses the serving model's prefill hidden states, which contain information about the output length, and extracts this signal through a linear readout. To adapt to substantial domain and task shifts, it updates the readout at test time through recursive least squares, using completed requests as supervision without gradient computation or historical-data replay. Prediction and updates run asynchronously on CPU, while prediction and initial batch ordering overlap the remaining GPU prefill. Across the evaluated cross-domain transfers, LEAP retains strong ranking performance, and online adaptation improves Spearman correlation by 64.7% under a larger domain shift. Serving experiments show that LEAP reduces average per-token latency by 15.9–40.8% compared with the evaluated length predictors, while achieving 1.9% higher throughput with 30,569× fewer predictor parameters than the strongest evaluated baseline.

1 INTRODUCTION

Length-aware scheduling plays a key role in LLM serving: it prevents long requests from blocking multiple short ones, reducing average response time (Qiu et al., 2024; Fu et al., 2024; Shahout et al., 2024; Zheng et al., 2026). Its effectiveness depends on length predictions that distinguish requests by their remaining work. Yet deployment brings new tasks, prompt styles, and user populations. A predictor that performs well on its source domain may no longer provide useful priorities when these change.

This concern appears in our cross-domain evaluations (Section 4.2). On the same target requests, several predictors lose substantial ranking quality when trained on a different domain. Restoring that quality through repeated offline retraining adds data collection, optimization, and redeployment costs. Moreover, prediction itself also consumes resources: prompt-based methods run separate encoders (Zheng et al., 2026; Qiu et al., 2024; Fu et al., 2024), while hidden-state methods reuse the serving model's representations through neural prediction heads (Shahout et al., 2024; Wang et al., 2026; Xie et al., 2026; Ren et al., 2026). A GPU-based predictor spends resources that scheduling is intended to use more effectively; a slow CPU predictor can leave the scheduler waiting. A practical design must therefore consider how well predictions transfer, how they can be updated, and what they cost to deliver.

For scheduling, sufficient prediction differs from perfect prediction. Requests can be prioritized effectively even when their exact lengths remain uncertain. This motivates us to favor a lightweight predictor: higher accuracy does not improve serving efficiency when the additional prediction cost outweighs its scheduling benefits. We seek useful length information in features that the serving model already computes, avoiding the cost of a heavier predictor. Prior work uses hidden states for generation control and future-token prediction (Hou et al., 2026; Chen et al., 2026); hidden-state length predictors more directly demonstrate signals related to output length (Shahout et al., 2024; Xie et al., 2026). This motivates reusing the representation produced during prefill, which is conditioned on both the prompt and the model that will generate the answer. We extract its length signal through a linear readout, whose small parameter set supports fast CPU inference and recursive updates.

To improve the generalization and efficiency of length-aware

*Corresponding author.

Figure

Figure 1. LEAP: CPU-asynchronous prediction, scheduling, and completion-driven adaptation.

scheduling, we propose LEAP¹, a length prediction system with fast online adaptation and asynchronous CPU execution. Its readout uses the final prompt token's hidden state from one late layer to estimate output length for decode scheduling. When substantial domain or task shifts degrade the predictions, LEAP adapts the readout through test-time training with recursive least squares (RLS). Each completed request supplies its observed output length as supervision. Starting from the source-trained readout, RLS incorporates this feedback incrementally without backpropagation or replaying completed requests (Section 3.3).

What may be overlooked is the latency introduced by feature transfer, prediction, and score publication. This overhead can offset the benefits of more accurate predictions. To keep predictor computation off the GPU, LEAP runs prediction and updates asynchronously on CPU, allowing GPU decoding to continue using published scores. To reduce prediction delay, it overlaps CPU prediction and initial batch ordering with the remaining GPU prefill. In practice, both can finish before GPU prefill completes, as we verify in Section 4.8.

Together, these components support decode scheduling as domains and tasks change. First, LEAP estimates output length from a single prefill hidden state. Second, it adapts the readout using completion feedback. Finally, it publishes predictions asynchronously for scheduling while GPU inference continues. Besides scheduling, our methodology may also benefit other use cases that involve output lengths, such as output length control through intervention and KV cache management.

Our contributions are as follows:

  • Reusing prefill signals for scheduling. We reuse a single prefill hidden state to predict output length without a separate prompt encoder. The linear readout uses square-root target regression to balance tail compression and the separation of long requests (Section 3.2).

  • Adaptation through test-time training. We adapt the source-trained readout to domain and task shifts using completion-supervised RLS updates, without gradient computation or historical-data replay (Section 3.3).

  • Asynchronous execution on CPU. We integrate CPU prediction, online updates, and score publication into a vLLM serving path. Prediction and initial batch ordering overlap the remaining GPU prefill (Section 3.4).

  • Experimental results. The frozen readout retains stronger ranking performance than the evaluated baselines across domain transfers. Online adaptation substantially improves ranking under larger language shifts. Serving experiments demonstrate measurable per-token latency improvements with significantly lower predictor parameter counts.

References (21)