Papers
Topics
Authors
Recent
Search
2000 character limit reached

Tail Batching Techniques

Updated 12 July 2026
  • Tail batching is a collection of tail-aware batching and scheduling techniques that target long-tail latency, underutilization, and rare system states.
  • It encompasses methods like dynamic batch-size control in DNN inference, selective delay in synchronous RL, and adaptive token batching in large language model serving.
  • Tail batching optimizes system performance by balancing throughput gains against risks such as deadline violations and inefficient resource use across varied domains.

Tail batching denotes a set of batching and scheduling techniques that target the tail of system behavior rather than only mean throughput. In the cited literature, the “tail” may refer to the tail of an inference-latency distribution, the underfilled late iterations of batched LLM execution, the long-response stragglers that dominate synchronous reinforcement-learning rollouts, or the high-congestion overflow states of a batch-service queue. Taken together, these works suggest that tail batching is best understood as a family of tail-aware control policies for suppressing stragglers, reducing underutilization, or approximating rare but consequential tail states while retaining the efficiency gains of batching (Choi et al., 2020, Zheng et al., 2024, Gao et al., 25 Sep 2025, Xu et al., 4 Jan 2025).

1. Terminological scope

The term is not used uniformly across the literature. Some papers use it explicitly, while others present mechanisms that are tail-batching-like without adopting the phrase. The common pattern is selective batch formation or selective delay aimed at the regime where naïve batching becomes pathological: long-tail latency, decode-dominated valleys, long rollout rounds, or truncated queue tails.

Context What constitutes the tail Representative mechanism
Real-time DNN inference 95th-percentile inference latency Dynamic batch-size tuning under an SLO
Large-batch LLM inference Underfilled late iterations and kernel tail effect Decode-prefill mixing and memory-centric token batching
Synchronous RL post-training Long-response rollout stragglers Separation into short rounds and long rounds
Batch-service queues Overflow “tail” states Abstract tail-state cost in finite-state approximation
SLA-aware DNN serving Late arrivals trapped behind an ongoing batch Layer-boundary preemption and catch-up batching

A central distinction follows from this heterogeneity. Tail batching is not always “batching the tail of a request queue.” In some systems it is instead a latency-aware online batch-size controller, in others a throughput-oriented mitigation of late-stage GPU underfill, and in still others a mathematical device for handling truncated state tails or end-of-horizon postponement. This suggests that the term is best treated as domain-relative rather than as a single standardized algorithmic primitive.

2. Tail-latency-aware batching in inference services

In real-time GPU inference, tail batching is most directly associated with latency-constrained batch-size control. DNNScaler defines tail latency as the 95th95^{th} percentile of the inference latency distribution and formulates the objective as maximizing average throughput over time subject to LatencytSLOLatency^{t} \leq SLO. Its batching mechanism is dynamic rather than static: it starts from BS=1BS = 1, monitors tail latency, and uses a pseudo binary search to find the largest batch size that still satisfies the latency target. The control rule uses α=0.85\alpha = 0.85: if tail latency is less than SLO×αSLO \times \alpha, batch size is increased; if tail latency is greater than SLOSLO, it is decreased; otherwise it is kept unchanged. The system first decides whether batching or multi-tenancy is more beneficial for a given DNN, then tunes the corresponding control knob. Compared with Clipper’s AIMD policy, DNNScaler’s search is faster and more adaptive, and the reported throughput improvement reaches up to 14×14\times, with 218%218\% on average, while meeting latency requirements (Nabavinejad et al., 2023).

LazyBatching addresses a different source of tail behavior: head-of-line blocking caused by coarse graph-level batching. Instead of waiting for a full graph-level batch, it batches at the granularity of individual graph nodes or layers. Execution can be preempted at layer boundaries, a newly arrived request can “catch up,” and sub-batches are merged once they reach the same next graph node. The scheduler is explicitly SLA-aware. Its slack formulation is

Slack=SLAtarget(Twait+SingleInputExecTimeReq1),Slack=SLA_{target}-(T_{wait}+SingleInputExecTime_{Req1}),

and for a batch of NN requests it uses the conservative estimate

LatencytSLOLatency^{t} \leq SLO0

The reported effect is a reduction of response-time spikes caused by late arrivals waiting behind an ongoing batch. Relative to graph batching, LazyBatching reports average LatencytSLOLatency^{t} \leq SLO1 latency improvement, LatencytSLOLatency^{t} \leq SLO2 throughput improvement, and LatencytSLOLatency^{t} \leq SLO3 improvement in SLA satisfaction; for Transformer, a 99th-percentile latency example is LatencytSLOLatency^{t} \leq SLO4 ms versus LatencytSLOLatency^{t} \leq SLO5 ms for the best graph-batching baseline (Choi et al., 2020).

Fluid Batching extends tail-aware batching to early-exit neural networks on edge NPUs. Its starting observation is that early exits dynamically shrink the active batch size deeper in the network, so static model-level batching can leave later layers underutilized and create long-latency outliers. The scheduler is exit-aware and deadline-aware. At an early exit, it computes a residual batch LatencytSLOLatency^{t} \leq SLO6, the available slack LatencytSLOLatency^{t} \leq SLO7, and a refill amount LatencytSLOLatency^{t} \leq SLO8. Preemption is admitted only if

LatencytSLOLatency^{t} \leq SLO9

with

BS=1BS = 10

On the hardware side, Fluid Batching changes how samples are packed into GEMM matrices on a per-layer basis, and Stackable Processing Elements reconfigure compute structure for small batches. The reported aggregate result is BS=1BS = 11 improvement in average latency and BS=1BS = 12 improvement in tail latency SLO satisfaction (Kouris et al., 2022).

3. Tail-effect mitigation in batched LLM serving

In large batched or offline LLM inference, the most prominent tail-batching interpretation is not percentile latency control but suppression of low-density late-stage execution. BatchLLM targets workloads in which throughput matters more than latency and where requests exhibit prefix sharing. It explicitly identifies common prefixes globally, schedules requests sharing the same prefix together, and reorders groups so that those with larger decode-to-prefill ratio are scheduled first. The scheduling logic uses three queues—common prefix queue, distinct prompt queue, and decoding queue—and forms each iteration’s token batch by fetching in the order: decoding queue, distinct prompt queue, then common prefix queue, subject to the constraint that a common prefix must be processed before its distinct prompts. This allows decoding tokens to be mixed with later prefill chunks, which keeps token batches dense in iterations that would otherwise become decode-dominated valleys (Zheng et al., 2024).

BatchLLM’s batching constraint is memory-centric rather than request-centric. It uses a token chunk size BS=1BS = 13 and a KV memory threshold BS=1BS = 14, and it continues adding prefill chunks while the current batch remains under the memory threshold. The system also optimizes the prefix-shared Attention kernel with horizontal fusion to reduce tail effect and kernel launch overhead. The reported token-batching ablation shows throughput improvement of up to BS=1BS = 15, TECD reduction of up to BS=1BS = 16, and compression of the number of steps from about BS=1BS = 17 to BS=1BS = 18. Across microbenchmarks, BatchLLM outperforms vLLM by BS=1BS = 19 to α=0.85\alpha = 0.850 on A100 and up to α=0.85\alpha = 0.851 on MI200; in two industry case studies, the speedups are about α=0.85\alpha = 0.852 and α=0.85\alpha = 0.853. On a representative workload, the prefix-caching saving ratio is α=0.85\alpha = 0.854 for vLLM and α=0.85\alpha = 0.855 for BatchLLM (Zheng et al., 2024).

A distinct but related line appears in FairBatching, where the target tail is TTFT rather than decode-stage underfill. FairBatching criticizes rigid decode-prioritizing schedulers and replaces them with slack-aware, time-budgeted batch formation. It defines per-token deadlines as

α=0.85\alpha = 0.856

then uses

α=0.85\alpha = 0.857

as the key admission signal. Batch capacity is determined by an adaptive time budget rather than a static token budget, and requests are prioritized in the order urgent decode, prefill, then non-urgent decode. This shifts batching from a decode-prioritizing paradigm to a fairness-aware one. The reported results show TTFT tail-latency reduction of up to α=0.85\alpha = 0.858 while maintaining TPOT SLOs, alongside α=0.85\alpha = 0.859 improvement in single-node capacity and SLO×αSLO \times \alpha0 improvement in cluster-level capacity (Lyu et al., 16 Oct 2025).

4. Tail batching in synchronous RL post-training

RollPacker introduces tail batching as an explicit rollout scheduling strategy for synchronous RL post-training of LLMs. The target pathology is the long-tail response-length distribution in rollout steps: rollout accounts for about SLO×αSLO \times \alpha1–SLO×αSLO \times \alpha2 of total step time, reward for SLO×αSLO \times \alpha3–SLO×αSLO \times \alpha4, and training for SLO×αSLO \times \alpha5–SLO×αSLO \times \alpha6, while some responses reach up to SLO×αSLO \times \alpha7 tokens and can be SLO×αSLO \times \alpha8–SLO×αSLO \times \alpha9 longer than median-scale responses. Under synchronous execution, the entire batch waits for the slowest response, so the shorter rollouts create severe GPU bubbles (Gao et al., 25 Sep 2025).

The core mechanism is the separation of rollout steps into short rounds and long rounds. In a short round, RollPacker uses speculative execution with speculation factor SLOSLO0; in the evaluation, SLOSLO1. It launches SLOSLO2 prompts and SLOSLO3 responses per prompt, but retains only the first SLOSLO4 prompts that finish and, for each prompt, only the first SLOSLO5 responses that complete. The excluded prompts are appended to a long-prompt queue. Once that queue reaches size SLOSLO6, a dedicated long round is executed with speculation disabled and full-length responses allowed to complete. The design addresses two constraints identified in the paper: the rollout batch must still contain enough prompts and responses, and excluding long prompts must not distort the training distribution (Gao et al., 25 Sep 2025).

The reported effect is to concentrate the stragglers into a small number of long rounds while keeping most rounds balanced. With SLOSLO7, the maximum response length in short rounds is reduced by up to SLOSLO8, and average rollout time improves by up to SLOSLO9 over the no-tail-batching setting. Tail batching alone reduces rollout cost strongly, with up to 14×14\times0 speedup in average rollout time in some settings. End to end, RollPacker reports training-time reduction of 14×14\times1–14×14\times2 compared to veRL and up to 14×14\times3 compared to RLHFuse for the Qwen2.5 family on up to 14×14\times4 H800 GPUs, without sacrificing accuracy (Gao et al., 25 Sep 2025).

5. Queueing and optimization viewpoints

In queueing-theoretic work, tail batching can mean controlling or approximating the tail of the system state rather than the tail of execution latency. The SMDP-based dynamic batching framework models a batch service queue with Poisson arrivals of rate 14×14\times5, batch-size-dependent service time 14×14\times6, mean 14×14\times7, and energy consumption 14×14\times8. The objective is to minimize

14×14\times9

equivalently a long-run average cost combining response time and power consumption. The infinite state space is truncated at 218%218\%0, and all states above that threshold are aggregated into an overflow state 218%218\%1 representing the tail states. The key device is an abstract overflow cost

218%218\%2

which makes the finite approximation “feel” the holding costs of the tail. With 218%218\%3, 218%218\%4, and 218%218\%5, the minimum 218%218\%6 decreases from 218%218\%7 when 218%218\%8 to 218%218\%9 when Slack=SLAtarget(Twait+SingleInputExecTimeReq1),Slack=SLA_{target}-(T_{wait}+SingleInputExecTime_{Req1}),0, yielding Slack=SLAtarget(Twait+SingleInputExecTimeReq1),Slack=SLA_{target}-(T_{wait}+SingleInputExecTime_{Req1}),1 space-complexity reduction and Slack=SLAtarget(Twait+SingleInputExecTimeReq1),Slack=SLA_{target}-(T_{wait}+SingleInputExecTime_{Req1}),2 time-complexity reduction. The paper also notes that optimal policies can exhibit a control-limit form,

Slack=SLAtarget(Twait+SingleInputExecTimeReq1),Slack=SLA_{target}-(T_{wait}+SingleInputExecTime_{Req1}),3

This is a threshold view of batching in which tail-state handling changes both numerical tractability and the aggressiveness of service decisions (Xu et al., 4 Jan 2025).

A related but distinct usage appears in online linear programming with batching. There the planning horizon Slack=SLAtarget(Twait+SingleInputExecTimeReq1),Slack=SLA_{target}-(T_{wait}+SingleInputExecTime_{Req1}),4 is divided into Slack=SLAtarget(Twait+SingleInputExecTimeReq1),Slack=SLA_{target}-(T_{wait}+SingleInputExecTime_{Req1}),5 equal-length batches, Slack=SLAtarget(Twait+SingleInputExecTimeReq1),Slack=SLA_{target}-(T_{wait}+SingleInputExecTime_{Req1}),6, and decisions on customers arriving within a batch may be delayed to the end of that batch. The notable structural result is that the proposed algorithms do not delay decisions in every batch. In the single-resource known-Slack=SLAtarget(Twait+SingleInputExecTimeReq1),Slack=SLA_{target}-(T_{wait}+SingleInputExecTime_{Req1}),7 case, the algorithm delays only in the first and last batch and achieves Slack=SLAtarget(Twait+SingleInputExecTimeReq1),Slack=SLA_{target}-(T_{wait}+SingleInputExecTime_{Req1}),8 regret, while the paper also proves a matching Slack=SLAtarget(Twait+SingleInputExecTimeReq1),Slack=SLA_{target}-(T_{wait}+SingleInputExecTime_{Req1}),9 lower bound; in the multiple-resource setting, delay is only in the last batch after using historical data, and the regret bound remains NN0. This is not a named tail-batching primitive in the paper, but it is a mathematically precise form of postponement concentrated at the horizon boundaries rather than throughout the whole process (Xu et al., 2024).

6. Distinctions, misconceptions, and recurring design tradeoffs

A frequent misconception is that tail batching always refers to queue-tail aggregation. The literature is more specific. DNNScaler is best characterized as dynamic, latency-aware serving-time batching, not queue-tail batching per se. BatchLLM uses the language of tail effect to denote underfilled batch iterations and small-kernel inefficiency near the end of batched execution. RollPacker uses the term literally for long-tail rollout responses. The SMDP formulation uses “tail” for overflow states in a truncated Markov model. These are related only at the level of control intent: each method reallocates batching effort toward the regime that dominates worst-case behavior (Nabavinejad et al., 2023, Zheng et al., 2024, Gao et al., 25 Sep 2025, Xu et al., 4 Jan 2025).

Another recurrent result is that there is no universal batch size. DNNScaler reports that batching works well for large, compute-heavy DNNs such as Inception-V4, ResNetV2-152, NAS-Large, and PNAS-Large, while the effect is negligible for smaller networks such as Inception-V1 and MobileNet variants. Its selected batch sizes vary widely, including NN1 for Inception-V4, NN2 for NAS-Large, NN3 for TextClassif, and NN4 for ResV2-50. BatchLLM reaches a similar conclusion at token granularity: request-count limits can be suboptimal, and memory availability, decode-to-prefill ratio, and global prefix structure determine whether a large token batch is beneficial (Nabavinejad et al., 2023, Zheng et al., 2024).

Across domains, the same tradeoff recurs. Larger or denser batches raise throughput, GPU or NPU utilization, or energy efficiency; the tail risk is longer waiting, deadline violation, or late-stage underutilization. Tail batching changes where the system spends its batching budget. In inference systems, this often means enlarging batches only until an SLO boundary is approached. In LLM serving, it means injecting prefill work into decode-heavy iterations and choosing admission by memory rather than by request count. In synchronous RL, it means concentrating long responses into designated long rounds. In queueing models, it means penalizing overflow states strongly enough that the finite approximation preserves the economics of rare congestion. This suggests that tail batching is less a single algorithm than a design principle: batch selectively where the tail is structurally dominant, and avoid paying the full cost of worst-case behavior in every iteration or every request.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Tail Batching.