arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2503.01804cs.CLcs.AIcs.LG
收藏

SEM-CTRL:语义控制解码

$\texttt{SEM-CTRL}$: Semantically Controlled Decoding

Mohammad Albinhassan, Pranava Madhyastha, Alessandra Russo

AI总结:

本文提出SEM-CTRL,通过集成基于答案集语法的约束,使LLM在不微调的情况下保证输出的语法和语义正确性,实验显示其在多种任务中优于现有模型。

摘要:

本文提出SEM-CTRL,通过集成基于答案集语法的约束,使LLM在不微调的情况下保证输出的语法和语义正确性,实验显示其在多种任务中优于现有模型。

英文摘要:

Ensuring both syntactic and semantic correctness in Large Language Model (LLM) outputs remains a significant challenge, despite being critical for real-world deployment. In this paper, we introduce $\texttt{SEM-CTRL}$, a unified approach that allows for enforcing rich context-sensitive constraints, and task and instance specific semantics directly on the LLM decoder. Our approach integrates token-level MCTS which is guided by specific syntactic and semantic constraints. The constraints over desired outputs are expressed using Answer Set Grammars, which is a logic-based formalism that generalizes context sensitive grammars while incorporating background knowledge to represent task-specific semantics. We show that our approach helps guarantee valid completions for any off-the-shelf LLM without the need for fine-tuning. We evaluate $\texttt{SEM-CTRL}$ on a range of tasks, including synthetic grammar synthesis, combinatorial reasoning, JSON parsing, and planning. Our experimental results demonstrate that $\texttt{SEM-CTRL}$ allows even small pre-trained LLMs to efficiently outperform larger variants and state-of-the-art reasoning models (e.g., $\textit{o4-mini}$) while simultaneously guaranteeing semantic validity.

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

↑