We propose a novel framework that provides constructive feedback to an LLM in the "guess-and-check" paradigm by formally verifying its own thinking process and detecting local reasoning errors. We apply this framework to the loop invariant synthesis problem. We prompt the model to produce a step-by-step natural language proof justifying its thinking process for the failed verification condition of its generated loop invariants. Then, we use an LLM to translate the reasoning steps into first-order logic implications, which can be checked automatically. An invalid implication pinpoints the exact logical flaw in the LLM's thinking process, which we then use to construct targeted feedback for refinement. We have implemented our approach in a tool called LORIS and evaluated it on a main benchmark suite of 460 C programs and an additional benchmark suite of 50 C programs each of which involves non-linear properties. On the main benchmark suite, LORIS solved 445 of the programs, and achieved an overall success rate of $93.1\%$. LORIS also demonstrates robustness on the challenging non-linear benchmark suite.


翻译:我们提出了一种新颖框架,在“猜测-验证”范式中通过形式化验证LLM自身的思考过程并检测局部推理错误,为其提供建设性反馈。我们将该框架应用于循环不变式综合问题。当LLM生成的循环不变式验证条件失败时,我们提示模型生成逐步的自然语言证明以阐释其思考过程。随后,利用LLM将这些推理步骤转化为一阶逻辑蕴含式,并由自动化工具进行验证。若蕴含式无效,即可精确定位LLM思维过程中的逻辑缺陷,我们据此构建针对性反馈以优化生成结果。该方案已在LORIS工具中实现,并在包含460个C程序的主基准测试集及额外50个涉及非线性属性的C程序基准集上完成评估。主基准测试中,LORIS成功求解445个程序,总体成功率达$93.1\%$。在处理挑战性的非线性基准集时,LORIS同样展现出稳健性。

0
下载
关闭预览

相关内容

大语言模型中的隐式推理:综合综述
专知会员服务
34+阅读 · 2025年9月4日
通过逻辑推理赋能大语言模型:综述
专知会员服务
33+阅读 · 2025年2月24日
LlamaV-o1: 重新思考大语言模型中的逐步视觉推理
专知会员服务
17+阅读 · 2025年1月14日
基于深度元学习的因果推断新方法
图与推荐
12+阅读 · 2020年7月21日
因果推理学习算法资源大列表
专知
27+阅读 · 2019年3月3日
论文浅尝 | 变分知识图谱推理:在KG中引入变分推理框架
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
18+阅读 · 2012年12月31日
国家自然科学基金
18+阅读 · 2012年12月31日
VIP会员
最新内容
《无人机蜂群:释放人类-蜂群编队的潜能》
专知会员服务
0+阅读 · 11分钟前
《战略战术化:一项综合性述评》
专知会员服务
0+阅读 · 15分钟前
美陆军-工业界协同推进反无人机系统技术发展
专知会员服务
1+阅读 · 37分钟前
《跨域指挥背景下的领导力发展》最新报告
专知会员服务
0+阅读 · 43分钟前
俄乌无人机战争的六大启示
专知会员服务
10+阅读 · 8月3日
《无人机空中监控:通信实验洞察》
专知会员服务
8+阅读 · 8月3日
从采集到决策:美军视角下的战术情报范式重构
相关基金
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
18+阅读 · 2012年12月31日
国家自然科学基金
18+阅读 · 2012年12月31日
Top
微信扫码咨询专知VIP会员