跳到正文
arXiv cs.AI· Alessandro Previti, Konstantinos Vandikas, Mario Alviano, Mats Carlsson, Albin Larsson Forsberg, Alexandros Nikou, Athanasios Karapantelakis, Aneta Vulgarakis·· 1 天前AI 评分34

面向大语言模型的规范引导生成框架

Specification-Guided Generation for Large Language Models

AI 导读

研究者提出一种神经符号的规范引导解码框架,将 LLM 生成与符号推理结合,每步过滤掉无法扩展为满足规范输出的取值。前向变体按构造保证规范满足,相比拒绝采样减少重复 LLM 推理,仅带来少量符号推理开销;回溯变体则进一步减少模型被迫选择其自判不合适取值的情况。该框架与模型无关、无需重训练,基于现有语法约束解码机制。

正文 · 原文

View PDF HTML (experimental)

Abstract:Large language models (LLMs) can generate structured outputs, but existing constrained-decoding methods mainly enforce syntax and cannot directly enforce satisfaction of a formal specification. We introduce a neuro-symbolic, specification-guided decoding framework that combines LLM generation with symbolic reasoning. At each step, the framework refines the decoding grammar by filtering out values that cannot be extended to an output satisfying the specification. We present a forward-only variant that guarantees specification satisfaction by construction, and a backtracking variant that revises earlier feasible choices when their downstream consequences leave only values that the LLM itself judges unsuitable. The framework is model-agnostic, requires no retraining, and builds on existing grammar-constrained decoding mechanisms. Experiments on configuration and constraint-solving benchmarks show that the forward-only variant reliably produces specification-compliant outputs while reducing repeated LLM inference compared with rejection sampling and incurring modest symbolic-reasoning overhead. The backtracking variant further reduces cases in which the model is forced to select values that it has itself judged unsuitable, thereby substantially improving adherence to the LLM's stated interpretation of the prompt.
Subjects: Artificial Intelligence (cs.AI)
Cite as: arXiv:2610.41511 [cs.AI]
  (or arXiv:2610.41511v2 [cs.AI] for this version)
  https://doi.org/10.48550/arXiv.2610.41511

arXiv-issued DOI via DataCite

Submission history

From: Alessandro Previti [view email]
[v1] Fri, 30 Oct 2026 10:01:25 UTC (59 KB)
[v2] Mon, 2 Nov 2026 11:15:06 UTC (59 KB)

来源:arXiv cs.AI · arxiv.org