Objective

Beginners in programming often get only a pass-or-fail result or an error message when they practice alone online. That tells them what failed, but not why, or how to fix it. Timely feedback that explains mistakes is known to help, but writing it for every learner is hard to do by hand.

The authors had already built ADVENTURE, an adaptive learning system for practicing programming in Python, Java and C#. It checked code with unit tests (automatic tests that compare a program's output with the expected answer) and picked the next exercise using an Elo rating, a skill score that goes up and down with each attempt. In this study they added GPT-4, a large language model (LLM, an AI trained on huge amounts of text). They paired it with retrieval-augmented generation (RAG), a method where the AI first looks up relevant material, here a knowledge graph of programming concepts and the learner's past activity, before it writes a reply. The aim was to reduce vague or wrong AI answers.

The study asked three questions:

  1. How can RAG be built into an ontology-based adaptive system to give formative feedback (feedback meant to help learning, not to grade) in programming?
  2. How do learning performance and perceptions differ among three modes: adaptive only, GPT-4 feedback with GPT-4 exercise recommendations, and a hybrid where learners choose between the two kinds of recommendation?
  3. How helpful do learners find the GPT-4 feedback?

Methods

This was an experiment that compared three groups of students using three versions of the same system. It can show differences between groups, but it cannot say for sure why they happened.

Participants

The participants were 87 first- and second-year Information Technology undergraduates at a university in Thailand. Of 143 students who showed interest, 123 started and 87 finished both the experiment and the questionnaire. There were three groups of 29 students, each with 15 first-year and 14 second-year students. Group A used the adaptive mode (23 males, 6 females). Group B used the GenAI mode (22 males, 7 females). Group C used the hybrid mode (28 males, 1 female). The paper does not say how students were placed into groups.

The three modes

  • Adaptive (ADVENTURE-2.0): unit-test results only, with exercises chosen by the Elo rating.
  • GenAI (ADVENTURE-3.0): GPT-4 explained errors, gave corrected solutions and recommended the next exercise. If it suggested one the student had already solved, the student could repeat it or get an adaptive pick instead.
  • Hybrid (ADVENTURE-3.1): GPT-4 feedback, and students could accept the GPT-4 recommendation or switch to the adaptive one.

Procedure and measures

All groups had 15 days to use the system on their own time, plus three on-site sessions of 1.5 hours (days 1, 7 and 15). A pre-test of three questions set each student's starting level. The researchers collected 4956 code submissions from the system logs: 1633 from Group A, 2030 from Group B and 1293 from Group C. Four features were compared: correct submissions, wrong submissions, submissions missing essential programming logic (such as empty code), and requests for a different exercise. Students also completed a 26-item questionnaire on a seven-point scale (translated into Thai), and Groups B and C rated each piece of GPT-4 feedback. Groups were compared with one-way ANOVA (a test for differences among group averages) and follow-up pairwise tests.

Key Findings

Students who received GPT-4 feedback did better on three of the four log measures than students in the adaptive-only mode, and all three modes were rated positively.

Code submissions

  • Correct answers: The groups differed significantly (F(2,84) = 6.343, p < 0.01). Group A had significantly fewer correct submissions than Group B and than Group C. Groups B and C did not differ significantly from each other, though Group C had the highest average.
  • Wrong answers: Group A had the most. The groups differed significantly (p < 0.05), and Group A had significantly more wrong submissions than both B and C. B and C were not significantly different.
  • Code missing essential logic: Group A submitted more of these (p < 0.001 against both B and C). This is the largest difference in the study (eta squared 0.184).
  • Requests for another exercise: No significant differences. Group C asked for alternatives a little less often on average.

Questionnaire results

  • Ease of use and usefulness were rated above 5 on the seven-point scale in all groups, with no significant differences. Satisfaction was also above 5 everywhere.
  • Group B reported significantly more mental effort in the learning activity (mean 6.24) than Group A (5.48) and Group C (5.52).
  • Group C rated distraction a little higher (4.46) than Groups A (3.86) and B (3.75), and Groups B and C rated pressure somewhat higher than Group A. Neither of these differences was significant.

Views on GPT-4 feedback

  • Across 3154 ratings from Groups B and C, the average agreement that the feedback was helpful was 4.01 on a five-point scale. Groups B and C did not differ significantly.
  • Students' written comments praised GPT-4 feedback for showing where code went wrong. The adaptive group wanted more explanation than the plain test output.

Problems with GPT-4 recommendations

  • Even though GPT-4 was told not to repeat exercises, 76.95% of its recommendations in Group B and 71.54% in Group C were exercises the student had already solved.
  • In the hybrid group, 71.69% of students chose the adaptive suggestion instead of the GPT-4 one.
  • Students in both GPT-4 groups complained that questions repeated too often.

Implications

For teachers of programming (the authors' conclusions)

  • Explaining why code fails seems to help beginners more than showing only failed test cases. Students in both GPT-4 groups made fewer empty or off-target submissions.
  • Giving learners a choice between AI and adaptive recommendations may suit them, and in the hybrid group most chose the adaptive picks.

For developers of learning systems (the authors' conclusions)

  • Pairing an LLM with a knowledge graph and a learner's history can keep feedback tied to the course content.
  • Do not rely on a prompt alone to stop an LLM repeating exercises. Keep a rule-based fallback, as the adaptive mode did here.

Our reading (not the authors' recommendation): A school trying this could use AI for the explanations of errors and let an established adaptive rule or the teacher choose the next exercise, since that was the weaker part of the GPT-4 mode in this study.

Our reading (not the authors' recommendation): Because the GPT-4 group reported higher effort, teachers might watch whether the AI's exercises feel too hard for some beginners.

For students: Read the AI explanation of an error before moving on, and tell your instructor when the system keeps giving you problems you have already solved.

The authors say the hybrid mode "outperforms" the others, but its edge over GPT-4 alone was not statistically significant, so schools should not treat it as proven to be the best choice.

Limitations

The authors name three limitations. First, GPT-4 still recommended exercises that students had already completed, which confused learners, even though the prompt told it not to. Second, the groups were unbalanced by gender, with only 1 woman in Group C, and the study did not look at gender differences. Third, the questionnaire was translated into Thai and still needs to be checked for accuracy and reliability. The authors also note that only 87 of the 143 interested students finished.

The paper does not mention, but the groups were small (29 students each) and came from one university in one country, so the results may not apply to other students, ages or languages.

The paper does not mention, but 15 days is a short time, so the study cannot show lasting skill gains. The outcome measures were counts of submissions in the system logs, not a separate test of programming skill.

The paper does not mention, but the paper does not say how students were placed in groups, and the students chose when to use the system outside the three on-site sessions, so differences in effort or time spent could affect the results.

The paper does not mention, but the hybrid group could choose between recommendations and the groups got different amounts of AI, so it is hard to say which part of each mode made the difference. One reliability score for the mental effort items was low (0.582).

Future Directions

The authors plan the following next steps.

  • Improve the structure of the GPT-4 prompt so the system stops recommending exercises students have already finished.
  • Recruit more participants and reach a better balance of groups, including by gender.
  • Review the Thai version of the questionnaire and check its reliability and validity again.
  • Keep studying how learners choose between AI and adaptive recommendations, since the paper treats this choice as a useful design feature.

The study also leaves open questions. Does the advantage of GPT-4 feedback last beyond 15 days, and does it show up in a separate programming test? Is the hybrid mode truly better than GPT-4 alone, which a larger study could settle? And why did most hybrid students prefer the adaptive recommendations, given that they rated the GPT-4 feedback as helpful?

The bottom line: In this 15-day experiment with 87 Thai undergraduates, adding GPT-4 feedback to an adaptive programming system went along with more correct code and fewer wrong or logic-missing submissions than the adaptive system alone. Students found the AI explanations helpful. The hybrid mode had the best average results, but it was not significantly better than GPT-4 alone, and GPT-4 often suggested repeat exercises. The groups were small and unbalanced by gender, so treat this as early evidence that explained feedback helps beginners, not as proof of the best design.