从执行轨迹生成可验证的推理链
Generating Verifiable Chain of Thoughts from Exection-Traces
AI总结:
本文提出通过生成执行轨迹验证的推理链,提升模型在代码推理和生成中的准确性,实验显示验证质量显著提升模型性能。
摘要:
获取语言模型正确推理代码需要训练数据中每个推理步骤可验证。当前合成的推理链(CoT)训练数据通常由教师模型生成,而非实际程序行为的可验证记录。模型在这样的数据上学习到逻辑错误的推理模式。为此,我们构建了生成执行轨迹验证的推理链的管道,通过代码仪器化捕获轨迹,将其叙述为自然语言,并将每个叙述与原始轨迹交叉核对。我们系统地创建了54,000个验证过的双向推理链,教导模型在正向(输入→输出)和反向(输出→输入)推理。在我们的验证数据上微调的模型在LiveCodeBench-Exec、CruxEval和HumanEval上分别达到+26.6、+22.2和+19.5的峰值提升,证明验证质量直接影响推理和代码生成能力。完整的合成管道作为开源提供:https://github.com/IBM/verified-code-cot/
英文摘要:
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/
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。