一句话:将思维链代码生成建模为决策问题,用自探索推理路径、质量感知训练与自适应推理提升生成质量。
论文针对大语言模型在代码生成中思维链(CoT)推理的三个局限:推理路径探索单一导致泛化不足、中间推理步骤缺乏质量评估、以及“过度思考”可能带来不必要地复杂甚至错误的解。作者将 CoT 代码生成形式化为决策问题,提出自探索深度推理框架 SEER,包含三个组件:(1) 多样推理路径探索,在无需人工专家或闭源专有模型的情况下探索多样推理路径并标注中间步骤;(2) 推理质量感知的模型训练,训练策略模型生成候选推理步骤、价值模型评估其质量;(3) 自适应 CoT 推理,针对不同问题在直接生成与逐步推理之间动态切换,从而实现准确且自适应的代码生成推理。
Code generation, the task of creating executable programs from natural language requirements, has recently seen tremendous advances through Chain-of-Thought (CoT) reasoning, which enables Large Language Models (LLMs) to develop high-level reasoning plans before writing code. Recent research has proposed various methods to enhance models' CoT reasoning for code generation such as prompt engineering and supervised fine-tuning. However, existing approaches still face three critical limitations: (1) limited exploration of diverse reasoning paths, which constrains generalization across various programming scenarios, (2) lack of quality assessment for intermediate reasoning steps, which hampers the reliability of the generated plans and code, and (3) the potential negative impact of "overthinking", potentially leading to unnecessarily complex and incorrect solutions. To address these limitations, we frame CoT code generation as a decision making problem and present SEER, a SElf-Exploring deep Reasoning framework that enables accurate and adaptive reasoning for code generation. SEER introduces three key components: (1) Diverse reasoning path exploration, which aims at exploring diverse reasoning paths and annotating intermediate steps without relying on manual experts or closed-source proprietary models; (2) Reasoning quality-aware model training, which trains a policy model for generating candidate reasoning steps and a value model for assessing their quality; and (3) Adaptive CoT reasoning, which dynamically switches between direct generation and step-by-step reasoning for different problems.
@inproceedings{paperbot11762,
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},
booktitle = {ICSE},
year = {2026},
doi = {10.1145/3744916.3773197}
}