中文

SEER:通过自我探索深层推理提升链路思代码生成

软件工程 2025-10-21 v1

摘要

代码生成是从自然语言要求创建可执行程序的任务,近期通过链路思(CoT)推理取得了显著进展,该推理使大型语言模型(LLM)在编写代码之前能够 develop high-level reasoning plans。近期研究提出了 various methods 来 enhance models 的 CoT 推理 for code generation,如 prompt engineering 和 supervised fine-tuning。然而,现有方法仍面临三个关键局限:(1)对多样化推理路径的探索有限,限制了在 various programming scenarios 中的 generalization;(2)缺乏对中间推理步骤的 quality assessment,阻碍了 generated plans 和 code 的 reliability;(3)“过度思考”可能产生不利影响,导致不必要地 complex and incorrect solutions。为此,我们将 CoT code generation 定义为 decision making problem,并提出 SEER(SElf-Exploring deep Reasoning)框架,使 code generation 能够 accurate and adaptive reason。SEER 引入了三个关键组件:(1)多样化推理路径探索,旨在 without 依赖 manual experts 或 closed-source proprietary models 对 intermediate steps 进行 annotation;(2)基于 reasoning quality 的 model training,训练一个 policy model for generating candidate reasoning steps 和一个 value model for assessing their quality;(3)自适应 CoT 推理,动态在 direct generation 和 step-by-step reasoning 之间为 different problems 进行 switching。

关键词

引用

@article{arxiv.2510.17130,
  title  = {SEER: Enhancing Chain-of-Thought Code Generation through Self-Exploring Deep Reasoning},
  author = {Shuzheng Gao and Chaozheng Wang and Cuiyun Gao and Michael R. Lyu},
  journal= {arXiv preprint arXiv:2510.17130},
  year   = {2025}
}

备注

The paper was completed in Feb. 2025, submitted to ICSE 2026 in Mar. 2025, received a major revision in Jun. 2025, and was finally accepted in Oct. 2025