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.
TasTe: Teaching Large Language Models to Translate through Self-Reflection
Institute of Computing and Intelligence, Harbin Institute of Technology(哈尔滨工业大学计算与智能学院);Pattern Recognition Center, WeChat AI, Tencent Inc(腾讯微信AI模式识别中心)
KnowRL: Teaching Language Models to Know What They Know
KnowledgeVerse AI;Department of Mathematics and Computer Science(数学与计算机科学系);Uncertainty in Artificial Intelligence Group(人工智能不确定性组);TU Eindhoven(埃因霍温理工大学)
S$^2$R: Teaching LLMs to Self-verify and Self-correct via Reinforcement Learning
Tencent(腾讯);Tsinghua University(清华大学);The University of Hong Kong(香港大学);Fudan University(复旦大学);The Hong Kong University of Science and Technology (Guangzhou)(香港科技大学(广州))
Teaching Code LLMs to Reason with Intermediate Formal Specifications
FPT Software AI Center(FPT软件人工智能中心);University of Texas at Dallas(德克萨斯大学达拉斯分校);Hanoi Univ. of Science and Tech.(河内科学技术大学);Texas, USA(得克萨斯州,美国);Hanoi, Vietnam(河内,越南)
CAST: Non-Privileged Clipped Asymmetric Self-Teaching with Advantage Flipping for GRPO
School of Software and Microelectronics, Peking University, Beijing(北京大学软件与微电子学院);School of Artificial Intelligence, Peking University, Beijing(北京大学人工智能学院);School of Computer Science, Peking University, Beijing(北京大学计算机科学学院);School of Future Technology, Peking University, Beijing(北京大学未来技术学院)
ReflexiCoder: Teaching Large Language Models to Self-Reflect on Generated Code and Self-Correct It via Reinforcement Learning
The Hong Kong University of Science and Technology (Guangzhou)(香港科技大学(广州));The Hong Kong University of Science and Technology(香港科技大学);Amazon AGI(亚马逊人工智慧实验室);NAVER Cloud(NAVER云)
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(康奈尔大学)
A Prompt-Engineering Approach to Develop Scalable, Flexible, and Real-Time Hybrid Micro-Level Personalization in a General Purpose AI Teaching Assistant
Automated Proof Generation for Rust Code via Self-Evolution
Peking University(北京大学);Microsoft Research(微软研究院);University of Illinois at Urbana-Champaign(伊利诺伊大学厄巴纳-香槟分校);Columbia University(哥伦比亚大学);University of California Irvine(加州大学 Irvine 分校)