Toward Zero-Cost Scaling of Multi-LoRA Serving on Causal Encoder–Decoder Models

Publish

LoRA lets one model serve many specialists, but in serving it taxes every token. Our serving stack avoids most of that per-token overhead: every LoRA shares one KV cache, prefill carries zero adapter weight, and decode stops paying for how many LoRAs the batch happens to mix. A production replay with a LoRA named on every request holds the 1,000 RPM target, and an adapter swaps in 0.2 s.

TL;DR

  • One KV copy serves every LoRA. Every persistent KV byte is written before any adapter is applied, so a thousand LoRAs share a single prefix cache. A request that switches LoRA keeps the cache it already built, and the pool holds one copy of a prefix instead of one per adapter.
  • Prefill never sees an adapter. A prefill instance loads the encoder and zero bytes of adapter weight, so the two pools scale independently (1P:ND). The prompt tail that does need an adapter rides decode's existing verification loop, which is why it adds no step.
  • FusedMoL computes each token's LoRA update inside the decode kernels. Each token names its LoRA the way it names an expert, and the low-rank update is computed inside the kernels that consume it. No per-token weight copy, no separate GEMM per projection, no reduction padded to the resident set — so each additional resident LoRA adds single digits to low teens of a percent per step, not a multiple.
  • The adapter tax falls from 40–100% to 12–19%, and from over 60% to under 14% once the batch mixes adapters. An ordinary multi-LoRA path pays 40–100% per decoded token on the base model, and more than that under load — past 100% at high concurrency. Mixing five adapters already costs GLM-5.3 MoL more than 60% per step against a single adapter. Here sixteen mixed adapters cost 6.8–13.4% against one, and prefill pays nothing at all.
  • A production replay holds the 1,000 RPM target with a LoRA named on every request. We replay 3,074 real chat requests, each naming one of sixteen adapters without regard to its content. The steady window sits at 989–998 requests per minute — level with the same stack serving base traffic only — and completion throughput does not move.

Dilemma in Multi-LoRA Serving

A single language model can be specialized through post-training for scientific or financial tasks. Deploying each specialist separately, however, requires a full set of model weights for each one. Low-rank adaptation (LoRA) [4] keeps the base weights frozen and represents each specialization with a lightweight adapter. This makes multi-LoRA serving possible: one engine shares the base weights across specialists and batches requests that use different adapters. The model is thereby fixed and the adapter becomes a per-request attribute. The part this does not solve is the batch: once requests in the same decode step carry different adapters, the engine has to apply different low-rank updates to the same base weights, token by token.

  1. Switching LoRAs can invalidate a request’s cached prefix. When different LoRAs modify weights along the KV-producing path, the same token prefix can yield different key and value tensors. A request that switches adapters cannot reuse the cached KV where those tensors would differ under the target adapter. On DeepSeek-V4.1-Flash [2, 3], we apply LoRA only to the decoder and keep the encoder and layer-20 global KV writers frozen [12]. This preserves persistent global KV across adapter switches, leaving only the local sliding-window state to rebuild [13].
  2. Resident adapter weights compete with KV cache for GPU memory and complicate PD scaling. In our 16-slot configuration, adapter expert tables alone occupy 27.95 GB per decode GPU, reducing the memory available for KV. Replicating adapter weights across the two pools also reduces prefix-cache capacity on prefill and restricts routing to replicas with the requested adapter in each pool. Scaling either pool then requires coordinating adapter placement across prefill and decode.
  3. Mixed-LoRA serving adds batching and decode overhead. Unmerged LoRA adds a low-rank update at each adapted projection. Serving tokens that use different adapter weights in the same batch presents an additional challenge. Unfused updates can also add kernel launches and memory traffic [5, 7]. At 132 DSpark verification tokens, our gather-and-BMM baseline stages about 13 GB of per-token weight copies per step and adds 38 LoRA kernel nodes per decoder layer.

Shared Prefix Caching and Disaggregated Prefill

DeepSeek-V4.1-Flash splits its 40 layers into an encoder and a decoder. Every persistent KV byte is written inside the encoder half; the decoder reads that compressed KV and keeps a short local sliding window of its own. We freeze the encoder and the layer-20 projections that write global KV, so every adapter can reuse the same cached prefix.

One global KV across all adapters

LoRA is confined to the decoder half, so every adapted module sits above the last byte that can be cached: an adapter cannot alter any of it. That is why KV reuse across adapters is safe rather than merely convenient — other work has to translate or repair KV between variants, and here there is nothing to repair.

Figure 1. LoRA placement on DeepSeek-V4.1-Flash. Freezing the encoder (layers 0–19) and the global KV compressor/indexer path keeps every cached global KV byte identical across the base model and every adapter.

Serving engines nevertheless namespace the prefix cache by adapter, so two requests that share a 32K-token system prompt, a set of tool definitions or a multi-turn agent history, but run on different adapters, miss each other's entries: both the prefill compute and the KV storage are paid twice. Remove that namespace and any request can read and populate one tree, whatever adapter it targets.

On the replay behind Table 1 that cuts the prefill the pool has to recompute by a factor of 2.8, and takes the token-level hit rate from 81.71% to 93.54%.

ConfigurationReuse across adaptersOverall token hitSustained RPMClient TTFT p50
Per-adapter isolation0%81.71%403.729.14 s
One shared cache100%93.54%806.2 (2.00×)4.45 s (6.55×)

Table 1. Eleven adapters rotating over the same corpus, 1,769 completed requests, one build before and after the cache stopped being namespaced per adapter. The shared row's 15.7 M is that run's prompt volume recomputed at the shared hit rate, so the 2.8× compares like with like. These rates are not Table 4's: different adapter count and a different window.

A prefix cached under one adapter is invisible to the others, so the pool can only reuse a prefix that the same adapter served before. Where prompts overlap — a shared system prompt, a set of tool definitions, a long agent history — that prefix is held and recomputed once per adapter instead of once; where they do not overlap, nothing is lost either way. On an open-ended stream with sixteen adapters the overlap case is what dominates, and none of it improves with time.

Encoder-only prefill

Since persistent KV comes entirely out of the encoder half, a prefill instance needs neither the decoder layers nor any adapter, which is what lets the two pools be sized and scheduled independently. In this deployment the prefill side is stateless: instances stream compressed KV to decode instances that hold the full stack and every resident slot, and a stateless router sits in front. The one piece that does need the decoder under its adapter — the short local window the decoder keeps for itself — we rebuild inside the step decode is already running, so it costs no extra pass and adds no barrier between ranks.

Figure 2. Disaggregated 1P:ND topology. Encoder-only prefill instances load layers 0–19 and no adapter weights, and fan out to decode instances that hold the full stack and every resident slot.

FusedMoL: Fusing Multi-Slot LoRA in the Decode Engine

On decode the batch mixes adapters: every token belongs to a request, and every request names one of the resident adapters, or none. The work is to apply the right low-rank update to the right token, inside a step whose shape never changes — the same captured graph, the same six verified tokens per request, the same resident planes. Decomposed implementations pay for that three ways: per-token weight copies into HBM, a separate kernel per projection site, and reductions padded to the number of resident planes. We removed all three.

One stack, one pass per token

We call the stack FusedMoL, by analogy with the base model's FusedMoE: both compute a sparse, per-token contribution inside the kernel that consumes it, instead of materialising it and adding it afterwards. The consequence is a decode step whose cost no longer tracks how many adapters the batch happens to mix.

Pointer-stable slots and in-place swaps

Adapters arrive in two shapes: our own exports are bfloat16 and already restricted to the decoder half, while a Tinker checkpoint is float32 over all forty layers and is read down to the decoder half on load. The measurements below use the larger of the two, so every footprint quoted here is the pessimistic one. The engine reports 1.75 GB per slot and 27.95 GB for sixteen slots on each GPU — about a tenth of a B300 (Table 2).

QuantityValue
Checkpoint on disk, F32, decoder half6.96 GB
Expert tables per slot, per decode GPU1.75 GB
16 resident slots, per decode GPU27.95 GB (10.2% of 275 GB)
16 resident slots, 4-GPU decode instance~112 GB

Table 2. Adapter residency, from the engine's own startup accounting. A second unit, rebuilt from a snapshot of this one, prints the same line (slots=16 per_slot=1.75 GB resident=27.95 GB), so this is not a property of a single machine.

All planes are allocated once at startup at fixed addresses, and the decode graphs are captured against those addresses. Loading or unloading writes into a plane in place and updates a name-to-slot table on the host: nothing is reallocated.

Production Evaluation

Everything below is measured on one 1P:1D serving unit: an encoder-only prefill over four GPUs paired with a decode instance over four GPUs carrying sixteen resident planes, with the rest of the pool served from storage on demand. Every number comes from that unit and is reported per unit, so capacity and latency scale with the number of units. Two runs of the same arm reproduce to 0.4% on request rate and 0.1 ms on per-token latency; across units the same arm spreads to about 2% and 0.9 ms, and the tables carry those wider bands.

A 1,000 RPM replay of long-context production traffic

The replay is 3,074 production chat requests, pushed at a target of 1,000 RPM with each request's original sampling parameters. It is a long-context workload and a single-turn one: prompt length runs from 4K to 373K tokens with a median of 140K, and the median conversation has one user turn (Table 3). Five requests in six arrive with more than 65K tokens of context and 19% exceed 262K, which is why prefix reuse rather than prefill arithmetic decides the throughput ceiling: one pass over the corpus moves about 419M prompt tokens, and any adapter-specific duplication of cached state is paid on all of it. Replies are short by comparison, 259 tokens at the median and 271 on average.

Prompt length (tokens)Requests in sampleShare
1–4K253.1%
4–16K00.0%
16–65K10613.2%
65–262K52065.0%
262K–373K14918.6%
All800100%

Table 3. Prompt-length distribution, from a tokenized sample of 800 of the 3,074 requests. Over the full corpus the mean is 136K tokens and the median 140K.

Each arm replays the same 3,074 request bodies through the same pipeline. In the base arm a body names no adapter; in the other arm the identical bodies name one of sixteen adapters in round-robin, so the only field that differs is the adapter. Both arms replay at the 1,000 RPM target. Each run's plateau is taken with the first 120 s and the last 60 s dropped; the two earlier arms were shorter and are counted at their own plateau.

ArmRunsSustained RPMTPOT p50Completion tokens/min
base traffic3972–98811.1–12.0 ms264–270K
sixteen adapters4989–99813.1–13.4 ms265–270K

Table 4. Throughput and per-token cost on the 1,000 RPM replay. Rates are the median of whole minutes in the flat part of each run, which is why they sit below the peak minute of 1,013–1,021; each range spans every run of that arm, on either unit and in either campaign. Completion tokens per minute counts the same requests by output length instead of arrival, so it is not an independent measurement.

The most recent pair on one unit reads 987.5 RPM for base traffic and 989.5 and 992.5 for two runs of sixteen adapters; the earlier campaign reads 972 and 986 for base and 994 and 998 for sixteen adapters. Sixteen adapters come in 0.2–0.4% above base in all four paired comparisons, which is far below the 2% band that one arm spans across runs, so we read the two as equal rather than as a gain. Per-token latency is a different matter. Base sits at 11.1–12.0 ms and sixteen adapters at 13.1–13.4 ms across all seven runs, and the paired gap is 1.4–2.1 ms on every unit and in every campaign; the seven kernels read from sixteen weight planes instead of one. Completion tokens per minute follow the same story, 264–270K in both arms.

We report time to first token separately for each load level, because it varies with the number of active requests per decode rank rather than with the adapters: with 14–21 requests running per DP rank and an empty queue, both arms sit at 2.7–3.1 s; with a shallow batch of 1–5 they sit at 1.3–2.3 s. Within either regime sixteen adapters add 0.10–0.15 s, consistently, across all seven runs. Most of the absolute value is the prefill of a 140K-token prompt plus a request's share of the prompt-tail slices.

Controlled concurrency sweep

The replay has time-varying prompts and a hit rate that drifts with them, so we also sweep concurrency on a fixed workload: 36,864-token contexts, 512-token outputs, and 8 to 128 requests per decode rank — 32 to 512 concurrent requests on one decode instance. To keep the tail out of the measurement we take the window after every request has finished its replay and no request is waiting on a transfer (Table 5, Figure 3).

R (total)T = 6Rbase, 16 slots armed1 adapter4 adapters16 adapters16 vs. 1 adapter
8 (32)4821.75 ms23.21 ms23.84 ms24.78 ms+6.8%
16 (64)9625.17 ms27.06 ms27.90 ms28.98 ms+7.1%
32 (128)19231.02 ms33.99 ms35.00 ms37.01 ms+8.9%
64 (256)38441.09 ms45.04 ms47.98 ms50.02 ms+11.1%
128 (512)76857.01 ms63.50 ms69.52 ms71.98 ms+13.4%

Table 5. Autoregressive step latency, 36,864-token contexts, after the prompt tail has drained.

Figure 3. Left: step latency across the sweep. Right: output throughput per GPU against per-request token rate.

Most of the growth between R=8R = 8 and R=64R = 64 is not LoRA at all: the 16-adapter row rises 25.24 ms and the base row 19.34 ms.

A profiler trace at both ends puts most of the kernel growth in the expert GEMM, and the mechanism is expert granularity: at small batches a third of the experts stay idle and cost almost nothing, while at large batches every expert is live in every layer, so each layer reads all of its expert weights.

The rest of the gap — +6.8% at the smallest batch, +13.4% at the largest — is locality: a single live adapter is reused out of L2, while sixteen live planes scatter the same reads. The two sections agree numerically: the replay's per-token latency times the measured accept length lands inside this sweep's band.

Capacity beyond HBM

Each decode instance keeps sixteen adapters in GPU memory. A request for a seventeenth adapter waits for a slot rather than failing: a mount costs a fraction of a second, and an adapter that has been evicted is swapped back on the next request and answered in under a second. How many adapters a unit can serve therefore stops being a question about HBM (Table 6).

ActionLatencyWhat the running batch sees
Mount, copy already staged0.13 sBase traffic is unaffected
Mount, first time on this unit0.25 sBase traffic is unaffected; the next mount of it starts at 0.13 s
Unmount0.04 sThe slot falls back to the base model
Request for an evicted adapter0.74–0.80 s end to endServed, not rejected

Table 6. Online mount, unmount and swap-in, measured on a decode unit under background traffic. Latency is the end-to-end HTTP call; the right-hand column is what the other requests experience.

In a burst of seventeen distinct adapters against sixteen planes, all seventeen requests completed — the last one waits for a plane instead of failing. A restart does not reset the clock either: the first mount of an adapter costs the same 0.25 s as any later one, because what a mount computes once is kept. Across all of it the running batch sees no dropped request.

Conclusion

On DeepSeek-V4.1-Flash, we confine LoRA to the decoder and freeze the encoder and the layer-20 KV-writing projections. This keeps persistent global KV valid across adapter switches and lets requests using different adapters share cached prefixes. Adapter-free prefill can serve multiple decode instances, so the two pools can scale independently. Fed-tail rebuilds the adapter-specific sliding-window state in the existing decode verification graph, avoiding the scheduling bubbles of a separate replay pass.

On decode, FusedMoL makes the adapter a per-token attribute: each token names its slot, and the low-rank update is computed where it is consumed. The rewritten path cuts LoRA kernel nodes per decoder layer from 38 to seven, and preallocated planes at fixed addresses let adapters come and go on the same graph.

On one 1P:1D unit, the 3,074-request replay — a LoRA named on every request, chosen without regard to its content — holds the 1,000 RPM target, and completion throughput stays level with the same stack serving base traffic only. Adapters mount in 0.13–0.25 s and unmount in 0.04 s, and an adapter that has been evicted comes back in under a second: capacity follows storage rather than HBM.

Limitations and next steps

At high concurrency, sixteen simultaneously live planes cost 11–13% of step time against a single adapter. The profiler puts it down to thread blocks reading sixteen distinct weight planes through an L2 that cannot hold them, on top of an expert set that is fully live at that batch size.

Capacity now follows disk, with two specific limits. The first mount of an adapter on a unit requires a one-time build; when the active set substantially exceeds sixteen adapters, frequent swaps increase storage traffic. The step after this is to let a session move between adapters mid-conversation and keep every step at this cost.

Acknowledgments

We built our serving stack on the open-source implementation in SGLang and on DeepSeek’s DeepInfer project. We thank the contributors to both projects for their work and the SGLang and DeepInfer communities for their support.

References

[5] Punica: Multi-Tenant LoRA Serving (Chen et al, 2023)

[16] Perf: deepseek-v4.1: Feed encoder-only decode tails through DSpark verify steps (sgl-project/sglang #46727, closed as a stale draft)

[18] Feat: Run encoder SWA bounded replay on PD prefill workers (sgl-project/sglang #44952, merged)

Authors

Mind Lab

Core Contributors

Smith Li, Song Cao, Yuhua Zhou, Kieran Liu, Adrian Zhou, Andrew Chen, Pony Ma

Team

Amy Chen, Jingwei Cao, Song Cao, Andrew Chen, Kaijie Chen, Cleon Cheng, Steven Chiang, Hera Feng, Jun Gao, Vincent He, Nolan Ho, Ori Hong, Xinyu Hu, Bruce Jin, Fancy Kong, Wynn Koo, Andrew Lei, Junjie Li, Lucian Li, Miles Li, Smith Li, Theo Li, Wish Liao, Kieran Liu, Lawrence Liu, Ryan Liu, Yuxin Lu, Nemo Lv, Pony Ma, Minyu, Peixuan, Taotao Qian, Luozheng Qin, Aiden Tang, Nolan Weng, Jinxiang Xie, Bosong Yang, Rio Yang, Regis Ye, Young Ye, Albert Yin, Josh Ying, Atlas Zeng, Martin Zeng, Anya Zhang, Harry Zhang, Jason Zhang, Dewu Zheng, Adrian Zhou, Yuhua Zhou, Juno Zhu, Yuhan Zhu and Mindverse Team

Names are listed alphabetically within team.

Citation

@misc{li2026ced_zero_cost_mol,
  author       = {Smith Li and Song Cao and Yuhua Zhou and Kieran Liu and Adrian Zhou and Andrew Chen and Pony Ma and {Mind Lab}},
  title        = {Toward Zero-Cost Scaling of Multi-LoRA Serving on Causal Encoder–Decoder Models},
  year         = {2026},
  howpublished = {Mind Lab: A Lab for Experiential Intelligence},
  note         = {https://macaron.im/mindlab/research/toward-zero-cost-scaling-of-multi-lora-serving-on-causal-encoder-decoder-models},
}