计算机科学 > 计算与语言
[提交于 2024年1月10日]
标题:Leveraging Print Debugging to Improve Code Generation in Large Language Models
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读摘要:Large language models (LLMs) have made significant progress in code generation tasks, but their performance in tackling programming problems with complex data structures and algorithms remains suboptimal. To address this issue, we propose an in-context learning approach that guides LLMs to debug by using a "print debugging" method, which involves inserting print statements to trace and analysing logs for fixing the bug. We collect a Leetcode problem dataset and evaluate our method using the Leetcode online judging system. Experiments with GPT-4 demonstrate the effectiveness of our approach, outperforming rubber duck debugging in easy and medium-level Leetcode problems by 1.5% and 17.9%.
提交历史
来自:Xueyu Hu[v1] 2024年1月10日 星期三 18:37:59 UTC