paper-with-me

홈 › Papers

RelayAttention for Efficient Large Language Model Serving with Long System Prompts

2024-02-22 · Lei Zhu, Xinjiang Wang, Wayne Zhang, Rynson W. H. Lau

A practical large language model (LLM) service may involve a long system prompt, which specifies the instructions, examples, and knowledge documents of the task and is reused across requests. However, the long system prompt causes throughput/latency bottlenecks as the cost of generating the next token grows w.r.t. the sequence length. This paper aims to improve the efficiency of LLM services that involve long system prompts. Our key observation is that handling these system prompts requires heavily redundant memory accesses in existing causal attention computation algorithms. Specifically, for batched requests, the cached hidden states (\ie, key-value pairs) of system prompts are transferred from off-chip DRAM to on-chip SRAM multiple times, each corresponding to an individual request. To eliminate such a redundancy, we propose RelayAttention, an attention algorithm that allows reading these hidden states from DRAM exactly once for a batch of input tokens. RelayAttention is a free lunch: it maintains the generation quality while requiring no model retraining, as it is based on a mathematical reformulation of causal attention. We have observed significant performance improvements to a production-level system, vLLM, through integration with RelayAttention. The improvements are even more profound with longer system prompts.

📄 PDF Abstract BibTeX arXiv:2402.14808

Code (1)

rayleizhu/vllm-ra 공식 구현 pytorch

Tasks

Language ModelingLanguage ModellingLarge Language Model

Methods 이 논문이 사용한 방법론

Golden Queue Managers 설명 없음

Similar Papers 제목 키워드 기반

Benchmarking KV-Cache Optimizations across Task Quality and System Performance for Long-Context Serving

2026-05-03 · Nikita Agrawal, Ruben Mayer arxiv

Large language model serving is increasingly limited by KV-cache growth under long-context workloads, yet existing KV-cache compression techniques are difficult to compare because they were evaluated on different models,…

Few-Shot Learning

Conveyor: Efficient Tool-aware LLM Serving with Tool Partial Execution

2024-05-29 · Yechen Xu, Xinhao Kong, Tingjun Chen, Danyang Zhuo

The complexity of large language model (LLM) serving workloads has substantially increased due to the integration with external tool invocations, such as ChatGPT plugins. In this paper, we identify a new opportunity for …

Language ModelingLanguage ModellingLarge Language Model

Stateful Large Language Model Serving with Pensieve

2023-12-09 · Lingfan Yu, JinKun Lin, Jinyang Li

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 m…

CPUGPULanguage ModelingLanguage Modelling+2

A Universal Load Balancing Principle and Its Application to Large Language Model Serving

2026-01-25 · Zixi Chen, Tianci Bu, Chendong Song, Xin Lu 외 arxiv

Over 40% of computational power in Large Language Model (LLM) serving systems can be systematically wasted - not from hardware limits, but from load imbalance in barrier-synchronized parallel processing. When progress is…

The CAP Principle for LLM Serving: A Survey of Long-Context Large Language Model Serving

2024-05-18 · Pai Zeng, Zhenyu Ning, Jieru Zhao, Weihao Cui 외

We survey the large language model (LLM) serving area to understand the intricate dynamics between cost-efficiency and accuracy, which is magnified by the growing need for longer contextual understanding when deploying m…

Language ModelingLanguage ModellingLarge Language ModelSurvey