Journal of East China Normal University(Natural Science) ›› 2024, Vol. 2024 ›› Issue (5): 93-103.doi: 10.3969/j.issn.1000-5641.2024.05.009

• Educational Knowledge Graphs and Large Language Models • Previous Articles     Next Articles

Prompting open-source code large language models for student program repair

Zhirui CHEN, Xuesong LU*()   

  1. School of Data Science and Engineering, East China Normal University, Shanghai 200062, China
  • Received:2024-07-09 Accepted:2024-08-01 Online:2024-09-25 Published:2024-09-23
  • Contact: Xuesong LU E-mail:xslu@dase.ecnu.edu.cn

Abstract:

Advancements in machine-learning technology has enabled automated program-repair techniques that learn human patterns of erroneous-code fixing, thereby assisting students in debugging and enhancing their self-directed learning efficiency. Automatic program-repair models are typically based on either manually designed symbolic rules or data-driven methods. Owing the availability of large language models that possess excellent natural-language understanding and code-generation capabilities, researchers have attempted to use prompt engineering for automatic program repair. However, existing studies primarily evaluate commercial models such as Codex and GPT-4, which may incur high costs for large-scale adoption and cause data-privacy issues in educational scenarios. Furthermore, these studies typically employ simple prompt forms to assess the program-repair capabilities of large language models, whereas the results are not analyzed comprehensively. Hence, we evaluate two representative open-source code large language models with excellent code-generation capability using prompt engineering. We evaluate different prompting methods, such as chain-of-thought and few-shot learning, and analyze the results comprehensively. Finally, we provide suggestions for integrating large language models into programming educational scenarios.

Key words: automatic program repair, large language models, prompt engineering

CLC Number: