---
id: 20261125-T0-06
title: "Grammar-as-a-Draft：让投机解码草稿模型看懂语法约束，结构化输出每步多出token"
title_en: "Grammar-as-a-Draft Boosts Tokens per Speculative Decoding Step on Structured Outputs"
url: https://ai.daily.yangsir.net/daily/20261125-T0-06
issue_date: 2026-11-25
publish_date: 2026-11-24T05:00:00.000Z
category: research
source_name: "arXiv cs.CL (NLP)"
source_url: https://arxiv.org/abs/2611.28349
---

# Grammar-as-a-Draft：让投机解码草稿模型看懂语法约束，结构化输出每步多出token

arXiv论文针对结构化输出场景（JSON schema、正则、工具调用）提出Grammar-as-a-Draft方法。现有投机解码的草稿模型看不到语法约束，会反复提出非法的键名、分隔符和缩进，而语法引擎其实已经知道下一个token必须是什么。该方法让语法信息参与草稿生成，使草稿更符合约束，从而在每次投机解码步骤中产出更多有效token。对依赖JSON输出的工具调用和API场景，这意味着更低的解码延迟。

## English Version

**Grammar-as-a-Draft Boosts Tokens per Speculative Decoding Step on Structured Outputs**

A new arXiv paper proposes Grammar-as-a-Draft for structured outputs such as JSON schemas, regexes, and tool calls. Existing speculative decoding drafters do not see grammar constraints and repeatedly propose invalid keys, delimiters, and indentation, even though the grammar engine already knows which tokens must come next. The method feeds grammar information into draft generation so drafts conform to constraints, yielding more valid tokens per speculative decoding step. For tool-calling and API scenarios that depend on JSON output, this translates into lower decoding latency.

---

**来源**：[arXiv cs.CL (NLP)](https://arxiv.org/abs/2611.28349)

**详情页**：https://ai.daily.yangsir.net/daily/20261125-T0-06

---

*智语观潮 · Daily — https://ai.daily.yangsir.net/llms.txt*