mlsanityData to 7 Oct 2026

XGrammar-2: Dynamic and Efficient Structured Generation Engine for Agentic LLMs

arXiv 2601.04426 ↗First posted 7 Jan 2026cs.AIcited by 6

On the map: LLM agents and tool use → Software engineering coding agents

Abstract (arXiv)

Modern LLM agents increasingly rely on dynamic structured generation, such as tool calling and response protocols. Unlike traditional structured generation with static structures, these workloads vary both across requests and within a request, posing new challenges to existing engines. We present XGrammar-2, a structured generation engine for dynamic agentic workloads. Our design is based on two key ideas: first-class support for tag-triggered structure switching, and fine-grained reuse across requests with different output structures. Concretely, XGrammar-2 introduces TagDispatch for dynamic structural dispatching and Cross-Grammar Cache for substructure-level cache reuse across grammars. It further improves efficiency with an Earley-based adaptive token mask cache, just-in-time compilation, and repetition state compression. Experiments show that XGrammar-2 achieves over 6x faster compilation than prior structured generation engines, and incurs near-zero end-to-end overhead in modern LLM serving systems.

Key facts. Cited by 6 papers in the map (data through 7 Oct 2026). Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use. Builds on 13 of its 43 references that are in the map. First posted on arXiv 7 Jan 2026.

Builds on

13 of 43 references.

References · 13

  1. 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,767
  2. 2023Generative Agents: Interactive Simulacra of Human Behaviorcited by 3,500
  3. 2023Code Llama: Open Foundation Models for Codecited by 2,105
  4. 2021PICARD: Parsing Incrementally for Constrained Auto-Regressive Decoding from Language Modelscited by 402
  5. 2025FlashInfer: Efficient and Customizable Attention Engine for LLM Inference Servingcited by 248
  6. 2022Synchromesh: Reliable code generation from pre-trained language modelscited by 156
  7. 2024XGrammar: Flexible and Efficient Structured Generation Engine for Large Language Modelscited by 73
  8. 2023Grammar Prompting for Domain-Specific Language Generation with Large Language Modelscited by 58
  9. 2022Validating Large Language Models with ReLMcited by 33
  10. 2025CONFETTI: Conversational Function-Calling Evaluation Through Turn-Level Interactionscited by 16
  11. 2023Efficient Semiring-Weighted Earley Parsingcited by 3
  12. 2020Directed Graph Hashingcited by 2
1 more
  1. 2025WGRAMMAR: Leverage Prior Knowledge to Accelerate Structured Decodingcited by 2

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 6.

6 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2026A Policy-Driven Runtime Layer for Agentic LLM Serving
  2. 2026Efficient LLM Serving for Agentic Workflows: A Data Systems Perspective
  3. 2026AgentPerfBench: A Benchmarking and Evaluation Suite for Inference Performance of Agentic LLMs
  4. 2026From Static Templates to Dynamic Runtime Graphs: A Survey of Workflow Optimization for LLM Agents
  5. 2026Agentic Compilation: Mitigating the LLM Rerun Crisis for Minimized-Inference-Cost Web Automation
  6. 2026TokenDance: Scaling Multi-Agent LLM Serving via Collective KV Cache Sharing
  7. 2026Sutradhara: An Intelligent Orchestrator-Engine Co-design for Tool-based Agentic Inference
  8. 2026Pythia: Exploiting Workflow Predictability for Efficient Agent-Native LLM Serving