Getting language models to reason correctly about code requires training on data where each reasoning step can be checked. Current synthetic Chain-of-Thought (CoT) training data often consists of plausible-sounding explanations generated by teacher models, and not verifiable accounts of actual program behavior. Models trained on such data learn logically flawed reasoning patterns despite syntactic correctness. To address this, we build a pipeline that generates execution-trace-verified CoT rationales by instrumenting code to capture traces, narrating them into natural language, and cross-checking each narration against the original trace. We systematically create 54,000 verified, bi-directional rationales that teach models to reason both forward (input$\rightarrow$output) and backward (output$\rightarrow$input). Models fine-tuned on our verified data achieve substantial improvements, with a peak gain of +26.6 on LiveCodeBench-Exec, +22.2 on CruxEval, and +19.5 on HumanEval across our fine-tuned models, demonstrating that verification quality directly determines both reasoning and code generation capabilities. Complete synthesis pipeline is avilable as open-source: https://github.com/IBM/verified-code-cot/


翻译:让语言模型正确推理代码需要训练数据中每个推理步骤均可验证。当前合成的思维链(CoT)训练数据通常包含教师模型生成的看似合理的解释,而非对实际程序行为的可验证描述。在此类数据上训练的模型虽具备句法正确性,却会习得逻辑有缺陷的推理模式。为解决该问题,我们构建了一个流水线,通过插桩代码捕获执行轨迹,将其转化为自然语言叙述,并逐一对照原始轨迹进行交叉验证,从而生成经执行轨迹验证的CoT推理依据。我们系统性地创建了54,000条可验证双向推理依据,能够训练模型同时进行前向推理(输入→输出)与反向推理(输出→输入)。基于可验证数据微调的模型取得了显著改进,其中LiveCodeBench-Exec提升+26.6,CruxEval提升+22.2,HumanEval提升+19.5(均为峰值增益),证明验证质量直接决定推理与代码生成能力。完整合成流水线已开源:https://github.com/IBM/verified-code-cot/

0
下载
关闭预览

相关内容

超越语言的推理:潜在思维链推理的综合综述
专知会员服务
22+阅读 · 2025年5月23日
AI进入推理模型时代,一文带你读懂思维链
专知会员服务
40+阅读 · 2025年3月17日
【ACL2024】通过直接偏好优化的自训练提升链式思维推理
超越思维链:大型语言模型的X链范式综述
专知会员服务
53+阅读 · 2024年4月28日
【大模型对齐】利用对齐使大型语言模型更好地推理
专知会员服务
48+阅读 · 2023年9月8日
「因果推理」概述论文,13页pdf
专知
16+阅读 · 2021年3月20日
深入理解BERT Transformer ,不仅仅是注意力机制
大数据文摘
22+阅读 · 2019年3月19日
因果推理学习算法资源大列表
专知
27+阅读 · 2019年3月3日
关系推理:基于表示学习和语义要素
计算机研究与发展
19+阅读 · 2017年8月22日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
9+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
18+阅读 · 2012年12月31日
国家自然科学基金
18+阅读 · 2012年12月31日
Arxiv
0+阅读 · 4月19日
VIP会员
最新内容
重新思考无人机时代的生存能力
专知会员服务
2+阅读 · 今天7:44
装甲突击旅:现代战争思考、战斗与组织
专知会员服务
2+阅读 · 今天7:28
在人工智能加速决策环境中拓展OODA循环
专知会员服务
3+阅读 · 今天7:18
军事欺骗:供作战战术指挥官使用的工具
专知会员服务
3+阅读 · 今天7:03
综述 | 世界动作模型:少做梦,多行动
专知会员服务
5+阅读 · 6月23日
美以伊冲突:无人机与人工智能的运用
专知会员服务
10+阅读 · 6月23日
《特种部队在透明战场中的生存力》最新报告
专知会员服务
5+阅读 · 6月23日
相关基金
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
9+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
18+阅读 · 2012年12月31日
国家自然科学基金
18+阅读 · 2012年12月31日
Top
微信扫码咨询专知VIP会员