AIPLDec 12, 2023

SGLang: Efficient Execution of Structured Language Model Programs

arXiv:2312.07104v2916 citationsh-index: 39Has CodeNIPS
Originality Highly original
AI Analysis

This addresses the need for efficient systems to run advanced LLM applications, such as agent control and structured decoding, though it is incremental as it builds on existing inference methods.

The authors tackled the problem of inefficient execution of complex language model programs by introducing SGLang, a system with a frontend language and runtime optimizations, achieving up to 6.4x higher throughput compared to state-of-the-art inference systems.

Large language models (LLMs) are increasingly used for complex tasks that require multiple generation calls, advanced prompting techniques, control flow, and structured inputs/outputs. However, efficient systems are lacking for programming and executing these applications. We introduce SGLang, a system for efficient execution of complex language model programs. SGLang consists of a frontend language and a runtime. The frontend simplifies programming with primitives for generation and parallelism control. The runtime accelerates execution with novel optimizations like RadixAttention for KV cache reuse and compressed finite state machines for faster structured output decoding. Experiments show that SGLang achieves up to 6.4x higher throughput compared to state-of-the-art inference systems on various large language and multi-modal models on tasks including agent control, logical reasoning, few-shot learning benchmarks, JSON decoding, retrieval-augmented generation pipelines, and multi-turn chat. The code is publicly available at https://github.com/sgl-project/sglang

Code Implementations2 repos
Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes