Search and Filter

Humanizing Automated Programming Feedback: Fine-Tuning Generative Models with Student-Written Feedback

Date

AI Overview

Why it matters

AI-generated programming feedback often relies on prompt engineering that yields rigid responses. Fine-tuning models with student-written feedback may provide more relatable, peer-like, and flexible support without requiring heavy prompt engineering.

Study at a glance
  • Question: Can fine-tuning AI models on student-written feedback improve the feedback's accuracy and similarity to peer feedback?
  • Setting and data: Introductory C programming course at the University of Auckland, over 700 students, 1,920 feedback instances across 30 tasks.
  • Method: Supervised fine-tuning of open-access models and expert rubric-based evaluation of feedback attributes.
  • AI tools: Llama3-8B, Phi3-3.8B, GPT-4 Turbo, GPT-3.5 Turbo
Key findings
  • Fine-tuned Llama3-8B and Phi3-3.8B produced concise feedback that closely matched student communication style in length and variable mentions.
  • Fine-tuning improved feedback accuracy to 86.7% for Llama3-8B and 88.3% for Phi3-3.8B, surpassing their base prompt-engineered counterparts despite noisy student training data.
  • In a sample of 300 student feedback instances, 77.3% were correct, averaging 46.1 words and 2.7 sentences, with students rarely using line numbers.

Summary drafted with AI from the full paper and may contain errors. See the full paper for details.

The growing need for automated and personalized feedback in programming education has led to recent interest in leveraging generative AI for feedback generation. However, current approaches tend to rely on prompt engineering techniques in which predefined prompts guide the AI to generate feedback. This can result in rigid and constrained responses that fail to accommodate the diverse needs of students and do not reflect the style of human-written feedback from tutors or peers. In this study, we explore learnersourcing as a means to fine-tune language models for generating feedback that is more similar to that written by humans, particularly peer students. Specifically, we asked students to act in the flipped role of a tutor and write feedback on programs containing bugs. We collected approximately 1,900 instances of student-written feedback on multiple programming problems and buggy programs. To establish a baseline for comparison, we analyzed a sample of 300 instances based on correctness, length, and how the bugs are described. Using this data, we fine-tuned open-access generative models, specifically Llama3 and Phi3. Our findings indicate that fine-tuning models on learnersourced data not only produces feedback that better matches the style of feedback written by students, but also improves accuracy compared to feedback generated through prompt engineering alone, even though some student-written feedback is incorrect. This surprising finding highlights the potential of student-centered fine-tuning to improve automated feedback systems in programming education.