arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2606.00722cs.CLcs.AI
收藏

EPIC: 扩散语言模型在上下文无关文法约束下的高效并行推理

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

Yonsei University(延世大学)

Hyundong Jin, Yo-Sub Han

AI总结:

提出EPIC框架,通过词法记忆化、Earley解析验证和松弛兼容子集选择,解决扩散语言模型在CFG约束解码中的低效和并行性损失问题,推理时间降低67.5%,额外开销减少90.5%。

摘要:

控制语言模型输出对于确保结构有效性、可靠性和下游可用性至关重要,扩散语言模型也不例外。最近扩散语言模型解码的进展已将输出控制从常规约束扩展到上下文无关文法(CFG)约束。然而,现有方法的速度可能比无约束解码慢四倍。更重要的是,它们大大削弱了扩散语言模型相对于自回归模型的关键优势之一,即并行解码。这种减慢是因为在并行生成过程中,顺序有效性检查引入了显著开销。我们提出了一个高效的CFG约束解码框架EPIC,解决了这一限制。我们的方法通过结合词法记忆化、使用Earley风格解析(而非确定性自动机)进行验证,以及用于并行提交的松弛兼容子集选择,提高了解码效率。它减少了重复的词法分析和验证开销,同时允许多个兼容令牌一起提交。在三个基准测试上使用四个模型的实验表明,与现有的CFG约束解码方法相比,我们的方法将推理时间减少了高达67.5%,并将额外开销降低了高达90.5%。我们的实现可在https://github.com/hyundong98/EPIC-Decoding.git获取。

英文摘要:

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. However, the prior CFG-constrained decoder can be up to four times slower than unconstrained decoding, forcing a trade-off between the correctness benefits of CFG constraints and the decoding efficiency of diffusion models. A key source of this overhead is sequential validity checking, which limits parallel token commitment and adds repeated validation costs. We propose EPIC, a CFG-constrained decoding framework designed to improve this efficiency-correctness trade-off. In order to reduce decoding overhead without sacrificing syntactic correctness, EPIC combines lexing memoization, relaxed compatible subset selection for parallel commit, and validation using Earley-style parsing instead of deterministic automata. This design enables multiple compatible tokens to be committed together while avoiding repeated lexing and expensive validation. Experiments on three benchmarks using four models show that EPIC improves the efficiency-correctness trade-off, bringing runtime close to unconstrained levels while maintaining comparable syntactic and functional correctness. Relative to the prior CFG-constrained decoder, EPIC achieves a best-case inference-time reduction of 67.2%. Our implementation is available at https://github.com/hyundong98/EPIC-Decoding .

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑