arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2511.05874cs.AI
收藏

思考型代码大语言模型推理步骤的实证研究

An Empirical Study of Reasoning Steps in Thinking Code LLMs

York University(约克大学)

Haoran Xue, Gias Uddin, Song Wang

AI总结:

针对思考型代码大语言模型推理链质量未充分探索的问题,本研究通过评估6个先进模型、分析100个任务的推理过程与质量,揭示了步骤调整对解决率的影响、完整性为主要失败模式等关键发现,为其在软件工程中的应用提供新见解。

摘要:

思考型大语言模型(LLMs)在生成最终答案前会产出明确的中间推理轨迹,可能提升代码生成的透明度、可解释性和解决方案准确性。然而,这些推理链的质量仍未得到充分探索。我们针对代码生成任务中思考型LLMs的推理过程与质量开展全面实证研究。评估了6个最先进的推理LLMs(DeepSeek-R1、OpenAI-o3-mini、Claude-3.7-Sonnet-Thinking、Gemini-2.0-Flash-Thinking、Gemini-2.5-Flash和Qwen-QwQ),覆盖BigCodeBench中100个难度各异的代码生成任务。通过步骤计数和冗长性量化推理链结构,进行受控的步骤预算调整,并开展21名参与者的人类评估(涵盖效率、逻辑正确性和完整性三个维度)。步骤计数干预显示,针对性增加步骤可提升特定模型/任务的解决率,而适度减少步骤通常能保留标准任务的成功率,但在困难任务上很少奏效。通过系统分析,我们构建了推理问题分类法,发现完整性是主要失败模式。任务复杂度显著影响推理质量:困难问题比标准任务更易出现不完整情况。稳定性分析表明,思考型LLMs在不同计算努力水平下保持一致的逻辑结构,且能自我纠正之前的错误。本研究为当前思考型LLMs在软件工程领域的优势与局限提供了新见解。

英文摘要:

Thinking Large Language Models (LLMs) generate explicit intermediate reasoning traces before final answers, potentially improving transparency, interpretability, and solution accuracy for code generation. However, the quality of these reasoning chains remains underexplored. We present a comprehensive empirical study examining the reasoning process and quality of thinking LLMs for code generation. We evaluate six state-of-the-art reasoning LLMs (DeepSeek-R1, OpenAI-o3-mini, Claude-3.7-Sonnet-Thinking, Gemini-2.0-Flash-Thinking, Gemini-2.5-Flash, and Qwen-QwQ) across 100 code generation tasks of varying difficulty from BigCodeBench. We quantify reasoning-chain structure through step counts and verbosity, conduct controlled step-budget adjustments, and perform a 21-participant human evaluation across three dimensions: efficiency, logical correctness, and completeness. Our step-count interventions reveal that targeted step increases can improve resolution rates for certain models/tasks, while modest reductions often preserve success on standard tasks, rarely on hard ones. Through systematic analysis, we develop a reasoning-problematic taxonomy, identifying completeness as the dominant failure mode. Task complexity significantly impacts reasoning quality; hard problems are substantially more prone to incompleteness than standard tasks. Our stability analysis demonstrates that thinking LLMs maintain consistent logical structures across computational effort levels and can self-correct previous errors. This study provides new insights into the strengths and limitations of current thinking LLMs in software engineering.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑