arXiv:2610.33923cs.PFOct 2026

Manuscript Offprint

arXiv:2610.33923

Queuing for Inference: Dynamic Memory Footprints and Costly Preemption

Jiahui Ni, Vishrant Tripathi

JIAHUI NI, Purdue University, USA

VISHRANT TRIPATHI, Purdue University, USA

Modeling inference workloads for transformer-based neural networks poses unique challenges due to their dynamic memory footprints, head-of-line blocking caused by heavy-tailed request distributions, and memory-dependent preemption overhead arising from the need to load/unload cache state. In this paper, we introduce a new queuing model that captures the impacts of these features on system stability and scheduling design. We show that the Gittins-index policy, which minimizes mean response time in the standard M/G/1 setting, can incur substantial preemption overhead in our model. Motivated by this limitation, we propose the Multi-Level-Priority-Threshold (MLPT) policy, that limits preemption while preserving priority for short jobs. We characterize the mean response time under MLPT and provide empirical rules-of-thumb to solve the resulting threshold-optimization problem. Our key observation is that optimal scheduling is a balance between reducing the response times of shorter jobs and limiting the overhead incurred when preemption occurs. These results provide a theoretical framework for understanding scheduling in memory constrained queuing systems for inference tasks.

1 Introduction

Transformer-based inference is becoming a major contributor to traffic growth in large-scale infrastructure and compute serving systems. Over the past three decades, traditional performance modeling and queuing literature has served the computing infrastructure community well in analyzing the fundamental limits of system performance and in designing more efficient architectures. However, modern inference workloads have characteristics that are not captured by classical queuing models. In particular, inference requests can have highly variable and often unknown execution times, their memory footprints can grow substantially as they are served, and interrupting a request can incur significant overhead because the state accumulated during execution must be moved or reconstructed. These characteristics couple scheduling decisions with memory occupancy and service capacity in ways that are fundamentally different from conventional compute workloads.

A particularly important characteristic of transformer inference is its dynamically growing memory footprint. During autoregressive generation, a request maintains a Key-Value (KV) cache that grows with the generated sequence length. Consequently, the memory required by a request increases with its attained service: a request that has been served for a long time may occupy substantially more memory than a newly arrived request. Modern LLM serving systems have developed sophisticated mechanisms to manage this memory. For example, continuous batching allows requests to enter and leave a batch at iteration granularity [1], while PagedAttention improves KV-cache memory utilization by reducing fragmentation through paged allocation [2]. However, these mechanisms do not eliminate the finite capacity of GPU memory. When the available KV-cache capacity is exhausted, requests may need to be preempted and their state transferred to host memory or reconstructed through recomputation, introducing additional data-movement and computational overhead. Thus, memory is not merely a resource that determines how many requests can be simultaneously admitted: as memory pressure increases, it can directly affect how efficiently inference work is completed.

This distinction is important because a finite memory constraint can change the service process of a request. Consider a request whose memory footprint grows with its attained service. While

Authors' Contact Information: Jiahui Ni, Purdue University, West Lafayette, Indiana, USA, ni169@purdue.edu; Vishrant Tripathi, Purdue University, West Lafayette, Indiana, USA, tripathv@purdue.edu.

Jiahui Ni and Vishrant Tripathi

its memory requirement remains below the available capacity, it can be served at its nominal rate. Once its footprint reaches the memory capacity, however, the remaining computation may have to be performed under memory pressure, resulting in a lower effective service rate. The amount of work affected by this slowdown depends on the intrinsic size of the request and on how its memory footprint evolves during execution. Long requests are therefore affected disproportionately: they are more likely to reach the memory limit and, once they do, may spend a significant fraction of their execution in the slower regime. This creates an interaction between job size, attained service, memory occupancy, and effective service capacity that is absent from the standard M/G/1 model.

Memory constraints also fundamentally change the cost of preemption. Preemption is attractive for inference workloads because request sizes are generally unknown upon arrival and can exhibit substantial variability. Under FCFS scheduling, a long request can cause significant head-of-line blocking for shorter requests, motivating scheduling policies that prioritize requests according to their attained service [3, 4]. In a classical M/G/1 queue, such policies can exploit preemption without explicitly accounting for the cost of switching between jobs. In inference serving, however, preempting a request can require removing its accumulated KV cache from fast memory and subsequently restoring that state through data movement or recomputation. Because the amount of cached state grows with attained service, the cost of preemption itself can increase as a request runs. Thus, aggressive preemption can improve response time by reducing head-of-line blocking while simultaneously consuming additional system capacity through state movement or reconstruction. Existing serving systems mitigate these costs through mechanisms such as proactive KV-cache swapping and live request migration [5, 6], but the fundamental scheduling tradeoff remains.

The resulting problem is also distinct from classical queuing models with finite buffers. In a finite-buffer queue, the capacity constraint limits the amount of queued work that can be stored in the system; when the buffer is full, newly arriving jobs may be blocked or dropped, while the service process of a job already in service is unaffected. In contrast, the memory constraint considered here is coupled to the execution of the job itself. A request can progressively increase its memory footprint while receiving service, reach the finite memory capacity during execution, and subsequently experience a reduced service rate. Moreover, if the request is preempted, its accumulated memory state determines the additional work required to resume it. The capacity constraint therefore affects not only admission or occupancy, but also the service requirement of a job and the cost of scheduling decisions.

This distinction becomes increasingly important as inference is deployed across large-scale infrastructure as well as resource-constrained edge and on-device environments. At the edge and on end devices, available high-speed memory is much more limited, while moving state between memory hierarchies or between processing units can consume a larger fraction of the available computational and communication capacity. Consequently, memory pressure and state movement can have an even more pronounced effect on effective inference capacity in such environments.

References (27)