Editor’s introduction
The research compares eight lightweight scheduling policies using a Python/PyTorch testbench with real Hugging Face execution on ShareGPT-derived workloads. Aging shortest-prompt-first emerges as a strong practical baseline, particularly on L40S and mixed workloads. However, the study finds that job-size knowledge alone is insufficient—performance is also shaped by batching dynamics and hardware characteristics. Results show that policies effective on one GPU may not perform well on another, indicating hardware-dependent behavior. The evaluation is limited to a controlled testbench and does not include production factors like admission control, cancellation, or network variability. Workloads are based on replay, so they do not reflect real-time user behavior or feedback effects such as request cancellations or traffic shifts due to streaming responsiveness.
Introduction
Serving large language models is fundamentally different from serving traditional neural networks because generation is autoregressive. A request is not completed by a single forward pass; instead, the system repeatedly executes decode steps, each producing one new token while carrying forward a growing key-value cache. In an online setting, many requests with different prompt lengths, output lengths, and arrival times compete for the same GPU. This makes scheduling a first-order systems problem: the runtime must decide which requests receive service at each decode step while keeping the GPU sufficiently full to maintain high throughput.
Continuous batching has become a standard technique for improving LLM serving efficiency. Rather than waiting for a fixed batch of requests to finish together, the serving system admits new requests as old requests complete. This improves utilization and reduces idle time under realistic online traffic. However, continuous batching does not eliminate head-of-line blocking. If long generations remain in the active batch for many decode iterations, they can delay shorter jobs that would otherwise finish quickly. A naive first-in, first-out policy is simple and fair by arrival order, but it can be inefficient when request lengths vary widely.
This project investigates a practical question: how much can continuously batched LLM serving improve using only lightweight scheduling changes? Rather than proposing a new model architecture, a new inference kernel, or a full production serving stack, we isolate the scheduling policy as the variable of interest. We compare simple policies that use request metadata such as prompt length, target or estimated remaining decode work, service tier, waiting time, and observed completion statistics. The goal is not to find a universally optimal scheduler, but to understand how scheduler choice affects latency, throughput, and tail behavior across workloads, models, and GPUs.
Continuous-Batching Decode Scheduling
In autoregressive LLM inference, each request consists of an initial prefill stage followed by a decode stage. During prefill, the model processes the prompt and initializes the request’s KV cache. During decode, the model repeatedly generates one token conditioned on the previous tokens. Since decode proceeds incrementally, the serving runtime has repeated opportunities to choose which requests to include in the next GPU step.
The runtime maintains future requests that have not yet arrived, active requests that are eligible for service, and completed requests. When the wall-clock replay time reaches a request’s arrival time, the request becomes active. At each decode step, the scheduler ranks active requests and selects at most max_batch_size requests for service. In our experiments, max_batch_size is fixed at 16. For requests receiving their first service, the testbench performs batched prefill; for requests with an existing KV cache, it performs cached one-token decode.
The scheduler affects at least four outcomes. It affects throughput because larger or more stable batches improve GPU utilization. It affects time-to-first-token because admission and first service determine how quickly a user sees an initial response. It affects completion latency because scheduling determines how long each request takes from arrival to final token. It also affects tail latency and fairness because aggressive short-job policies can improve average latency while delaying long or low-priority requests.
RQ1: Do short-job-aware schedulers improve latency and throughput compared with FIFO continuous batching?
FIFO is attractive because it is simple and predictable, but it can allow long requests to occupy decode capacity while shorter requests wait. Policies inspired by shortest-job-first or shortest-remaining-processing-time may reduce mean and tail latency by finishing short requests earlier.
RQ2: How much does estimation quality matter?
Some policies use visible prompt length as a proxy for job size, while others estimate remaining decode length from prompt length, request class, and online observations. We evaluate whether these estimates improve performance and whether inaccurate estimates can hurt compared with simpler heuristics.
RQ3: Does the best scheduling policy depend on hardware, model, and workload?
GPU architectures differ in memory bandwidth, compute throughput, and batching behavior. Models differ in size, context handling, and decode cost. Workloads differ in arrival pattern and length distribution. We therefore expect no single scheduler to dominate universally.
Related Work
Orca introduced iteration-level scheduling for transformer serving, showing that generative inference can benefit from scheduling at the granularity of decode iterations rather than entire requests. This idea is central to modern continuous batching: requests can enter and leave the batch dynamically, allowing the system to maintain utilization under variable-length generation. Our work builds on this observation, but focuses on comparing lightweight policies inside a controlled continuous-batching testbench rather than designing a new distributed serving system.
FastServe further shows that preemption and scheduling are central to interactive LLM serving, using token-level preemption and a skip-join multi-level feedback queue scheduler to reduce head-of-line blocking. Our study differs by holding the serving mechanism fixed and comparing lightweight scheduler choices across models, GPUs, and workload families.
vLLM and PagedAttention showed that KV-cache memory management is critical for high-throughput LLM serving. By reducing memory fragmentation and enabling efficient paging of KV-cache blocks, such systems increase the number of concurrent sequences that can be served. Our project is complementary and builds on the same core insight: once a continuous-batching abstraction makes many concurrent sequences feasible, scheduler choice becomes a practical lever for shaping latency-throughput tradeoffs. Rather than replacing systems like vLLM, we study which active requests should receive decode service under continuous batching, providing actionable guidance that can be layered on top of strong execution engines.
System Overview
The system has four main components. The workload generator builds scheduler-ready cases from ShareGPT-style conversations. It extracts human-to-assistant request/response pairs, tokenizes prompts and responses, filters invalid or oversized samples, labels requests as short, medium, or long, assigns arrival times, and emits workload cases. The scheduler receives snapshots of waiting, active, and completed requests and returns an ordering of active request IDs. The model execution layer uses PyTorch and Hugging Face Transformers to run batched prefill and cached one-token decode. The metrics logger records request-level statistics such as queue delay, TTFT, completion latency, generated tokens, scheduled steps, decode time, service tier, and request class, along with aggregate throughput and batch efficiency.
The same workload cases are replayed for every scheduler under fixed controls. The maximum decode batch size is 16. The prefill-token budget is 4096 padded tokens per prefill sub-batch, implemented as max prompt length in the sub-batch times the number of prefilling requests. These controls ensure that performance differences primarily reflect scheduler behavior rather than changes in workload composition or batch constraints.
Trace-Driven Workload Construction
We evaluate on ShareGPT-derived conversational workloads. The workload pipeline builds cases from the Aeala/ShareGPT_Vicuna_unfiltered ShareGPT-style dataset using the Hugging Face datasets library. Prompts and target responses are tokenized with the Hugging Face GPT-2 tokenizer for workload construction. Samples with fewer than four input or output tokens are removed, and prompts or responses above the 4096-token source cap are filtered out. The source pool is deduplicated and trimmed to 50,000 cleaned request records.
Each request stores the prompt, input-token count, target output-token count, arrival time, priority class, service tier, and source metadata. Priority class is assigned from prompt length: short requests have fewer than 128 input tokens, long requests have more than 1024 input tokens, and medium requests fall between those thresholds. The target output-token count comes from the ShareGPT response length. During model execution, this target length determines the default stopping point, subject to model context limits and the configured per-request generation cap.
The workload generator can emit eight ShareGPT-derived workload categories and 22 seeded cases per category, for 176 total generated cases. The final reported analysis uses one representative seeded case from each category, so the reported run matrix is at the GPU-model-scheduler-category level rather than an average over all 22 seeds. The categories stress different scheduling behaviors: steady short traffic, steady mixed traffic, bursty conversational traffic, bursty long-request traffic, flash-crowd spikes, low-load traffic, short/long mixes, and a uniform baseline. Poisson arrivals are generated with exponential interarrival times, while bursty workloads use clustered arrivals with random intra-cluster spacing. This gives a mix of average-case, low-contention, and head-of-line-blocking-heavy workloads.
Scheduler Policies
All policies except shortest remaining tokens first are deployable from request metadata and online observations. Shortest remaining tokens first is oracle-style because it uses the trace-derived target output length. Estimated shortest tokens first updates per-class and global output-length averages from completed requests. Adaptive fair LCB combines estimated remaining work, uncertainty, starvation prevention, service-tier fairness, and KV-cache pressure, intentionally trading off short-job preference against starvation and service-tier debt.
Continuous-Batching Testbench Implementation
The testbench is implemented in Python 3.11 using PyTorch and Hugging Face Transformers on Modal GPU workers. The model runner loads each model with Hugging Face APIs, performs batched prefill with cached KV state for newly admitted requests, and then runs one-token greedy decode for the selected active batch at each scheduling step.
The execution is hybrid: arrivals and target output lengths are trace-driven, but model execution is real. Requests stop after reaching the trace-derived target output length, capped by model context and a 1024 generated-token limit, so every scheduler receives the same intended work.
The runtime owns request state, arrival release, prefill splitting, decode execution, timing, and metric logging. The scheduler only sees request metadata and runtime progress through SchedulerSnapshot objects and returns an ordering of active request IDs, which makes each policy comparable under identical model, case, batch, and prefill settings.
Adopted Components and Implemented Components
We adopted the ShareGPT-style conversational data source, Hugging Face tokenizers and model-loading APIs, PyTorch tensor execution, Modal GPU infrastructure, and open-weight Qwen, Gemma, and Mistral models. We also adopt the general continuous-batching abstraction used by modern LLM serving systems as the conceptual setting.
We implemented the workload curation pipeline, request-class labeling, arrival-process generation, scheduler API, eight scheduler policies, continuous-batching testbench, Hugging Face prefill/decode runner, Modal experiment runner, and metrics collection. The repository also contains optional Triton and torch.compile kernel-proxy code, but kernel optimization was not part of the final scheduler evaluation. The final project scope is an empirical scheduler study, not a kernel optimization paper.
Experimental Controls
For each GPU and model setting, every scheduler is evaluated on the same representative workload cases. We fix max_batch_size at 16 and max_batch_prefill_tokens at 4096. The final analysis contains 1,152 executed GPU-model-scheduler-category runs: three GPUs, six models, eight schedulers, and eight workload categories. Each reported category run uses the same selected workload case for all schedulers in that GPU-model setting; it is not an aggregate over the 22 available seeds. The model, request arrivals, target output lengths, and runtime limits are held constant while the scheduler changes. This control is important because otherwise a scheduler might appear better simply because it saw easier traffic or admitted larger batches.
Metrics
Throughput is measured as generated tokens per second over wall-clock runtime, with completed requests tracked per run. Time-to-first-token measures arrival-to-first-token responsiveness, mean completion latency measures arrival-to-final-token time, and p95/p99 latency captures tail user experience, especially in mixed workloads where mean latency can improve while long or unlucky requests worsen. Batch efficiency uses average batch size, decode-step count, and average decode-step time to show whether a scheduler improves queueing behavior, GPU utilization, or both. Fairness and starvation behavior are evaluated through request-length breakdowns, service-tier behavior, and mixed short/long workloads.
Results and Analysis
We organize the results around the three research questions. First, scheduler choice changes the latency-throughput frontier: runs with the same model, GPU, workload family, batch limit, and prefill budget land at different points depending only on the scheduler. Second, short-job-aware policies are often beneficial, but the strongest versions include aging or fairness mechanisms to avoid starving longer requests. Third, scheduler behavior is hardware-dependent; policies that are competitive on one GPU are not necessarily best on another.
Scheduler Choice Shifts the Latency-Throughput Frontier
Model size and GPU type strongly affect absolute performance. Smaller models and faster configurations tend to occupy the high-throughput, lower-latency region, while larger or slower configurations move toward lower throughput and higher p95 latency. The scheduler effect is smaller than the model/hardware effect, but it is still visible within each region. This is the main empirical pattern: scheduling is useful, but it should be tuned against the target model, hardware, workload mix, and metric.
Aging-Based Short-Job Scheduling Is a Strong L40S Baseline
We present L40S tables as a detailed representative breakdown; cross-GPU trends are summarized in Figures 2 and 4. Tables 2 and 3 quantify RQ1 on L40S. Every model has a non-FIFO scheduler with higher throughput, with gains from 1.7% for Qwen3.5-2B to 12.8% for Qwen3-0.6B. The best p95 scheduler improves tail latency for five of six models, with gains up to 14.7%; the exception is Qwen3.5-2B, where FIFO’s 19.93 second mean p95 is best. Aging shortest-prompt-first is the best or tied-best throughput policy for four models and the best p95 policy for four models. These results answer RQ1 with a qualified yes: short-job-aware scheduling often helps, but aging is important because it gives long-waiting requests increasing priority and reduces starvation risk.
Better Estimates Do Not Always Produce Better Schedules
RQ2 asked whether estimation quality matters. Tables 2 and 3 show that it does, but more complex estimates do not automatically dominate simpler heuristics. Prompt length is an imperfect proxy for total request cost, yet shortest prompt first and aging SPF perform well in several settings. Estimated shortest tokens first and adaptive fair LCB are competitive but not universally best. Most importantly, shortest remaining tokens first has oracle-style access to trace-derived remaining output length, yet it often fails to dominate and can hurt tail latency. The takeaway is that scalar job-size minimization is not the whole objective in GPU serving: batch stability, prefill behavior, cache pressure, aging, and fairness also matter.
Discussion and Limitations
This project shows that lightweight scheduling can improve LLM serving behavior, but the evaluation is still a controlled testbench rather than a full production serving stack. Production systems may add admission control, KV-cache eviction, cancellation, speculative decoding, streaming overheads, and network variability. The ShareGPT-derived workload suite also may not match code generation, long-document summarization, or agentic traffic. Because our workloads are replay-based, they do not model feedback effects such as users cancelling slow requests or traffic shifts caused by streaming responsiveness.
The testbench is trace-driven with respect to output length. This keeps the target work fixed across schedulers, but gives shortest remaining tokens first more information than a real online scheduler would normally have. We measure serving latency and throughput, not semantic output quality, and kernel optimization is not part of the evaluated contribution. The practical deployment implication is to treat the scheduler as a low-cost tuning parameter rather than a universal default: FIFO and service-tier priority remain useful for predictability, aging SPF is strong for interactive latency under mixed workloads, and estimated or adaptive policies should be validated on target traffic.
Key takeaways
RQ1: short-job-aware scheduling often improves latency and sometimes throughput, especially when aging prevents long-request starvation. RQ2: better length estimates help only when they preserve batching stability and fairness; oracle remaining length is not enough by itself. RQ3: the best scheduler changes with GPU, model, and workload, so serving systems should expose scheduling as a deployment-time control.
Conclusion
This project evaluates lightweight scheduling policies for continuously batched LLM serving across workloads, models, and GPUs. Using a testbench with real batched prefill and KV-cache decode, we compare eight schedulers on ShareGPT-derived workloads. The key result: scheduler choice materially affects throughput and tail latency even under fixed system settings. Aging shortest-prompt-first is a strong practical baseline, especially on L40S and mixed workloads, but the best choice is deployment-dependent. Oracle remaining-length results show job-size knowledge alone is insufficient—batching and hardware effects also matter—so scheduling should be treated as a workload-aware deployment parameter.


