Large language models (LLMs) have shown significant advancements in code generation, but still face challenges on tasks beyond their basic capabilities. Recently, the notion of self-debugging has been proposed to boost the performance of code generation by leveraging execution feedback from tests. Despite its promise, the availability of high-quality tests in real-world scenarios is limited. In this context, self-debugging with self-generated tests is a promising solution but lacks a full exploration of its limitations and practical potential. Therefore, we investigate its efficacy on diverse programming problems. To deepen our understanding, we propose two distinct paradigms for the process: post-execution and in-execution self-debugging. Within the scope of self-contained Python programming tasks, we find that post-execution self-debugging struggles on basic problems but shows potential for improvement on competitive ones, due to the bias introduced by self-generated tests. On the other hand, in-execution self-debugging enables LLMs to mitigate the bias by solely leveraging intermediate states during execution, thereby enhancing code generation.
From Code to Correctness: Closing the Last Mile of Code Generation with Hierarchical Debugging
Shanghai Jiao Tong University(上海交通大学);University of California, Davis(加州大学戴维斯分校);East China Normal University(华东师范大学);University of Pennsylvania(宾夕法尼亚大学)
Leveraging Large Language Model for Intelligent Log Processing and Autonomous Debugging in Cloud AI Platforms
Siebel School of Computing and Data Science(塞比尔计算与数据科学学院);College of Computing and Information Science(计算与信息科学学院);University of Illinois at Urbana-Champaign(伊利诺伊大学厄巴纳-香槟分校);Cornell University(康奈尔大学)
TraceCoder: A Trace-Driven Multi-Agent Framework for Automated Debugging of LLM-Generated Code
School of Computer Science and Technology, Chongqing University of Posts and Telecommunications(重庆邮电大学计算机科学与技术学院);Nanyang Technological University(南洋理工大学);Beihang University(北京航空航天大学);Southwest University(西南大学)
Improving Dynamic Specification Inference with LLM-Generated Counterexamples
University of Rio Cuarto(里奥夸尔托大学);Complutense University of Madrid(马德里康普顿斯大学);University of Buenos Aires(布宜诺斯艾利斯大学);Luxembourg Institute of Science and Technology(卢森堡科学与技术研究所);National Council for Scientific and Technical Research (CONICET)(国家科学研究和技术委员会);Guangdong Technion-Israel Institute of Technology(广东以色列理工学院)