VOOZH about

URL: https://arxiv.org/abs/2312.07104

⇱ [2312.07104] SGLang: Efficient Execution of Structured Language Model Programs


Computer Science > Artificial Intelligence

arXiv:2312.07104 (cs)
[Submitted on 12 Dec 2023 (v1), last revised 6 Jun 2024 (this version, v2)]

Title:SGLang: Efficient Execution of Structured Language Model Programs

View PDF HTML (experimental)
Abstract: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 this https URL
Subjects: Artificial Intelligence (cs.AI); Programming Languages (cs.PL)
Cite as: arXiv:2312.07104 [cs.AI]
(or arXiv:2312.07104v2 [cs.AI] for this version)
https://doi.org/10.48550/arXiv.2312.07104
arXiv-issued DOI via DataCite

Submission history

From: Ying Sheng [view email]
[v1] Tue, 12 Dec 2023 09:34:27 UTC (380 KB)
[v2] Thu, 6 Jun 2024 00:10:06 UTC (804 KB)
Full-text links:

Access Paper:

Current browse context:

cs.AI
< prev   |   next >
Change to browse by:

References & Citations

BibTeX formatted citation

Data provided by:

Bibliographic and Citation Tools

Bibliographic Explorer (What is the Explorer?)
Connected Papers (What is Connected Papers?)
Litmaps (What is Litmaps?)
scite Smart Citations (What are Smart Citations?)

Code, Data and Media Associated with this Article

alphaXiv (What is alphaXiv?)
CatalyzeX Code Finder for Papers (What is CatalyzeX?)
DagsHub (What is DagsHub?)
Gotit.pub (What is GotitPub?)
Hugging Face (What is Huggingface?)
ScienceCast (What is ScienceCast?)

Demos

Replicate (What is Replicate?)
Hugging Face Spaces (What is Spaces?)
TXYZ.AI (What is TXYZ.AI?)

Recommenders and Search Tools

Influence Flower (What are Influence Flowers?)
CORE Recommender (What is CORE?)

arXivLabs: experimental projects with community collaborators

arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.