English

Stateful Large Language Model Serving with Pensieve

Machine Learning 2024-10-08 v3 Distributed, Parallel, and Cluster Computing

Abstract

Large Language Models (LLMs) are wildly popular today and it is important to serve them efficiently. Existing LLM serving systems are stateless across requests. Consequently, when LLMs are used in the common setting of multi-turn conversations, a growing log of the conversation history must be processed alongside any request by the serving system at each turn, resulting in repeated processing. In this paper, we design PensievePensieve, a system optimized for multi-turn conversation LLM serving. PensievePensieve maintains the conversation state across requests by caching previously processed history to avoid duplicate processing. PensievePensieve's multi-tier caching strategy can utilize both GPU and CPU memory to efficiently store and retrieve cached data. PensievePensieve also generalizes the recent PagedAttention kernel to support attention between multiple input tokens with a GPU cache spread over non-contiguous memory. Our evaluation shows that PensievePensieve can achieve 1.141.14-3.0×3.0\times the throughput of vLLM and TensorRT-LLM and significantly reduce latency.

Keywords

Cite

@article{arxiv.2312.05516,
  title  = {Stateful Large Language Model Serving with Pensieve},
  author = {Lingfan Yu and Jinkun Lin and Jinyang Li},
  journal= {arXiv preprint arXiv:2312.05516},
  year   = {2024}
}
R2 v1 2026-06-28T13:45:48.118Z