paper-with-me

Papers

Teaching Large Language Models to Self-Debug

2023-04-11 · Xinyun Chen, Maxwell Lin, Nathanael Schärli, Denny Zhou

Large language models (LLMs) have achieved impressive performance on code generation. However, for complex programming tasks, generating the correct solution in one go becomes challenging, thus some prior works have designed program repair approaches to improve code generation performance. In this work, we propose Self-Debugging, which teaches a large language model to debug its predicted program via few-shot demonstrations. In particular, we demonstrate that Self-Debugging can teach the large language model to perform rubber duck debugging; i.e., without any human feedback on the code correctness or error messages, the model is able to identify its mistakes by investigating the execution results and explaining the generated code in natural language. Self-Debugging achieves the state-of-the-art performance on several code generation benchmarks, including the Spider dataset for text-to-SQL generation, TransCoder for C++-to-Python translation, and MBPP for text-to-Python generation. On the Spider benchmark where there are no unit tests to verify the correctness of predictions, Self-Debugging with code explanation consistently improves the baseline by 2-3%, and improves the prediction accuracy on problems of the hardest level by 9%. On TransCoder and MBPP where unit tests are available, Self-Debugging improves the baseline accuracy by up to 12%. Meanwhile, by leveraging feedback messages and reusing failed predictions, Self-Debugging notably improves sample efficiency, and can match or outperform baseline models that generate more than 10x candidate programs.

📄 PDF Abstract BibTeX arXiv:2304.05128

Code (2)

amazon-science/SDFeedback
amazon-science/self_debug

Tasks

Code GenerationLanguage ModelingLanguage ModellingLarge Language ModelmbppProgram RepairText to SQLText-To-SQL

Methods 이 논문이 사용한 방법론

Repair 설명 없음

Similar Papers 제목 키워드 기반

Learning-by-teaching with ChatGPT: The effect of teachable ChatGPT agent on programming education

2024-12-05 · Angxuan Chen, Yuang Wei, Huixiao Le, Yan Zhang

This study investigates the potential of using ChatGPT as a teachable agent to support students' learning by teaching process, specifically in programming education. While learning by teaching is an effective pedagogical…

Active Learning

NExT: Teaching Large Language Models to Reason about Code Execution

2024-04-23 · Ansong Ni, Miltiadis Allamanis, Arman Cohan, Yinlin Deng 외

A fundamental skill among human developers is the ability to understand and reason about program execution. As an example, a programmer can mentally simulate code execution in natural language to debug and repair code (a…

HumanEvalmbppProgram Repair

Enhancing Debugging Skills with AI-Powered Assistance: A Real-Time Tool for Debugging Support

2026-01-05 · Elizaveta Artser, Daniil Karol, Anna Potriasaeva, Aleksei Rostovskii 외 arxiv

Debugging is a crucial skill in programming education and software development, yet it is often overlooked in CS curricula. To address this, we introduce an AI-powered debugging assistant integrated into an IDE. It offer…

Can Language Models Employ the Socratic Method? Experiments with Code Debugging

2023-10-04 · Erfan Al-Hossami, Razvan Bunescu, Justin Smith, Ryan Teehan

When employing the Socratic method of teaching, instructors guide students toward solving a problem on their own rather than providing the solution directly. While this strategy can substantially improve learning outcome…

Benchmarking

Revisit Self-Debugging with Self-Generated Tests for Code Generation

2025-01-22 · Xiancai Chen, Zhengwei Tao, Kechi Zhang, Changzhi Zhou 외

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 t…

Code Generation