一句话:提出投影式解码,在生成中同步维护部分图模型,以可证明方式引导 LLM 产出语义有效结果。
大型语言模型(LLM)已广泛用于生成软件制品,但如何保证其语义有效性仍是难题。现有约束解码技术能强制语法正确、甚至部分语义规则,却缺乏桥接生成文本与语义验证推理的通用表示。本文提出投影式解码(projectional decoding),一种在生成过程中除文本外同时维护部分图模型作为主要制品表示的概念框架。该抽象表示显式捕获不确定性,支持增量语义验证与错误检测,并能以可证明的保证引导生成走向语义有效输出。作者在程序生成任务上给出初步结果,展示该方法提升 LLM 生成制品语义有效性的潜力,并讨论了其在多种软件工程活动中实现可验证自动化的前景。
Large language models (LLMs) are increasingly used to generate software artifacts across many software engineering (SE) tasks, yet ensuring the semantic validity of these artifacts remains a fundamental challenge. Existing constrained decoding techniques can enforce syntactic correctness and, in some cases, specific semantic rules, but lack a general representation that bridges LLM-generated text with the reasoning required for semantic validation in SE. In this paper, we propose projectional decoding, a novel conceptual framework that integrates domain semantics directly into the generation process by maintaining, alongside text, a partial graph model as the primary artifact representation throughout generation. This abstract representation enables incremental semantic validation by explicitly capturing uncertainty and natively supporting error detection, while guiding generation toward semantically valid outputs with provable guarantees. We present preliminary results on a program generation task which demonstrate the potential of this approach to improve the semantic validity of LLM-generated artifacts. We also discuss how projectional decoding can enable verifiable automation with LLMs across various SE activities.