arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2501.05706cs.SEcs.HC
收藏

无错误消息调试:LLM提示策略如何影响编程错误解释的有效性

Debugging Without Error Messages: How LLM Prompting Strategy Affects Programming Error Explanation Effectiveness

Audrey Salmon, Katie Hammer, Eddie Antonio Santos, Brett A. Becker

AI总结:

本文研究在不提供编译器/解释器错误消息、仅给出出错源代码时,GPT-3.5的单样本提示与微调等策略如何提升编程错误解释效果,以辅助编程教学。

摘要:

犯错是编程过程的一部分——即使对最经验丰富的专业人员也是如此。尤其是初学者,在学习过程中必然会犯许多错误。众所周知,传统的(编译器/解释器)编程错误消息对许多初学者帮助不大,并可能带来诸如令人沮丧、包含令人困惑的行话以及完全具有误导性等影响。近期研究发现,大型语言模型(LLM)能够生成出色的错误解释,但这些错误消息的有效性在很大程度上取决于是否向LLM提供了上下文——通常是问题发生时的原始源代码。鉴于编程错误消息可能具有误导性和/或包含几乎毫无用处的内容(尤其是对初学者而言),我们探索了相反的情形:当仅依据出错的源代码本身提示GPT-3.5生成错误解释时会发生什么——排除编译器/解释器生成的原始错误消息。我们采用了多种策略来生成更有效的错误解释,包括单样本提示(one-shot prompting)和微调。我们报告了错误解释在提供反馈方面有效性的基线结果,以及各种提示策略可能如何提升解释的有效性。我们的结果可以帮助教育工作者理解LLM如何回应初学者必然会提出的此类提示,并有望推动生成式AI在课堂中得到更有效的使用。

英文摘要:

Making errors is part of the programming process -- even for the most seasoned professionals. Novices in particular are bound to make many errors while learning. It is well known that traditional (compiler/interpreter) programming error messages have been less than helpful for many novices and can have effects such as being frustrating, containing confusing jargon, and being downright misleading. Recent work has found that large language models (LLMs) can generate excellent error explanations, but that the effectiveness of these error messages heavily depends on whether the LLM has been provided with context -- typically the original source code where the problem occurred. Knowing that programming error messages can be misleading and/or contain that serves little-to-no use (particularly for novices) we explore the reverse: what happens when GPT-3.5 is prompted for error explanations on just the erroneous source code itself -- original compiler/interpreter produced error message excluded. We utilized various strategies to make more effective error explanations, including one-shot prompting and fine-tuning. We report the baseline results of how effective the error explanations are at providing feedback, as well as how various prompting strategies might improve the explanations' effectiveness. Our results can help educators by understanding how LLMs respond to such prompts that novices are bound to make, and hopefully lead to more effective use of Generative AI in the classroom.

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

↑