What serving optimizations must preserve: request-adaptive hybrid layouts, coded prompt caches and batch-invariant kernels
Three papers posted on 2026-10-27 each optimize a different layer of LLM serving: the per-request layout of a hybrid attention and state space model, the stored form of a prompt's KV cache, and the GPU kernels that agents now write. Each also has to preserve something the optimization could break, whether batching efficiency and prefix reuse, the model's answers under compression, or bitwise reproducibility under dynamic batching.
Choosing the hybrid layout per request
Hybrid LLMs combine attention layers with state space model (SSM) layers to pair the modeling capability of attention with the efficiency of SSMs. Request-Adaptive Execution for Efficient Hybrid LLM Inference, by Fahao Chen, Xuzhe Yan, Qi Zhang, Peng Li, Dongxiao Yu and Song Guo, argues that most hybrid models still inherit a static design: once the attention-to-SSM layout is chosen, every request follows the same hybrid execution, even though real serving workloads rely on contextual information in different ways.
Their serving system, Morph, co-designs the model architecture and the runtime. Each block pairs an attention layer with an SSM layer, and prefill-oriented gating selects a request-specific layout that remains fixed throughout decoding. Because requests in the same batch may now take different layers, the runtime uses selective batching to preserve batching efficiency and hybrid-aware context caching to keep prefix reuse correct. Across six datasets Morph achieves a better quality-efficiency trade-off than existing static hybrid baselines, and in system-level evaluation it improves serving throughput by up to 3.87 times while substantially reducing inference latency.
Coding the prompt cache end to end
In hybrid models only the few full-attention layers keep a KV cache, but that cache is still the part of a prompt's state that grows with the prompt and that must be stored or moved to be reused. DCKV, by Egor Maximov and seven co-authors, is a differentiable codec for that cache and, the authors say, the first KV-cache codec trained end to end. Its transform, its quantizer and its entropy models, which are conditioned on the prompt tokens and on already decoded neighboring positions, are optimized together against the frozen language model, both for the code length the entropy models assign and for the change in the model's output.
On a 2-billion-parameter model, DCKV stores a compressed token in more than 55 times fewer bytes than bf16 at a loss of at most 1.8 points on three long-context benchmarks, and in more than 100 times fewer bytes at a loss of at most 3.6 points. Because the training objective includes the change in the model's output, compression is traded directly against what the model would answer.
Batch invariance as an acceptance gate
Serving systems batch user requests dynamically, so the same request may be processed alongside different requests from one run to the next. God Does Not Play Dice, by Youwei Bao, Chengpeng Wang and Simin Chen, points out that if GPU kernels lack batch invariance, the changing batch context can alter the numerical output for an unchanged input and undermine reproducibility. Kernel generation agents focus on correctness and efficiency and overlook this property: the authors find 19 confirmed batch-invariance violations among 83 batch-applicable released artifacts.
Their tool combines contract-guided static dependency analysis with dynamic validation of bitwise consistency across batch contexts. It plugs into general kernel agents as successive acceptance gates in the optimization loop, rejecting structurally risky or dynamically non-invariant candidates before performance benchmarking and returning feedback to the agent. Across three agent frameworks, under baseline and batch-invariance-aware generation on real-world LLM serving tasks, it raises the batch-invariance pass rate from 67.6 percent to 91.9 percent while retaining 91.8 percent of the baseline geometric-mean speedup.
Optimization with an invariant attached
Each paper pairs a speedup with an explicit invariant. Morph lets layouts diverge per request but has to keep batches efficient and cached prefixes correct. DCKV compresses aggressively but counts the cost in the model's outputs, not only in bytes. The batch-invariance work accepts a generated kernel only if its output for a given input is bitwise identical whatever else is in the batch. As serving stacks add request-adaptive execution, learned compression and machine-written kernels, these invariants become part of the specification rather than an afterthought.
For teams that operate inference infrastructure, the consequences are concrete:
- Plan for per-request execution paths: Request-adaptive hybrids need batching and prefix caching that understand layout choices; Morph's need for hybrid-aware context caching signals that ordinary prefix reuse cannot simply be assumed correct.
- Judge prompt-state compression by its effect on answers: When prompt caches are stored or moved for reuse, evaluate compression on downstream benchmarks, as DCKV does, not only on bytes saved.
- Gate generated kernels on reproducibility: Add bitwise batch-invariance checks to agent-driven kernel optimization, alongside correctness and speed, before kernels reach production.
Limits of the evidence
Morph's 3.87 times figure is a best case across the authors' baselines, and its quality-efficiency comparison is against static hybrids. DCKV's results are reported on one 2-billion-parameter model and three long-context benchmarks. The batch-invariance study covers three agent frameworks and 83 released artifacts. None of the three has yet been independently replicated.
Sources
- Request-Adaptive Execution for Efficient Hybrid LLM Inference · arXiv · 2026-10-27
- DCKV: Learned Transform Coding of the Prompt KV Cache in Hybrid Language Models · arXiv · 2026-10-27
- God Does Not Play Dice: Enforcing Batch Invariance in Agentic Kernel Generation · arXiv · 2026-10-27