arXiv:2606.00722cs.CLcs.AI2026-06

提出EPIC框架,让扩散语言模型在语法约束下实现高效并行推理。

EPIC: Efficient and Parallel Inference under CFG Constraints for Diffusion Language Models

论文配图:EPIC: Efficient and Parallel Inference under CFG Constraints for Diffusion Language Models
图 1 · 摘自论文原文
  • 通过词法记忆化与埃里希解析加速验证,减少重复计算
  • 支持多个兼容词元并行提交,推理速度提升67.5%
  • 适合需语法正确性的生成任务,如代码或结构化文本

控制语言模型输出对保证结构有效性、可靠性及下游可用性至关重要,扩散语言模型也不例外。近期扩散语言模型解码技术已将输出控制扩展至上下文无关文法(CFG)约束。然而,现有方法比无约束解码慢达4倍,且严重削弱了扩散模型相比自回归模型的核心优势——并行解码能力。该延迟源于序列有效性检查在并行生成中引入的显著开销。本文提出高效CFG约束解码框架EPIC,通过词法记忆化、基于埃里希风格解析的验证以及松弛的兼容子集选择实现并行提交,降低重复词法分析与验证开销。在三个基准数据集上使用四种模型的实验表明,与现有方法相比,本方法将推理时间减少高达67.5%,额外开销降低最多达90.5%。代码已开源:https://github.com/hyundong98/EPIC-Decoding.git。

原文摘要 · Abstract (English)

Controlling language model outputs is essential for ensuring structural validity, reliability, and downstream usability, and diffusion language models are no exception. Recent advances in diffusion language model decoding have extended output control beyond regular constraints to context-free grammar (CFG) constraints. Existing methods, however, can be up to four times slower than unconstrained decoding. More importantly, they substantially diminish one of the key advantages of diffusion language models over autoregressive models, namely parallel decoding. This slowdown arises because sequential validity checking introduces significant overhead during parallel generation. We propose an efficient CFG-constrained decoding framework, EPIC, that addresses this limitation. Our method improves decoding efficiency by combining lexing memoization, validation using Earley-style parsing instead of deterministic automata, and relaxed compatible subset selection for parallel commit. It reduces repeated lexing and validation overhead while allowing multiple compatible tokens to be committed together. Experiments on three benchmarks using four models show that our method reduces inference time by up to 67.5% and decreases the additional overhead by up to 90.5% compared with existing CFG-constrained decoding methods. Our implementation is available at https://github.com/hyundong98/EPIC-Decoding.git .

扩散模型语法约束并行推理语言生成

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。