TL;DR
This paper introduces CREF, a novel conversational framework that leverages Large Language Models (LLMs) to assist human tutors in debugging student code. By incorporating tutor guidance and historical conversation data, CREF significantly improves program repair accuracy and efficiency, demonstrating a practical solution for educational settings and beyond.
What Problem Does This Paper Address?
The paper tackles the challenge of effective and efficient program repair, particularly in the context of programming education. While LLMs show promise for code-related tasks, existing benchmarks are often "crawled," meaning they might be part of the LLM's training data, leading to inflated performance metrics and an inaccurate assessment of real-world capabilities. Furthermore, automated program repair often overlooks the valuable insights that human interaction and context can provide. In educational settings, human tutors spend significant time debugging student code, leading to high costs and delayed feedback, which negatively impacts student learning. The authors aim to bridge this gap by developing a system that enhances LLM repair performance through augmented information and conversational interaction, ultimately reducing tutor workload and improving student experience.
Methods
The authors propose a multi-faceted approach:
- TUTORCODE Benchmark: They introduce TUTORCODE, a novel, "uncrawled" benchmark dataset containing 1,239 C++ defect codes. This dataset is unique in its inclusion of rich contextual information, such as programming problem descriptions, tutor guidance, solution descriptions, failing test cases, and ground truth corrected code. This aims to provide a more realistic evaluation of LLMs.
- Augmented Information Investigation: They systematically evaluate the impact of different types of augmented information (tutor guidance, solution description, failing test cases) on LLM repair performance. This involves crafting prompts with various combinations of these elements.
- CREF Framework: The core contribution is CREF (Conversational Repair Framework), a semi-automatic, conversational repair framework. CREF leverages LLMs' conversational abilities and incorporates augmented information. It operates in a three-step process:
- Initial repair using problem description, incorrect code, and tutor guidance.
- Refined repair using historical conversation entries and solution descriptions.
- Further refinement using historical entries and failing test cases from the previous repair attempt. This iterative, conversational approach aims to maximize the LLM's understanding and repair accuracy.
Datasets
- TUTORCODE: A newly introduced, extensive, uncrawled benchmark dataset comprising 1,239 C++ defect codes. It is derived from real-world data structure and algorithm courses and includes problem descriptions, tutor guidance, solution descriptions, failing test cases, and corrected code. It is organized into 12 difficulty tiers.
- TUTORCODEPLUS: An extended benchmark used to validate the generalization of CREF's capabilities, containing 2,464 incorrect code submissions.
Key Insights and Ideas
- Tutor Guidance is King: Among various forms of augmented information, tutor guidance proved to be the most effective in boosting LLM repair performance. This highlights the value of human expertise and specific hints.
- Beware of Data Leakage: The performance of LLMs on existing benchmarks can be misleading due to potential data leakage. A carefully curated, uncrawled benchmark like TUTORCODE is crucial for accurate evaluation.
- Conversational Context Matters: Simply providing more information doesn't always guarantee better results. CREF's conversational approach, which leverages historical interactions, significantly outperforms static prompts.
- Open-Source LLMs Lag Behind: While some open-source LLMs show promise on general coding benchmarks (like HumanEval), they significantly underperform closed-source models like GPT-4 and GPT-3.5 on realistic program repair tasks.
- Code Length Impacts Performance: Longer incorrect code snippets tend to negatively affect LLM repair performance, suggesting that LLMs might struggle with more complex or extensive code.
Key Results
- CREF's Superior Performance: CREF achieved a remarkable AVG-5 score of 76.6% when utilizing GPT-4, representing a significant improvement of 17.2%-24.6% over the baseline.
- Efficiency Gains: In an industrial application, CREF reduced response times for debugging requests by 71.2% and decreased costs by 69.9%.
- Tutor Guidance Effectiveness: Providing tutor guidance alone improved LLM repair performance by over 6.8% in AVG-5.
- LLM Performance Gap: Closed-source LLMs like GPT-4 and GPT-3.5 significantly outperformed open-source LLMs on the TUTORCODE benchmark, with GPT-4 achieving an AVG-5 of 52.0% compared to CodeLlama's 6.8%.
- Patch Precision: While GPT-4 and GPT-3.5 led in correctness, CodeLlama showed better patch precision (lower RPSR).
Limitations and Future Work
- Data Leakage Mitigation: While TUTORCODE is designed to be uncrawled, the authors acknowledge the ongoing challenge of data leakage in LLM research and emphasize the need for careful benchmark selection.
- Computational Cost: The paper notes that while CREF is efficient, LLMs like GPT-4 still require substantial computational resources, suggesting future work on optimizing open-source LLMs for similar performance at a lower cost.
- Patch Precision Improvement: While CREF significantly improved repair accuracy, further research could focus on enhancing patch precision for students.
- Broader Applications: The success of CREF in educational settings suggests its potential for other software engineering tasks like code review, which the authors propose as future work.
- Ambiguity in Problem Statements: The investigation into outlier data revealed that ambiguities in problem statements and solution descriptions can negatively impact LLM performance, highlighting the importance of clear and precise input.
Summary updated