Large language models can generate plausible code, but remain brittle for formal verification in proof assistants such as Lean. A central scalability challenge is that verified synthesis requires consistent artifacts across several coupled domains: executable code, formal specifications, theorem statements, and proof attempts. Existing approaches often treat these artifacts separately. We present BRIDGE, a structured prompting framework for multi-artifact program synthesis. BRIDGE decomposes generation into three interconnected domains: Code, Specification, and Theorem/Proof, and uses domain-specific intermediate reasoning to connect them. In Lean, BRIDGE often follows a code-first workflow, using the generated implementation as a semantic anchor for downstream specification, theorem statement, and proof-attempt generation. Across 178 algorithmic problems and five LLMs, BRIDGE improves Lean executable correctness by up to nearly 1.5x over direct prompting and can be roughly 2x more sample efficient at comparable generation lengths. We further find that specification-oriented prompting improves Python pass rates by up to 17.5 percentage points. Beyond inference-time prompting, supervised fine-tuning on BRIDGE-style reasoning traces yields nearly 1.5x higher Lean pass success than code-only fine-tuning, suggesting that these intermediate representations provide a learnable inductive bias. BRIDGE provides a practical framework for scaling verified synthesis while highlighting the remaining gap between executable correctness and full formal proof generation.


翻译:大型语言模型可以生成看似合理的代码,但在Lean等证明助手中进行形式验证时仍显脆弱。一个核心的可扩展性挑战在于,经过验证的合成需要跨多个耦合领域保持一致的制品:可执行代码、形式规约、定理陈述以及证明尝试。现有方法通常将这些制品分开处理。我们提出BRIDGE,一个用于多制品程序合成的结构化提示框架。BRIDGE将生成过程分解为三个相互关联的领域:代码、规约以及定理/证明,并使用领域特定的中间推理将它们连接起来。在Lean中,BRIDGE通常遵循代码优先的工作流程,将生成的实现作为下游规约、定理陈述和证明尝试生成的语义锚点。在178个算法问题和五个大型语言模型上,相较于直接提示,BRIDGE将Lean可执行代码的正确性提升了近1.5倍,并且在相似生成长度下,样本效率可提升约2倍。我们进一步发现,面向规约的提示使Python通过率最多提升17.5个百分点。除了推理时的提示之外,在BRIDGE风格的推理轨迹上进行监督微调,相比仅基于代码的微调,Lean测试通过率提高了近1.5倍,表明这些中间表示提供了一种可学习的归纳偏置。BRIDGE为扩展验证合成提供了实用框架,同时凸显了可执行代码正确性与完整形式证明生成之间尚存的差距。

0
下载
关闭预览

相关内容

高阶网络的表示:基于图的框架综述
专知会员服务
16+阅读 · 5月14日
《大语言模型的数据合成与增强综述》
专知会员服务
44+阅读 · 2024年10月19日
用模型不确定性理解模型
论智
11+阅读 · 2018年9月5日
特征工程的特征理解(一)
机器学习研究会
10+阅读 · 2017年10月23日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
VIP会员
最新内容
学习数据的几何:形状空间分析数学综述
专知会员服务
7+阅读 · 6月17日
定向能反无人机系统最新发展动态
专知会员服务
8+阅读 · 6月17日
从燃煤战舰到算法战争:水面指挥的永恒要求
专知会员服务
6+阅读 · 6月17日
相关VIP内容
高阶网络的表示:基于图的框架综述
专知会员服务
16+阅读 · 5月14日
《大语言模型的数据合成与增强综述》
专知会员服务
44+阅读 · 2024年10月19日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员