Manuscript Offprint
arXiv:2611.02082Fairway: Load-Aware KV Cache Reuse for LLM Prefill Scheduling
ABSTRACT
LLM-based applications often employ agentic workflows and retrieval-augmented generation (RAG), which build long prompts from shared context. When prefixes are shared across requests, serving engines reuse the key-value (KV) cache to skip parts of the prefill computation. Reuse is typically graded: the uncached work of requests in a queue can differ by up to . In this setting, the order of scheduling determines the time-to-first-token (TTFT) for the queued requests. KV reuse-first scheduling, which prioritizes the requests with the longest KV cache hit, gives the lowest median TTFT but starves expensive requests under load spikes; first-come-first-served (FCFS) scheduling bounds the tail but raises the median TTFT. We present FAIRWAY, a prefill scheduler built on adaptive reuse prioritization: it favors KV cache reuse while queues are short, and shifts toward fair allocation as requests wait longer relative to their own prefill time. FAIRWAY employs a virtual dual lane model: a KV reuse-first Fast lane and a Fair lane atop the serving engine's waiting queue that enables speeding up of cheap reuse requests without starving expensive ones. This model automatically adapts to the workload without any per-workload tuning. FAIRWAY lowers the tail TTFT at no cost to the median in transient overload. Across workloads and load levels, FAIRWAY matches or beats the best baseline, with a p99 TTFT up to lower than prior prefix-aware schedulers. During load spikes, it keeps the tail of FCFS at a lower median TTFT.
1 INTRODUCTION
Retrieval-augmented generation (RAG) and agentic workflows assemble long prompts from context shared across requests. RAG adds retrieved documents to each prompt, as in enterprise search and document question answering (Lewis et al., 2020; Gao, 2023), and an agent resends its history and tool outputs on every call (Qin et al., 2025). LLM inference runs in two phases: prefill processes the whole prompt in one compute-bound pass, building its key-value (KV) state and emitting the first token, and decode then generates the remaining tokens one at a time. These prompts are long, so the time to first token (TTFT) is dominated by prefill. State-of-the-art serving engines therefore cache the KV state of prompt prefixes and skip recomputing it (Kwon et al., 2023; Zheng et al., 2024). The KV cache is finite, so the order in which waiting requests are served sets both how long each request waits and whether its prefix is still cached when it runs: a request held back in the queue may lose its hit when the requests admitted before it evict its KV blocks. In prefill-decode disaggregated serving (Zhong et al., 2024; Patel et al., 2024; Qin et al., 2025), this order is
set on each prefill node, where a request spends most of its TTFT queueing and in prefill.
Reuse is graded: a request may find all, some or none of its prefix cached, so its prefill work depends on its uncached tokens rather than its prompt length. In Mooncake's production agentic traces (Qin et al., 2025), most requests are partly cached, and this work differs by within a queue ( ). RAG behaves the same way: requests share some retrieved documents but not others, so full hits that compute the prefill only for their question wait in the same queue as partial hits that carry nearly all the prefill work. Prompt lengths vary as well, and the mix of hits and lengths shifts as the popularity of documents and the load change over time.
Existing schedulers handle this variation only partially. KV reuse-first schedulers, which first serve the request with the longest cached prefix (Zheng et al., 2024) or the highest ratio of cached to uncached tokens (Jin et al., 2025), give the best median TTFT but can starve expensive requests when load rises. First-come-first-served (FCFS) bounds the tail but ignores reuse, so cheap hits wait behind long misses. Schedulers that add fairness to a KV reuse-first order measure it in units that ignore request size: some count turns, giving the oldest request one turn in every few (Dexter et al., 2025) or sharing turns among groups
University of California, Irvine, CA, USA Apiphany. Correspondence to: Hamidreza Alikhani hamidra@uci.edu.
Preprint. Copyright 2026 by the author(s).

Figure 1. Median vs. p99 TTFT during a 60s load spike on a finance RAG trace (SEC QA; log-log). Shaded: within 10% of LPM's median and of FCFS's p99.
of requests with similar cache ratios (Srivatsa et al., 2025), though one turn may cost tens of tokens or thousands; other works count seconds, raising a request's priority with its absolute wait (Du et al., 2025), though the same wait time weighs differently on requests of different lengths. Figure 1 shows the result in a short load spike: KV reuse-first orders keep a median of 0.8 s, but their p99 reaches 15–42 s; FCFS keeps the p99 at 7.8 s, but its median rises to 5.9 s. Each fixed rule suits some mix of hits, lengths and load, and fails on another (§2.3, §3).
We present FAIRWAY, a prefill scheduler built on adaptive reuse prioritization: it favors KV cache reuse while queues are short and shifts toward fairness as queues grow and requests wait longer relative to their own prefill time. FAIRWAY rests on two choices: it measures fairness in work characterized by a request's uncached tokens, and it measures each request's wait relative to its own expected prefill time. Two virtual lanes, which order the same requests in two ways, form the backbone of FAIRWAY. The Fast lane ranks requests by the compute their cached prefix saves and promotes them as their relative wait grows, and the Fair lane ranks them by arrival time. FAIRWAY adaptively prioritizes between the lanes, balancing KV cache reuse and fairness with a bound on the work placed ahead of the oldest requests. This balance adapts automatically with different workloads, without requiring any mode switch or per-workload tuning.
We implement FAIRWAY as a drop-in hook in vLLM's scheduler (Kwon et al., 2023): FAIRWAY changes how waiting requests are selected for admission in each scheduling step. It operates orthogonally to other engine policies, such as eviction and step-size selection, and leaves those and other engine configuration unchanged. We evaluate it on a production agentic trace (Qin et al., 2025) and on RAG workloads for financial and general multi-hop QA (Qin et al., 2025; Docugami, 2023; Trivedi et al., 2022; Bai et al., 2024; Li et al., 2024; Dexter et al., 2025; Srivatsa et al., 2025; Xie et al., 2026) across a wide range of loads and prompt lengths. We compare it with seven baselines, from FCFS and KV reuse-first policies to schedulers that consider fairness in their admission policy (Dexter et al., 2025; Srivatsa et al., 2025; Xie et al., 2026).
Across workloads and load levels, FAIRWAY matches or beats the best baseline in every scenario. Its p99 TTFT is up to 8.6× lower than that of prior prefix-aware schedulers, and it starves no request. In load spikes, FAIRWAY keeps the tail of FCFS while achieving a 6× lower median TTFT, by letting cheap cache hits go first while bounding how far they can push expensive misses back. On mixed-length workloads, it cuts the p99 TTFT of short requests by about a third relative to every baseline that does not starve requests.
In summary, we make the following contributions:
-
A characterization of graded prefix reuse: We show that in agentic traces and RAG workloads, prefill work within a queue differs by ≈ 100×, depending on both the cache state and the prompt length (§3.1).
-
An analysis of why existing schedulers fall short: KV reuse-first orders starve expensive requests under load spikes, FCFS raises the median, and fairness counted in turns or in absolute wait time ignores how much work each request carries (§3.1–§3.4).
-
FAIRWAY, a prefill scheduler built on adaptive reuse prioritization, which measures fairness in work and each request's wait relative to its own prefill time. Two virtual lanes, merged by the work each has scheduled, favor KV cache reuse while queues are short and bound the work served ahead of the oldest request as queues grow, without per-workload tuning. (§4).
-
Evaluations against seven baselines on a production agentic trace and three RAG benchmarks under a wide range of workload characteristics showing that FAIRWAY stays robust where the best baseline changes, with one setting throughout (§5).
2.1 Prefill Serving
Serving a request consists of two phases. Prefill processes the whole prompt in one pass, writes its key-value (KV) cache, and emits the first token; decode then generates the remaining tokens one at a time. The time-to-first-token (TTFT) is therefore the time a request waits in the engine's queue plus the time of its prefill. Engines such as vLLM (Kwon et al., 2023) run in steps with continuous batching (Yu et al., 2022). At every step the scheduler first continues the requests that are already running, then admits waiting requests in queue order while the step's token budget lasts. With chunked prefill (Agrawal et al., 2024), a step carries at most prompt tokens,¹ so a long prompt is split over several steps.
In prefill–decode (P/D) disaggregated serving (Zhong et al., 2024; Patel et al., 2024; Qin et al., 2025), prefill runs on dedicated nodes that hand the KV cache to decode nodes as soon as the first token is computed, so a request spends most of its TTFT queueing and in prefill on the prefill node. TTFT is the first latency a user sees in interactive agent and RAG applications, and we target this node.
The engine has other levers, which FAIRWAY leaves unchanged and composes with: the step budget (Agrawal et al., 2024), eviction, preemption, fairness across clients (Sheng et al., 2024; Cao et al., 2025), and routing across instances by cache locality and load (Qin et al., 2025; Sun et al., 2024; Srivatsa et al., 2025). We study one: which waiting request the engine admits next.
2.2 Prefix Caching
Prefix caching lets a request reuse the KV cache that an earlier request computed for the same leading tokens (Kwon et al., 2023; Zheng et al., 2024). vLLM stores KV in fixed-size blocks of 16 tokens and reuses a block only if everything before it matches as well, as does SGLang's radix tree (Zheng et al., 2024); reuse therefore stops at the first block that differs.
Prompts assembled from shared pieces make this structure graded: retrieved chunks in RAG, and history and tool outputs in agents. We use RAG as the example. A RAG prompt is a system prompt , the retrieved chunks, and the question . Suppose an earlier request left and in the cache. A new request reuses and , and recomputes from onward; reuses only , even though and are cached; and computes only its question . The work a request needs is its number of uncached tokens, and it depends on what the cache holds at the moment the request is served. Other systems raise how much of each prompt is cached, by reusing non-prefix chunks (Yao et al., 2025), reordering retrieved chunks (Jiang et al., 2026), or managing agent KV by when each agent runs next (Pan et al., 2025; Tiwari et al., 2026); FAIRWAY orders the partly cached requests they produce. When KV memory is full, an eviction policy decides which blocks survive: e.g., least-recently-used or rules that protect blocks needed by waiting requests (Xie et al., 2026).
2.3 Scheduling with a Prefix Cache
A request computes only the tokens missing from the KV cache when it is admitted, so the order of the waiting queue
decides not only who waits but also how much reuse each request gets, since a request held back may find its cached prefix evicted by those admitted before it. First-come-first-served (FCFS) serves requests in arrival order, regardless of how much of their prompt is cached. KV reuse-first policies rank requests by the extent of reuse possible: longest-prefix-match (LPM), offered by SGLang (Zheng et al., 2024), serves the request with the longest cached prefix first; RAG-Cache's cache-aware reordering (Jin et al., 2025) ranks by the KV reuse ratio (cached over uncached tokens). Ranking by reuse alone raises cache hits and throughput, but a request that keeps losing to cache-rich newcomers can wait without bound. Offline systems group requests that share a prefix for throughput, without per-request latency targets (Zheng et al., 2026; Zhao et al., 2024).
Existing schedulers add fairness in one of three ways. Admission counting: k-LPM (Dexter et al., 2025) serves the oldest request once every picks. Preble (Srivatsa et al., 2025) sorts requests into groups by their cache ratio and gives each group a number of picks that grows with its ratio. Prism reserves a fixed number of first-come slots per batch for rare prefixes (Qu et al., 2026). Retention: PEEK (Xie et al., 2026) orders requests by the prefill their cached prefix saves and protects the blocks that waiting requests will reuse from eviction. Waiting time: the classic remedy adds the time a request has waited to its priority, as PrefillOnly does on top of a ranking by uncached tokens (Du et al., 2025), and TOPAS adds task-level aging for agents (Ni et al., 2026).
Size-aware schedulers favor short jobs: SRPT (Schrage, 1968) and FastServe (Wu et al., 2023) at the expense of long ones, and Autelix (Luo et al., 2025) favors agent programs that have received less service so far. Highest response ratio next (Hansen, 1971) measures a job's wait relative to its service time, the idea behind our relative wait.
These remedies measure fairness in requests (admission counting) or in seconds (waiting time); none measures fairness in the work a pick costs. Section 3 shows why: a pick may cost tens to thousands of tokens (§3.1), the best schedule depends on load (§3.2); waiting in seconds ignores request size (§3.3), and no waiting-time rule alone bounds how much work can be served ahead of a request (§3.4).
3 MOTIVATION
We now show why the existing schedulers of §2.3 fall short and derive four requirements for a scheduler, using a production agentic trace and RAG workloads.
3.1 Cache-Dependent Prefill Work
Graded reuse makes the prefill work of requests in one queue vary widely. Figure 2 shows the tokens the engine actually computes for each request when each trace is served on
¹vLLM 0.16.0 uses for its API server on GPUs with less than 70 GB of memory and 8,192 on H100-class GPUs.

Figure 2. Uncached prompt tokens per request when each trace is served under FCFS (log scale).
GPU: the ratio between the 90th and the 10th percentile is 70–250× across our four workloads. Every SEC QA prompt holds the five chunks retrieved for its question, about 1.5k tokens, yet about half of the requests are full hits that compute only their question, tens of tokens, while the 30–35% that are partial hits carry 54–64% of the prefill work. The spread comes from the cache, not from prompt length.
Production traffic shows the same graded reuse. In Mooncake’s traces from Kimi’s serving system (Qin et al., 2025), an agent resends its history and tool outputs on every call, so a request shares a long prefix with earlier calls of its session and adds a new uncached tail. 58% of conversation requests and 65% of tool-agent requests are partly cached (counting a block as cached if any earlier request contained it), and their uncached tokens range from a few hundred to about 18k, a spread of about 100×.
This variation is what makes the queue order matter: serving a full hit first delays the requests behind it by a few tens of tokens of work, serving a miss first delays them by thousands, yet a scheduler that counts admissions or absolute wait time treats the two picks as equal. Prior evaluations rarely expose this, as they use equal-length prompts (Xie et al., 2026) at steady load and report mean latency only (Xie et al., 2026; Jin et al., 2025).
3.2 No Fixed Order Fits Every Load
With prefix caching, a prefill node’s load is the prefill work arriving per second, the request rate times the uncached tokens per request, so it can rise with more requests or with more KV cache misses. Figure 3 replays a trace that does both: from calm load at 75% of the node’s capacity, a five-minute burst shifts 40% of requests to rarely asked topics, so fewer requests arrive but more of them miss, and load rises to 93%; a 60 s spike in the request rate then pushes

Figure 3. Median (top) and p99 (bottom) TTFT per 60 s window for the SEC QA topic-shift trace, under FCFS and the two KV reuse-first schedulers (§2.3). Shaded: a burst in which 40% of requests turn to cold topics and a 60 s request spike.
load to 114%. While load is calm, FCFS and the KV reuse-first schedulers are indistinguishable: queues are short, so the order barely matters. When load rises, each fails on a different metric. In the spike, FCFS’s median TTFT rises to 5.9 s, against 0.8 s for the KV reuse-first schedulers, as cheap hits wait behind expensive misses. The KV reuse-first schedulers instead lose the tail: their p99 reaches 15.0 s and 41.8 s, against 7.8 s for FCFS, as cache-rich new requests are prioritized over the misses.
Schedulers that add fairness to a KV reuse-first order pick a fixed point between these extremes, k-LPM and Preble by counting admissions and PEEK by protecting cached blocks. The setting that keeps the tail short depends on load and on how many requests miss: on these traces, each stays above FCFS’s tail in at least one spike (§5.2). Counting admissions also ignores what each one costs: one request may cost tens of tokens or thousands (§3.1). Load balancing does not remove such surges: a demand surge reaches all nodes at once, cache-aware routers deliberately send requests that share a prefix to the same node (Srivatsa et al., 2025; Zheng et al., 2024), and adding capacity takes far longer than a load spike duration.
Requirement R1: while queues are short, serve the requests with the most KV cache reuse first; when a burst or spike pushes load toward or past capacity and requests accumulate in the queue, bound how long a request can wait while later requests are admitted ahead of it.

Figure 4. TTFT percentiles for SEC long-doc QA, under KV reuse-first scheduling with an absolute wait and under FAIRWAY.
3.3 Absolute Wait Time Ignores Request Size
A common fix for the tail of §3.2 is to add the absolute wait time to the KV reuse ratio (Jin et al., 2025), and on both dynamic traces it keeps the KV reuse-first median in calm traffic and FCFS-like tails in the burst and the spike. Its weakness appears when prompt lengths differ.
The same wait costs requests of different sizes differently. Take two requests with the same KV reuse ratio, of 1k and 10k tokens, whose prefill takes about 0.14 s and 1.4 s: waiting one second is seven times the short request's prefill time, but less than the long one's. An absolute wait ignores this, as every request gains the same priority for every second it waits. On SEC long-doc QA, whose documents range from about 1k to 13k tokens, it gives every size about the same p99 TTFT once a queue forms, 14–16 s, as do LPM and FCFS, so a short request waits 86 times its own prefill time and a long one 9 times. With near-uniform prompt lengths, the two kinds of wait behave the same.
A relative wait, which divides each request's wait by its own expected prefill time, favors the request for which waiting is more costly, while the reuse ratio still decides between requests whose cache hits differ. On SEC long-doc QA, it lowers the mean TTFT by 21% and the p90 by 35% (Figure 4), and short requests (62% of the trace) gain most. Long requests (9%) pay with a 30% higher p99, yet relative to their size they still wait the least; without a limit on how much shorter work can be served ahead of them, their p99 rises by 47%, so that work must be bounded (R3).
Requirement R2: judge each request's wait relative to its own prefill time, so that a short request becomes urgent sooner than a long one.
3.4 Waiting Time Alone Cannot Bound the Wait
A relative wait lets short requests leave the queue sooner, but, as §3.3 showed, it can push long requests back, and it shares a blind spot with every waiting-time rule: a cached request starts ahead by its reuse, and an old miss is served

Figure 5. FAIRWAY in a serving engine.
before it only after waiting long enough to make up that head start, so the higher the other requests' KV cache hits, the longer the miss waits.
This matters when many highly cached requests arrive while misses are queued: a document suddenly becomes popular, e.g., a filing that was just released, or an agent's planner issues many tool or sub-agent calls in parallel (Kim et al., 2024) that share one long cached context (Zheng et al., 2024; Pan et al., 2025). Each new request enters far ahead of the waiting misses, so a miss's wait is set by what the other requests look like, not by its own size or how long it has waited (§5.4). Such bursts may be rare, but a scheduler should stay safe when they happen, and waiting time alone cannot provide this protection without tuning: any rule in seconds needs a weight or threshold that suits one workload and load but not another; too loose, and the miss still waits; too tight, and the order falls back to FCFS and loses the median. The oldest requests therefore need a bound measured in work.
Requirement R3: for oldest requests, keep the requests served ahead of them within a fixed fraction of their size, no matter how many other requests wait or how many of them have high KV cache hits.
Requirement R4: meet R1–R3 without per-workload tuning. The mix of hits, lengths and load is not known in advance and changes over time, and no fixed trade-off suits every mix (§3.2).
Summary. The best schedule depends on the mix of cache hits, prompt lengths and load, and that mix changes over time. Section 4 meets R1–R4 with adaptive reuse prioritization: a Fast lane that ranks requests by their KV reuse ratio plus a relative wait (R1, R2), and a Fair lane that bounds the work served ahead of the oldest request (R3), with the same parameters on every workload (R4).
Algorithm 1 FAIRWAY ordering of the waiting queue, run before every scheduling step.
Require: waiting set , Fast-lane weight , prefill-time estimate
Ensure: admission order of
1: for all do 2: cached prefix length of 3: 4: 5: 6: end for 7: Fast by , highest first (ties: oldest first) 8: Fair by arrival, oldest first 9: , {work charges of the Fast and Fair lanes} 10: order [] 11: while do 12: if then 13: next unplaced in Fast 14: 15: else 16: next unplaced in Fair 17: 18: end if 19: append to order 20: end while 21: return order
4 FAIRWAY
4.1 System Overview
FAIRWAY applies adaptive reuse prioritization in the serving engine's scheduler (Figure 5) with three components. The Fast lane ranks the waiting requests by KV reuse: it reads each request's cached prefix from the KV cache manager and scores the request by the cached tokens it saves per uncached token, plus how long it has waited relative to its own size. The Fair lane ranks the same requests by arrival time. The adaptive prioritizer merges the two lanes into one ordering based on a running total of the uncached tokens each lane has placed. Before each scheduling step, FAIRWAY rewrites the order of the waiting queue, so it reflects the prefixes cached by the previous step, and the step admits requests in this order. Algorithm 1 gives the full procedure.
These mechanisms meet the requirements of §3. The Fast lane's score combines a reuse-first ranking (R1, §4.2) with a relative wait that measures waiting against each request's own size (R2, §4.3). The prioritizer tracks each lane's weighted work as a work charge (§4.4), which bounds how much work cache hits can place ahead of the oldest request (R3, §4.4), while the final ordering adapts to each workload's mix of hits, lengths and load (R4, §5.1).
4.2 Reuse-First Ranking
For each waiting request with a prompt of tokens, let be the length of its cached prefix and the number of uncached tokens it must compute, its work. The Fast lane ranks requests by their KV reuse ratio , the cached tokens a request reuses per token of work, which RAGCache also uses as its priority (Jin et al., 2025). Of two requests with the same cached prefix, the ratio puts the one with less work first, whereas ranking by cached length alone, as done in SGLang (Zheng et al., 2024), can put a long partial hit ahead of a cheap full hit and delay everyone behind it by its larger work (§3.1).
4.3 Relative Wait
The KV reuse ratio alone starves misses (§3.2), so the score adds the time a request has waited, measured relative to its own expected prefill time: serving a short request first delays the others little, while serving a long one first delays them a lot (§3.3):
where is the expected prefill time of a prompt on an idle engine, measured once per GPU with a short profiling run. We call the second term the request's relative wait and its patience: a request becomes urgent after waiting about three times its own prefill time, and never sooner than one second. Patience uses the full prompt length , which is fixed for a request, rather than the work , which changes with the cache and already enters the ratio. Both terms are unitless and are added without a weight, since a weight on the wait term would only rescale the patience.
When queues are short, waits are a fraction of a second, the relative wait is small, and the order is KV reuse-first (R1). When a queue forms, the relative wait grows, fastest for small requests (R2): for the two requests of §3.3, the patience is 1s and about 4s. The multiplier sets how long KV reuse may delay a request before fairness takes over. We set it to 3 based on the GPU profiling of above, so that a miss that has waited three times its own prefill time ranks with a newly arrived request that has half its prompt cached; a smaller multiplier pushes the order toward FCFS and a larger one toward KV reuse-first.
4.4 Fair Lane and Work Charges
A wait term alone cannot bound waiting when many highly cached requests arrive (§3.4). The Fair lane orders the waiting requests by arrival time, oldest first, and the adaptive prioritizer merges it with the Fast lane by work charges within each step (Figure 6). Each lane's charge starts at the work of its first request, counted times in the Fast lane; the Fair lane's first request is the oldest request , so its charge

Figure 6. One FAIRWAY step with : the oldest request (miss) must compute 6,000 tokens; six later hits 300 tokens each. (1) Waiting queue (2) Two lanes and their merge by work charges (3) Step admits from the top of the order within budget .
starts at . The lane with the smaller charge then places its next request and adds that request's work to its charge, again counted times in the Fast lane, so each lane's charge grows only with the work it places. The lanes take turns this way until the whole queue is ordered, each skipping requests the other has already placed. In Figure 6 (inset), five hits go before , 1,500 tokens or a quarter of its work, however many hits wait. The oldest request's own work thus sets how much cheap work goes ahead of it: about (§4.4).
This merge rule was introduced by stride scheduling (Waldspurger & Weihl, 1995): serve the client with the smallest counter, then advance its counter by the service it received. Counted up to each of its picks, the Fair lane receives a share of the work in the order. The order covers the whole queue, so this share never leaves a step's budget unused.
Charges restart at every step. The rule decides how much cheap work goes before the oldest request in this step, not how work is shared over time. With in Figure 6, the step admits the five hits (1,500 tokens) and the first 548 tokens of , which is then running and continues first in the following steps. Carrying the charges across steps would instead enforce the Fair lane's share (80% at ) of all work over time; under load the queue never empties, so the order would become close to FCFS and lose the median latency speedup. Restarting the charges only when the queue empties fails the same way.
The bound and its limit. The work placed ahead of is at most plus one request (Appendix A); if the budget left in the step covers it and KV memory is available, starts its prefill in that step. The bound acts within one step, so it covers oldest requests of up to about uncached tokens, or 8k at . A longer request is still served: its relative wait keeps growing while it waits, whereas a
newly arrived request scores little more than its ratio, so it eventually rises to the top of the Fast lane. In our evaluation no request starves, even with prompts of up to 16k tokens, and FAIRWAY's worst wait stays within its p99 (§5).
5 EVALUATION
We evaluate FAIRWAY under changing load (§5.2), across different workload characteristics (§5.3), and under a flood of cached requests (§5.4). An ablation attributes each result to one of FAIRWAY's mechanisms (§5.5), and we close with FAIRWAY's overhead and limits (§5.6).
5.1 Setup
Platform. We serve Llama-3.1-8B (Grattaflori et al., 2024) with vLLM 0.16.0 on one NVIDIA A6000 (48 GB) as the prefill node of a disaggregated deployment (Zhong et al., 2024; Patel et al., 2024): each request generates one token, and we report its TTFT. The token budget is per step. The KV cache holds a quarter to a third of each trace's distinct reusable blocks, so eviction is frequent. FCFS is vLLM's default order. All methods reorder the waiting queue inside vLLM's scheduler (§4.1) using the same eviction policy (Appendix C). Every request reaches the engine at its arrival time and the measured TTFT is the engine's own waiting and prefill time. We report median and p99 TTFT, and call a scheduler starving when its worst TTFT exceeds three times its own p99, so that a low p99 cannot hide requests that wait minutes; in our runs the border is clear, with every run either below or above .
Workloads. The RAG workloads are built on the following benchmarks: SEC 10-Q filings from the KG-RAG datasets (Docugami, 2023), multi-hop questions over Wikipedia from MuSiQue (Trivedi et al., 2022), and long-document QA from LongBench and LooGLE (Bai et al.,

Figure 7. Median and p99 TTFT per 60 s window on the two held-out dynamic SEC traces (log scale).
2024; Li et al., 2024). Each prompt holds the chunks retrieved for its question (SEC QA, MuSiQue) or the whole document (SEC long-doc QA, public QA). What we model is the request process, which questions arrive and when, as in prior works (Jin et al., 2025; Srivatsa et al., 2025; Xie et al., 2026): question popularity follows a Zipf distribution with , as in web and RAG traffic (Breslau et al., 1999; Wang et al., 2025), and arrivals are Poisson (Kwon et al., 2023; Zhong et al., 2024; Srivatsa et al., 2025). Poisson arrivals have no bursts of their own, so we add them in two ways: the dynamic traces below, and Mooncake (Qin et al., 2025), a production agent trace with its own bursty arrivals and prefix sharing. Table 3 in Appendix B gives each workload's details.
Load and dynamic traces. We set the load of each trace relative to what the engine can serve: , where is the arrival rate and the request rate FCFS sustains when offered more than it can serve, measured before any comparison. We run each static trace at (busy) and (overloaded), with 4,000 requests (2,932 for Mooncake). Production load is not steady (), so for SEC and MuSiQue we also build two dynamic traces whose load changes within one run: 300 s of calm load (), a 300 s burst (–1.0), 120 s of calm, a 60 s spike past capacity (–1.15), and 240 s of calm, with counted in uncached tokens (Appendix B). The two traces differ in what the burst brings, at about the same work. In the traffic surge, it brings more requests of the same kind. In the topic shift, 40% of its requests ask questions from the less popular half of the pool, whose documents are rarely cached; on
SEC, this raises the share of misses from 17% to 24%.
Baselines. FCFS; longest prefix match (LPM) (Zheng et al., 2024); k-LPM (Dexter et al., 2025) with and 8; RAGCache's cache-aware reordering (Jin et al., 2025); PEEK (Xie et al., 2026); and Preble's per-GPU scheduler (Srivatsa et al., 2025). As an ablation study (), we also run partial versions of FAIRWAY that add its mechanisms one at a time to demonstrate their effectiveness.
Method. FAIRWAY uses three parameters on every workload: the Fast-lane weight , which keeps the work ahead of the oldest request within about a quarter of its own while still letting several cheap hits go first (); the patience multiplier 3 (); and the 1 s patience floor, without which a short request's patience would be a fraction of a second and the ordinary sub-second waits of a busy but stable engine would outweigh the KV reuse ratio. We developed and tuned FAIRWAY on SEC traces drawn with one seed and then froze it. We then ran it unchanged on SEC traces drawn with a new seed, on MuSiQue, and on Mooncake. The 11 scenarios are SEC at and 1.1, both dynamic traces and long-doc QA; MuSiQue at and 1.1 and both dynamic traces; and Mooncake at and 1.1. Public QA and the flood are reported separately.
5.2 Adapting to Changing Load
Figure 7 follows median and p99 TTFT through the two dynamic traces. No fixed order is best on both: among the orders that do not starve requests, LPM has the lowest

Figure 8. p99 TTFT of each baseline relative to FAIRWAY's (line at 1) in all 11 scenarios; above 1 is worse than FAIRWAY. Hatched bars starve requests (worst TTFT > 3× p99). Bars above 3× continue dashed, with their value on top.
median, and FCFS, which lets no request overtake another, has the shortest tail at busy load. We therefore set two targets for each phase (calm, burst and spike): LPM's median and FCFS's p99, each within 10%, so six targets per trace. FAIRWAY meets all six on both traces, in every run. No baseline meets more than four.
In the spike, the baselines miss in two ways. FCFS keeps its short tail, but its median rises six- to sevenfold, to 5.1–5.9 s. The KV reuse-first orderings keep a low median but lose the tail: their p99 reaches 11–12 s for Preble, 13–15 s for LPM and k-LPM 8, 18–19 s for PEEK and 42–50 s for RAGCache. k-LPM 4 stays close to FCFS's tail in the traffic surge (9.9 s), but after the topic shift turns many requests into misses, its p99 rises to 14.2 s. FAIRWAY keeps a median of 0.82 s on both traces and a p99 of 8.4 s and 7.6 s. Over the whole run, where calm time dominates, the medians look alike; the differences sit in the burst and spike windows.
FAIRWAY adapts without a mode switch. In calm windows, waits are short, the relative wait stays small and the order is KV reuse-first, as in LPM. When a burst builds a queue, the relative wait grows and the oldest requests move up, keeping the tail near FCFS's, with the same setting throughout.
5.3 Robustness Across Workloads
Figure 8 compares p99 TTFT in all 11 scenarios. The best baseline changes from case to case: FCFS in four scenarios, k-LPM 4 in four and k-LPM 8 in three. FAIRWAY has a lower p99 than every baseline that does not starve in 10 cases, by 2–18% against the best of them, and ties in the eleventh. SEC shows where the gain comes from. At busy load, FAIRWAY keeps LPM's median (0.70 s against 0.68 s) and FCFS's tail (a p99 of 3.8 s against 3.9 s, while LPM
reaches 5.9 s). Under overload, its p99 of 10.6 s is 18% below the best baseline and half of LPM's 22.2 s.
A p99 can also hide requests that wait far longer than the rest (hatched in Figure 8). RAGCache's ordering starves requests in 10 scenarios, with worst waits of 16–365 s, and in the eleventh its p99 reaches 162 s. PEEK starves requests in three scenarios, and in four more its p99 exceeds twice FCFS's. Preble never starves, but its p99 is 5–53% above FAIRWAY's in every scenario. FAIRWAY starves no request: in every scenario, its worst wait stays within 2.3× its p99. Among the baselines, k-LPM is the strongest and also starves no request, but no single k fits every scenario (Appendix D). A small k lets the oldest request through often, which works on Mooncake, but after a topic shift fills the queue with misses, its p99 is 92% above FAIRWAY's. A large k keeps the cache hot but lets graded reuse push older requests back (+42–61% on SEC, +30% on Mooncake). FAIRWAY counts work rather than picks, so what can pass the oldest request scales with that request's size, with no per-workload setting.
On public QA benchmarks, the non-starving reuse-aware orders end within 8% of each other on p99. FAIRWAY is within 3.3% of the best (k-LPM 8) and has the lowest median (tied with LPM) and mean, while RAGCache's ordering starves and the p99 of FCFS and PEEK reaches 116 s and 1,654 s. Under steady load with long prompts, the tail is set by how long the queue takes to drain, which no order can shorten.
5.4 Bounding the Wait Under a Flood
This stress test checks robustness in the worst case for KV reuse-first ordering (§3.4): many highly cached requests
Table 1. Flood stress test, TTFT (s). Misses: backlog requests whose prefix is not in the KV cache. KV-cache hits: flood requests whose document prefix is already in the KV cache.
| misses (backlog) | KV-cache hits (flood) | |||
|---|---|---|---|---|
| scheduler | p50 | max | p50 | p99 |
| FAIRWAY | 11.7 | 22.0 | 18.2 | 22.2 |
| FCFS | 11.8 | 22.5 | 18.6 | 22.7 |
| k-LPM 4 | 11.8 | 22.4 | 18.3 | 22.1 |
| Preble | 7.8 | 17.2 | 21.9 | 28.2 |
| LPM | 12.3 | 123.9 | 1.6 | 4.4 |
| PEEK | 4.7 | 66.3 | 3.1 | 63.5 |
| RAGCache | 1.4 | 201.4 | 1.2 | 2.0 |
arriving while misses wait. A backlog of misses, built up over a minute, sits in the waiting queue when a stream of requests with high KV cache hits arrives, each needing only a small prefill. Under LPM, PEEK and RAGCache, each new cheap request passes the backlog, and the worst miss waits 66–201 s (Table 1). FAIRWAY keeps it at 22 s, as do FCFS and k-LPM 4: the Fair lane limits how much cheap work goes ahead of the oldest miss in each step.
This protection costs the flood requests latency: they wait about as long as under FCFS (median 18 s, against 1.6 s under LPM). In each step, the Fast lane may place only about a quarter of the oldest miss's work ahead of it (§4.4), far less than the flood brings, so while the backlog lasts FAIRWAY serves the misses largely in arrival order, with a few hits between them. The hits are delayed, not starved: once the backlog clears, they go first again.
5.5 Ablation of FAIRWAY's Mechanisms
Table 2 adds FAIRWAY's mechanisms one at a time to the KV reuse ratio, under three stresses: a topic shift, mixed prompt lengths and the flood. The KV reuse ratio alone has the lowest p99 in the topic shift, but starves requests to get it (worst wait 62.9 s). Adding an absolute wait removes the starvation, and when requests are alike it is enough: with near-equal prompt lengths it matches FAIRWAY within 3%, and it meets all six targets on both dynamic traces.
The difference appears under stress, when the waiting requests differ in size. An absolute wait gives every request the same credit per second, so once a queue persists, a 1k-token request waits behind a 13k-token one; the relative wait moves small requests up first, which delay others the least. On SEC long-doc QA, this cuts the p99 of short prompts from 13.6 to 8.6 s; across the scenarios that mix prompt lengths, short prompts' p99 drops by 23–42% and long prompts' rises by 6–31% (Appendix E). Under overload on Mooncake, where requests differ in both length and cached prefix, it halves the median (3.2 vs. 6.6 s) and lowers the mean by a third (5.4 vs. 8.3 s). The largest requests pay for this: there, FAIRWAY's p99 is 27.6 s against 24.3 s.
Removing the Fair lane shows what it adds. The relative
Table 2. p99 TTFT (s) as FAIRWAY's mechanisms are added one at a time (the relative wait replaces the absolute one), under three stresses: a topic shift (worst wait in parentheses), mixed prompt lengths (SEC; shortest and longest third of prompts), and the flood (worst wait of a backlog miss).
| order | topic shift | mixed lengths short | flood long | worst |
|---|---|---|---|---|
| KV reuse ratio | 5.9 (62.9) | 3.1 | 25.3 | 201.4 |
| + absolute wait | 6.7 (7.9) | 13.6 | 15.1 | 33.4 |
| + relative wait | 6.7 (8.1) | 5.9 | 20.2 | 59.1 |
| + Fair lane (FAIRWAY) | 6.7 (7.9) | 8.6 | 18.1 | 22.0 |
wait alone lets short prompts out faster (5.9 s), but long prompts wait longer (20.2 s), and in the flood the worst miss waits 59 s: a miss passes a hit only when its relative wait exceeds the hit's ratio. With the lane, the worst wait drops to 22 s, below the absolute wait's 33 s, and long prompts get part of their tail back (18.1 s). Each mechanism is needed for one of the stresses we test.
5.6 Overhead and Limits
Costs. FAIRWAY protects the tail first, as SLOs target it, and in one regime this costs median latency: persistent overload in which cached requests are only slightly cheaper than misses. On MuSiQue at , its median is 3.0 s against LPM's 0.9 s, for the lowest p99 (12.6 vs. 14.2 s): as the queue persists, the relative wait of older requests outgrows the small advantage of these partial hits. Without the wait term, the median falls to LPM's level but the p99 rises by 37% on MuSiQue and 12% on Mooncake. Where reuse is deep or queues are short-lived, as at busy load and in bursts and spikes, FAIRWAY keeps LPM's median.
Overhead and scope. Ordering the queue takes 0.02 ms per step at the median queue (7 requests) and 0.6 ms at the largest (509), against steps of 106–355 ms; with the cached-prefix lookup that every cache-aware scheduler performs, it stays under 0.1% of a step at typical queues and 1–3% at the concurrency limit. Load and cache size are set relative to the GPU we evaluate on, so the comparison carries over to larger GPUs serving larger workloads. At , the Fair lane admits an oldest request of up to about 8k uncached tokens within a step, and longer requests are served through the relative wait; a larger token budget extends this range.
6 CONCLUSION AND FUTURE WORK
Prefix caching makes prefill work graded: the uncached work of requests in one queue can differ by up to , and the order in which they are served sets their TTFT. KV reuse-first orders, FCFS and request-count fairness each fit some mix of KV cache hits, prompt lengths and load, and fail on another. FAIRWAY is built on adaptive reuse prioritization. Its Fast lane ranks requests by KV reuse and promotes them as they wait longer relative to their own expected prefill time; its Fair lane, merged with the Fast lane by work charges, caps the work that cached requests can place ahead of the oldest request. Without per-workload tuning, FAIRWAY matches or beats the best baseline in every scenario we evaluate, with a p99 TTFT up to lower than that of prior prefix-aware schedulers. In load spikes, it keeps the tail of FCFS at a lower median TTFT. Future work includes extending the bound to requests too large to start within one step, evaluating larger models on multi-GPU prefill instances, and ordering requests jointly with the cluster router and the eviction policy.
REFERENCES
Agrawal, A., Kedia, N., Panwar, A., Mohan, J., Kwatra, N., Gulavani, B. S., Tumanov, A., and Ramjee, R. Taming throughput-latency tradeoff in llm inference with sarathiserve. Proceedings of 18th USENIX Symposium on Operating Systems Design and Implementation, 2024, Santa Clara, 2024.
Bai, Y., Lv, X., Zhang, J., Lyu, H., Tang, J., Huang, Z., Du, Z., Liu, X., Zeng, A., Hou, L., Dong, Y., Tang, J., and Li, J. LongBench: A bilingual, multitask benchmark for long context understanding. In Ku, L.-W., Martins, A., and Srikumar, V. (eds.), Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 3119–3137, Bangkok, Thailand, August 2024. Association for Computational Linguistics. doi: 10.18653/v1/2024.acl-long.172.
Breslau, L., Cao, P., Fan, L., Phillips, G., and Shenker, S. Web caching and zipf-like distributions: evidence and implications. In IEEE INFOCOM '99. Conference on Computer Communications. Proceedings. Eighteenth Annual Joint Conference of the IEEE Computer and Communications Societies. The Future is Now (Cat. No.99CH36320), volume 1, pp. 126–134 vol.1, 1999. doi:10.1109/INFCOM.1999.749260.
Cao, S., Wang, Y., Mao, Z., Hsu, P.-L., Yin, L., Xia, T., Li, D., Liu, S., Zhang, Y., Zhou, Y., Sheng, Y., Gonzalez, J., and Stoica, I. Locality-aware fair scheduling in llm serving, 2025. URL https://arxiv.org/abs/2501.14312.
Dexter, G., Tang, S., Fatahi, A., Song, Q., Dharamsi, T., and Gupta, A. Llm query scheduling with prefix reuse and latency constraints. In Belgrave, D., Zhang, C., Lin, H., Pascanu, R., Koniusz, P., Ghassemi, M., and Chen, N. (eds.), Advances in Neural Information Processing Systems, volume 38, Main Conference, pp. 94356–94379. Curran Associates, Inc., 2025. doi: 10.52202/085713-3156.
Docugami. KG-RAG datasets: Knowledge graph retrieval
augmented generation evaluation datasets. https://github.com/docugami/KG-RAG-datasets, 2023. SEC 10-Q dataset, v1.
Du, K., Wang, B., Zhang, C., Cheng, Y., Lan, Q., Sang, H., Cheng, Y., Yao, J., Liu, X., Qiao, Y., Stoica, I., and Jiang, J. Prefillonly: An inference engine for prefill-only workloads in large language model applications. In Proceedings of the ACM SIGOPS 31st Symposium on Operating Systems Principles, SOSP '25, pp. 399–414, New York, NY, USA, 2025. Association for Computing Machinery. ISBN 9798400718700. doi: 10.1145/3731569.3764834.
Gao, Y. Retrieval-augmented generation for large language models: A survey. arXiv preprint arXiv:2312.10997, 2023.
Grattafiori, A., Dubey, A., Jauhri, A., Pandey, A., Kadian, A., Al-Dahle, A., Letman, A., Mathur, A., Schelten, A., Vaughan, A., et al. The llama 3 herd of models. arXiv preprint arXiv:2407.21783, 2024.
Hansen, P. B. Short-term scheduling in multiprogramming systems. In Proceedings of the Third ACM Symposium on Operating Systems Principles, SOSP '71, pp. 101–105, New York, NY, USA, 1971. Association for Computing Machinery. ISBN 9781450378604. doi: 10.1145/800212.806506.
Jiang, Y., Huang, Y., Cheng, L., Deng, C., Sun, X., and Mai, L. Contextpilot: Fast long-context inference via context reuse. In Chowdhery, A. and Jia, Z. (eds.), Proceedings of Machine Learning and Systems, volume 8, pp. 1639–1655. MLSys, 2026.
Jin, C., Zhang, Z., Jiang, X., Liu, F., Liu, S., Liu, X., and Jin, X. Ragcache: Efficient knowledge caching for retrieval-augmented generation. ACM Trans. Comput. Syst., 44(1), November 2025. ISSN 0734-2071. doi: 10.1145/3768628.
Kim, S., Moon, S., Tabrizi, R., Lee, N., Mahoney, M. W., Keutzer, K., and Gholami, A. An LLM compiler for parallel function calling. In Salakhutdinov, R., Kolter, Z., Heller, K., Weller, A., Oliver, N., Scarlett, J., and Berkenkamp, F. (eds.), Proceedings of the 41st International Conference on Machine Learning, volume 235 of Proceedings of Machine Learning Research, pp. 24370–24391. PMLR, 21–27 Jul 2024.
Kwon, W., Li, Z., Zhuang, S., Sheng, Y., Zheng, L., Yu, C. H., Gonzalez, J., Zhang, H., and Stoica, I. Efficient memory management for large language model serving with pagedattention. In Proceedings of the 29th Symposium on Operating Systems Principles, SOSP '23, pp. 611–626, New York, NY, USA, 2023. Association for Computing Machinery. ISBN 9798400702297. doi: 10.1145/3600006.3613165.
Lewis, P., Perez, E., Piktus, A., Petroni, F., Karpukhin, V., Goyal, N., Küttler, H., Lewis, M., Yih, W.-t., Rocktäschel, T., Riedel, S., and Kiela, D. Retrieval-augmented generation for knowledge-intensive nlp tasks. In Larochelle, H., Ranzato, M., Hadsell, R., Balcan, M., and Lin, H. (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 9459–9474. Curran Associates, Inc., 2020.
Li, J., Wang, M., Zheng, Z., and Zhang, M. LooGLE: Can long-context language models understand long contexts? In Ku, L.-W., Martins, A., and Srikumar, V. (eds.), Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 16304–16333, Bangkok, Thailand, August 2024. Association for Computational Linguistics. doi: 10.18653/v1/2024.acl-long.859.
Luo, M., Shi, X., Cai, C., Zhang, T., Wong, J., Wang, Y., Wang, C., Huang, Y., Chen, Z., Gonzalez, J. E., and Stoica, I. Autellix: An efficient serving engine for llm agents as general programs, 2025.
Ni, H., Tian, H., Zhang, C., Li, G., and Tan, H. Topas: Workflow-aware prefix-state scheduling for multi-agent llm serving. arXiv preprint arXiv:2608.25523, 2026.
Pan, Z., PATEL, A. D., Shen, Y., Hu, Z., Guan, Y., Li, W.-L., Qin, L., Wang, Y., and Ding, Y. Kvflow: Efficient prefix caching for accelerating llm-based multi-agent workflows. In Belgrave, D., Zhang, C., Lin, H., Pascanu, R., Koniusz, P., Ghassemi, M., and Chen, N. (eds.), Advances in Neural Information Processing Systems, volume 38, Main Conference, pp. 126246–126265. Curran Associates, Inc., 2025. doi: 10.52202/085713-4208.
Patel, P., Choukse, E., Zhang, C., Shah, A., Goiri, I., Maleki, S., and Bianchini, R. Splitwise: Efficient generative llm inference using phase splitting. In 2024 ACM/IEEE 51st Annual International Symposium on Computer Architecture (ISCA), pp. 118–132, 2024. doi: 10.1109/ISCA59077.2024.00019.
Qin, R., Li, Z., He, W., Cui, J., Ren, F., Zhang, M., Wu, Y., Zheng, W., and Xu, X. Mooncake: Trading more storage for less computation — a KVCache-centric architecture for serving LLM chatbot. In 23rd USENIX Conference on File and Storage Technologies (FAST 25), pp. 155–170, Santa Clara, CA, February 2025. USENIX Association. ISBN 978-1-939133-45-8. URL https://www.usenix.org/conference/fast25/presentation/qin.
Qu, X., Lin, T., Li, Y., Chen, Z., and Wang, S. Prism: Fast online llm serving via scheduling-memory co-design. arXiv preprint arXiv:2605.08581, 2026.
Schrage, L. A proof of the optimality of the shortest remaining processing time discipline. Operations Research, 16 (3):687–690, 1968.
Sheng, Y., Cao, S., Li, D., Zhu, B., Li, Z., Zhuo, D., Gonzalez, J. E., and Stoica, I. Fairness in serving large language models. In 18th USENIX Symposium on Operating Systems Design and Implementation (OSDI 24), pp. 965–988, Santa Clara, CA, July 2024. USENIX Association. ISBN 978-1-939133-40-3.
Srivatsa, V., He, Z., Abhyankar, R., Li, D., and Zhang, Y. Preble: Efficient distributed prompt scheduling for llm serving. In Yue, Y., Garg, A., Peng, N., Sha, F., and Yu, R. (eds.), International Conference on Learning Representations, volume 2025, pp. 37057–37082, 2025.
Sun, B., Huang, Z., Zhao, H., Xiao, W., Zhang, X., Li, Y., and Lin, W. Llumnix: Dynamic scheduling for large language model serving. In 18th USENIX Symposium on Operating Systems Design and Implementation (OSDI 24), pp. 173–191, Santa Clara, CA, July 2024. USENIX Association. ISBN 978-1-939133-40-3.
Tiwari, S., Chugh, T., Rickert, N., Peter, S., Mahajan, R., and Shen, H. Cachewise: Understanding workloads and optimizing kvcache management for efficiently serving llm coding agents. arXiv preprint arXiv:2606.16824, 2026.
Trivedi, H., Balasubramanian, N., Khot, T., and Sabharwal, A. MuSiQue: Multihop questions via single-hop question composition. Transactions of the Association for Computational Linguistics, 10:539–554, 2022. doi: 10.1162/tacl_a_00475. URL https://aclanthology.org/2022.tacl-1.31/.
Waldspurger, C. A. and Weihl, W. E. Stride scheduling: Deterministic proportional- share resource management, June 1995.
Wang, Z., Hu, Y., Ye, J., Chang, Z., Yu, J., Deng, Y., and Li, K. Ragpulse: An open-source rag workload trace to optimize rag serving systems. arXiv preprint arXiv:2511.12979, 2025.
Wu, B., Zhong, Y., Zhang, Z., Liu, S., Liu, F., Sun, Y., Huang, G., Liu, X., and Jin, X. Fast distributed inference serving for large language models. arXiv preprint arXiv:2305.05920, 2023.
Xie, B., Wang, Z., Tanaka, M., and Zheng, Z. Peek: Predictive queue-informed kv cache management for llm serving. arXiv preprint arXiv:2607.02525, 2026.
Yao, J., Li, H., Liu, Y., Ray, S., Cheng, Y., Zhang, Q., Du, K., Lu, S., and Jiang, J. Cacheblend: Fast large language model serving for rag with cached knowledge fusion. In
Proceedings of the Twentieth European Conference on Computer Systems, EuroSys '25, pp. 94–109, New York, NY, USA, 2025. Association for Computing Machinery. ISBN 9798400711961. doi: 10.1145/3689031.3696098.
Yu, G.-I., Jeong, J. S., Kim, G.-W., Kim, S., and Chun, B.-G. Orca: A distributed serving system for Transformer-Based generative models. In 16th USENIX Symposium on Operating Systems Design and Implementation (OSDI 22), pp. 521–538, Carlsbad, CA, July 2022. USENIX Association. ISBN 978-1-939133-28-1.
Zhao, Y., Yang, S., Zhu, K., Zheng, L., Kasikci, B., Zhou, Y., Xing, J., and Stoica, I. Blendserve: Optimizing offline inference for auto-regressive large models with resource-aware batching. arXiv preprint arXiv:2411.16102, 2024.
Zheng, L., Yin, L., Xie, Z., Sun, C., Huang, J., Yu, C. H., Cao, S., Kozyrakis, C., Stoica, I., Gonzalez, J. E., Barrett, C., and Sheng, Y. Sglang: Efficient execution of structured language model programs. In Globerson, A., Mackey, L., Belgrave, D., Fan, A., Paquet, U., Tomczak, J., and Zhang, C. (eds.), Advances in Neural Information Processing Systems, volume 37, pp. 62557–62583. Curran Associates, Inc., 2024. doi: 10.52202/079017-2000.
Zheng, Z., Ji, X., Fang, T., Zhou, F., Liu, C., and Peng, G. Batchllm: Optimizing large batched llm inference with global prefix sharing and throughput-oriented token batching. In Chowdhery, A. and Jia, Z. (eds.), Proceedings of Machine Learning and Systems, volume 8, pp. 1742–1756. MLSys, 2026.
Zhong, Y., Liu, S., Chen, J., Hu, J., Zhu, Y., Liu, X., Jin, X., and Zhang, H. DistServe: Disaggregating prefill and decoding for goodput-optimized large language model serving. In 18th USENIX Symposium on Operating Systems Design and Implementation (OSDI 24), pp. 193–210, Santa Clara, CA, July 2024. USENIX Association. ISBN 978-1-939133-40-3.
AI USAGE DISCLOSURE
We used AI coding and writing assistants to speed up parts of this work: writing scripts to run experiments, collecting and visualizing the evaluation results, porting and running the baselines in our evaluation framework, and proofreading the manuscript. All design decisions, experiment plans and results were defined and checked by the authors, who reviewed and revised the final version of the manuscript and take full responsibility for its content.
A BOUND ON THE WORK AHEAD OF THE OLDEST REQUEST
Consider the order computed for one step (Algorithm 1). Let be the oldest waiting request and the work (uncached tokens) of request . The Fast lane's charge starts at , where is the Fast lane's first request, and grows by with each Fast pick . The Fair lane's first request is , so its charge starts at . The Fast lane picks while .
Lemma 1. Let be the requests placed before , and their total work. Then : at most plus one request, however many requests wait and however cached they are.
Proof. The Fair lane's first pick is , so every request before is a Fast pick, and until is placed. The Fast lane picks only if just before, when . Thus , which gives the bound. The proof uses only the charges, so the bound holds whatever the scores are.
When the requests before have equal work, and the bound is : a quarter of 's work at (Figure 6, inset).
Corollary 1. starts its prefill in a step if (i) the token budget left after the running requests exceeds , (ii) the KV cache can hold the requests before and 's first chunk without evicting their cached prefixes, and (iii) the limit on requests per step is not reached.
Proof. The scheduler admits requests in this order while budget remains. Under (i)–(iii), all requests before fit (Lemma 1), and at least token of budget remains for 's first chunk.
Scope. The bound holds within one step; charges restart every step, so it is not a share of the GPU over time. It lets start within the step for oldest requests of up to about uncached tokens, 8k at . A larger request relies on the relative wait, which keeps growing while a newly arrived request scores little more than its ratio, so it still reaches the top of the Fast lane. In our evaluation no request starves, and FAIRWAY's worst wait stays within its p99 (5).
B WORKLOADS
RAG traces. The documents and questions come from the benchmarks, and each prompt holds the chunks retrieved for its question, or the whole document for SEC long-doc QA and public QA. Each request asks a question from a fixed pool, and the -th most popular question is asked with
Table 3. Workloads. RAG traces use Zipf popularity () and Poisson arrivals; Mooncake keeps its own arrivals and sharing.
| workload | content | tokens | |||
|---|---|---|---|---|---|
| SEC QA | 20 | SEC | 10-Q | fil-ings (Docugami, 2023)in 256-token chunks; top 5retrieved | 1.2–1.5k |
| SEC long-doc QA | same filings, whole docu-ments of three sizes | 1.0–13.2k | |||
| MuSiQue | 21k | Wikipedia | para-graphs (Trivedi et al., 2022);top 11 retrieved | 0.9–3.4k | |
| Mooncake | production agent re-quests (Qin et al., 2025) | 0.3–16k | |||
| Public QA | LongBench, LooGLE QA atnatural length (Bai et al.,2024; Li et al., 2024) | 3.5–16.3k | |||
| Flood | SEC text; miss backlog, thencached hits | 1.1–6.1k | |||
probability proportional to . Requests for web content follow such Zipf-like distributions with an exponent below one (Breslau et al., 1999), and RAG retrievals concentrate on a small set of hot chunks (Wang et al., 2025). A larger turns more requests into hits, which favors KV reuse-first schedulers, and a smaller one turns more into misses, where every order approaches FCFS. Popularity ranks are a seeded shuffle of the pool, so a question's popularity is independent of its length.
Mooncake. The trace gives arrival times, sessions, and which requests share which prefix blocks; we fill the blocks with fixed text, so that requests share the blocks the trace lists. To fit one GPU, we keep one in eight sessions, each with all its requests, and scale prompt lengths by 1/4. Its arrivals are bursty (an index of dispersion of 4.5 over 10 s windows, against 1 for Poisson). Its native rate is ; we compress time uniformly to and 1.1.
Load. The static runs at and 1.1 model a busy engine and a sustained but temporary overload. Below about queues rarely form and every order gives the same TTFT; above about 1.2 the backlog grows so fast that every order fails; in between, the order decides who waits. In the dynamic traces, counts uncached tokens rather than requests: a burst can change how much uncached work each request brings, so each phase's request rate is set so that its uncached tokens per second reach the target fraction of what FCFS serves at capacity. The calm between phases lets the queue drain, so each phase is measured on its own.
C EVICTION POLICY
When KV memory is full, all methods use PEEK's demand-aware eviction (Xie et al., 2026). Blocks that no waiting re-
Table 4. p99 TTFT (s) of FAIRWAY, and how much higher k-LPM's p99 is in the same scenario. No fixed fits every scenario.
| scenario | FAIRWAY | k-LPM | |
|---|---|---|---|
| p99 | |||
| SEC, | 3.82 | +12% | +42% |
| SEC, | 10.55 | +22% | +61% |
| Traffic surge | 6.44 | +6% | +14% |
| Topic shift | 6.71 | +92% | +19% |
| SEC long-doc QA | 14.26 | +4% | +3% |
| MuSiQue, | 12.62 | +14% | +10% |
| Mooncake, | 27.57 | -2% | +30% |
quest needs are evicted first, least recently used first. Among blocks that waiting requests need, the policy evicts first those whose loss forces the fewest tokens to be recomputed, summed over the waiting requests that need them; these are the ends of cached prefixes, since evicting a block also makes every later block of its prefix unusable. With eviction, the handling of running requests, and preemption the same everywhere, the methods we compare are admission policies: they differ only in which waiting requests are admitted next, so the differences in our results come from this order alone.
D K-LPM ACROSS SCENARIOS
Table 4 compares FAIRWAY with k-LPM at and 8 in the scenarios where the choice of matters. A small fails after a topic shift (+92%), and a large fails under steady graded reuse (+42–61% on SEC, +30% on Mooncake). Choosing thus requires knowing the workload in advance, and the workload changes.
Table 5. p99 TTFT (s) of short and long prompts under FAIRWAY, and its change against the KV reuse ratio with absolute wait. Short and long are the shortest and longest third of each trace's requests by prompt length (split points in tokens); Mooncake at and 1.1.
| scenario | split | short prompts | long prompts | ||
|---|---|---|---|---|---|
| p99 | change | p99 | change | ||
| SEC long-doc QA | 1.2k / 3.4k | 8.6 | -37% | 18.1 | +20% |
| Mooncake 0.9 | 1.2k / 1.8k | 8.2 | -23% | 13.2 | +11% |
| Mooncake 1.1 | 1.2k / 1.8k | 14.2 | -42% | 32.5 | +31% |
| Public QA | 7.5k / 12.6k | 21.4 | -23% | 31.4 | +6% |
E SHORT AND LONG PROMPTS UNDER MIXED LENGTHS
Table 5 compares FAIRWAY with the KV reuse ratio plus an absolute wait, which differ only in how waiting is measured. Short prompts' p99 drops by 23–42%, and long prompts', which have more patience, rises by 6–31%. On SEC long-doc QA, FAIRWAY also keeps the lowest overall p99 (14.3 vs. 14.7 s), and its short-prompt p99 is 35% below that of the best baseline (k-LPM 8, 13.2 s). LPM, k-LPM and Preble give the same p99 to all three length groups, like the absolute wait. The exception is Preble on Mooncake, whose group order serves short prompts faster still (4.5 and 7.2 s), at an overall p99 28–32% above FAIRWAY's.