Papers › SGLang: Efficient Execution of Structured Language Model Programs

SGLang: Efficient Execution of Structured Language Model Programs

12 Dec 2023arXiv:2312.07104archive 2025-07-28

Lianmin Zheng, Liangsheng Yin, Zhiqiang Xie, Chuyue Sun, Jeff Huang, Cody Hao Yu, Shiyi Cao, Christos Kozyrakis, Ion Stoica, Joseph E. Gonzalez, Clark Barrett, Ying Sheng

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

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2312.07104")

Code

Syntology Ran 9 of 17 code samples harvested from 2 repositories linked to this paper; 8 have no recorded run. Of those that ran: 2 ran · honoured contract; 6 ran · our draft was wrong; 1 ran · fixture could not drive it.

By repository: official repository: 7 samples from 1 repository, 7 ran; community (archive-listed): 10 samples from 1 repository, 2 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

sgl-project/sglang officialmentioned in papermentioned on GitHubpytorch report
tginart/sglang mentioned on GitHubpytorchApache-2.0 report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

17 samples harvested; 9 ran; 2 honoured the contract we drafted; 8 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

2ran · honoured contract
6ran · our draft was wrong
1ran · fixture could not drive it
8unverified

Licence: 0 of the 17 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 2 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

attention_pytorch sgl-project/sglang/benchmark/kernels/attention/bench_flash_attention_fp8.py official repository ran · fixture could not drive it fingerprinted Apache-2.0 (permissive) · 4afe00a5853d633f · report
efficiency sgl-project/sglang/benchmark/kernels/attention/bench_flash_attention_fp8.py official repository ran · honoured contract fingerprinted Apache-2.0 (permissive) · f29cb637db3ec374 · report
first_image_from_body sgl-project/sglang/docs/scripts/update_lmsys_sglang_blogs.py official repository ran · our draft was wrong fingerprinted Apache-2.0 (permissive) · 50162116dff0fb49 · report
flops sgl-project/sglang/benchmark/kernels/attention/bench_flash_attention_fp8.py official repository ran · honoured contract fingerprinted Apache-2.0 (permissive) · e73bdfbda28da341 · report
split_checkpoint_files sgl-project/sglang/examples/checkpoint_engine/update.py official repository ran · our draft was wrong Apache-2.0 (permissive) · ae700d7ba09b1dad · report
split_frontmatter sgl-project/sglang/docs/scripts/update_lmsys_sglang_blogs.py official repository ran · our draft was wrong fingerprinted Apache-2.0 (permissive) · ccf4f09d98748ede · report
to_absolute_url sgl-project/sglang/docs/scripts/update_lmsys_sglang_blogs.py official repository ran · our draft was wrong fingerprinted Apache-2.0 (permissive) · 89728bc22a4636de · report
format_example tginart/sglang/benchmark/mmlu/bench_sglang.py community (archive-listed) ran · our draft was wrong Apache-2.0 (permissive) · cd763eaf1ac287e7 · report
format_subject tginart/sglang/benchmark/mmlu/bench_sglang.py community (archive-listed) ran · our draft was wrong fingerprinted Apache-2.0 (permissive) · 6ab745408cb8648b · report
contains_formats tginart/sglang/benchmark/json_schema/bench_sglang.py community (archive-listed) unverified Apache-2.0 (permissive) · c35d5a367cb5def6 · report
convert_dataset tginart/sglang/benchmark/json_schema/bench_sglang.py community (archive-listed) unverified Apache-2.0 (permissive) · abf01e5c788687e5 · report
gen_prompt tginart/sglang/benchmark/mmlu/bench_sglang.py community (archive-listed) unverified Apache-2.0 (permissive) · c7131fbea2cbdc2d · report
get_answer_value tginart/sglang/benchmark/gsm8k/bench_sglang.py community (archive-listed) unverified Apache-2.0 (permissive) · 4c13c3bdb761b46c · report
get_few_shot_examples tginart/sglang/benchmark/gsm8k/bench_sglang.py community (archive-listed) unverified Apache-2.0 (permissive) · 9e0d3df1a2d9a123 · report
get_few_shot_examples tginart/sglang/benchmark/hellaswag/bench_sglang.py community (archive-listed) unverified Apache-2.0 (permissive) · 06681001174b0ca9 · report
get_one_example tginart/sglang/benchmark/gsm8k/bench_sglang.py community (archive-listed) unverified Apache-2.0 (permissive) · 2e994f473fac61f9 · report
get_one_example tginart/sglang/benchmark/hellaswag/bench_sglang.py community (archive-listed) unverified Apache-2.0 (permissive) · 5b4a33e73835b337 · report

Tasks

Few-Shot LearningLanguage ModelingLanguage ModellingLogical ReasoningRetrievalRetrieval-augmented Generationmodel

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

SPEED

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections