MORTIS: Compiler-Guided KV-Cache Management for LLM Agent Programs
Xiaoyu Ma, Jayanaka L. Dantanarayana, Savini Kashmira, Baichuan Li, Lingjia Tang, Jason Mars
Key points
From the paper's conclusion- We present MORTIS, a compiler-serving co-design that combines this analysis with runtime observations to improve KV-cache management.
Abstract
Existing agent serving systems divide each prompt into a reusable prefix and an opaque suffix, managing the KV-cache at this coarse granularity without distinguishing the components within each part. We observe that prompt components differ in which LLM calls share their values and how long those values remain reusable, a property we term intra-prompt heterogeneity. Our key insight is that, in frameworks that generate prompts from typed LLM function calls, these components correspond to program variables, allowing compiler analysis to recover their sharing patterns and lifetimes. We present MORTIS, a compiler-serving co-design that combines this analysis with runtime observations to improve KV-cache management. MORTIS reorders prompt components to expose additional prefix reuse and uses their predicted reuse and lifetimes to guide cache retention, eviction, and prefetching. Our evaluation shows that MORTIS achieves up to 1.99x job completion time (JCT) speedup and 1.97x throughput improvement over SGLang, with geometric-mean speedups of 1.45x and 1.49x, respectively.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Evolving Infra: Agent-Adaptive LLM Serving at ScalearXiv · 2026
- KV-Repurpose: A Testbed for Evaluating Non-Prefix KV-Cache ReusearXiv · 2026
- EfficientAgent: What Makes KV Cache Offloading Work for Concurrent Agents?arXiv · 2026
- TripleKV: Predict, Prefetch, Protect -- KV Cache Management for AI AgentsarXiv · 2026
- Contexture: Runtime Context Eviction for High-Throughput Agent ServingarXiv · 2026
- Callo: Serving Cache-Miss Requests with Speculative Decoding on Invalidated KV under Prefill-Decode DisaggregationarXiv · 2026