Objective

Good feedback helps students learn, and it matters most when a subject is hard. Concurrent programming is one of those subjects. In concurrent programming, several tasks run at overlapping times and share resources, so the timing has to be right. Students must learn to avoid three typical mistakes: race conditions (shared data is changed without proper coordination), deadlocks (tasks wait for each other forever) and starvation (a task never gets its turn).

Teachers find these programs hard to grade too. Bugs can show up only after many runs, so ordinary automatic tests are not very reliable. Giving each student detailed feedback is slow and costly. Chatbots built on large language models (LLMs, which are AI systems trained on huge amounts of text and code) seem like a handy way to help, because they need no special installation. This paper asks whether they work for this task.

The research question was: are LLMs reliable enough to give feedback on concurrency problems on their own? The team tested two popular chatbots, ChatGPT (from OpenAI) and Bard (from Google), on real student work. The feedback was of the kind that looks at the code without running it and responds to what the student actually wrote.

Methods

This was a quantitative study that compared chatbot answers with the instructor's grading. It can show how often the tools agreed with an expert on one set of work. It cannot show how students would use the feedback or learn from it.

The student work

The data came from a Systems Architecture course in the second year of an engineering bachelor's degree at a Spanish university. Students programmed in Java. Working in pairs, they solved two problems, using either monitors (34 submissions) or semaphores (18 submissions). That gave 52 submissions from 104 students. Answers were anonymous and only the code was used. Because chatbots accept only a limited amount of text, the authors shortened the code by removing comments and extra spaces and by shortening variable names.

The course instructor graded every submission carefully, and these grades served as the ground truth. Of the 52 submissions, 10 (19%) had deadlocks, 11 (21%) had race conditions, 2 (4%) had starvation and 35 (67%) had no errors.

The four experiments

The team ran four experiments that differed in the chatbot and the prompt. A Python script sent each submission to the chatbot. The basic prompt asked whether the syntax was right and whether there was a race condition, deadlock or starvation, in language for a first-time Java learner and in at most 400 words.

  • Basic: the plain instruction only.
  • With context: three short example code pieces, one for each error type, were added.
  • With statement: the original assignment text was added as well.

Bard was tested as of June 2023 with PaLM 2. ChatGPT used GPT 3.5 turbo 16k as of July 2023, with a temperature setting of 0.8 (a setting that adds some randomness). Bard usually returned three answers, which looked very similar in a preliminary check, so one was used.

Checking the answers

Three teaching staff members were involved. Two of them checked each chatbot answer twice, including for self-contradiction. An answer counted as a yes only if it clearly stated the error. The authors then computed accuracy, precision, recall and F1 score (a single score that balances precision and recall). The paper does not mention ethics approval.

Key Findings

Overall, neither chatbot matched the instructor's grading well. The tools found errors too readily, so many of their warnings were false alarms.

Agreement with the instructor

  • The authors describe a low match between the instructor's feedback and the chatbot feedback.
  • Recall was close to 1 in many cases. In plain terms, the chatbots caught most real errors.
  • Precision was consistently low. The best value was 0.44, so even then a large share of flagged errors were not real.
  • The authors say the chatbots were prone to name errors even when the evidence was weak or unclear. For a teacher tool, they argue it is better to miss an error than to tell a student about one that is not there, because that confuses students.

Best result

  • The best performance was Bard in the first, basic experiment on race conditions: accuracy 0.74 and F1 score 0.59.
  • Three of the four experiments showed better results for race conditions than for the other errors.
  • Results were much weaker for starvation. The authors point out that only 2 submissions had starvation, which makes false positives more likely.

Effect of adding context

  • For ChatGPT, adding more context to the prompt consistently made the feedback more reliable.
  • For Bard, adding context had a clear negative effect, and sometimes made results worse.
  • The authors suggest, as a possible explanation and not a tested one, that Bard had a smaller context window, meaning the amount of text it can take in at once. A longer prompt may have pulled its attention away from the useful parts of the code.

What the feedback looked like

Answers usually had a similar shape:

  1. An opening statement about syntax and possible errors, almost always in tentative words like "potential errors".
  2. A short, correct but generic definition of the three error types, the same for every student.
  3. A more detailed explanation of where an error was. This used the student's own variable, method and class names, but the reasoning was often wrong, and sometimes it contradicted the opening statement.
  4. Sometimes extra remarks on code quality or good practice, such as praise for comments in the code.
  5. A generic closing statement with almost no personal touch.

Some feedback did correctly spot and describe deadlocks and race conditions, according to the paper's examples.

The paper's summary mentions an accuracy of 50%, but the tables were not available to this writer, so that figure is left out here.

Implications

The authors draw a clear overall message: with these tools and these prompts, chatbot feedback on concurrent programming is not yet reliable enough to use on its own.

Teachers and course leaders

  • Do not hand chatbot feedback to students on concurrency tasks without checking it. A sensible reading of the results is that a chatbot may flag errors that are not there, and its explanations can be wrong or contradict themselves.
  • If you try a chatbot as a first pass, treat its output as a list of possible issues for you to verify. This is our reading, not a recommendation from the authors.
  • Generic feedback, such as definitions of deadlock, is correct but adds little. Feedback that names the student's own variables looks more useful but can still be wrong.

Students

The paper did not test students, so it gives no direct advice for them. A cautious reading is that a confident-sounding AI answer about timing bugs should be checked with a teacher or by testing the code.

Tool builders and researchers

  • Prompt choices matter, and they can work differently in different chatbots. Adding examples helped ChatGPT but hurt Bard.
  • The authors argue that tools for teachers should favor missing an error over inventing one.
  • They suggest that models trained for this area, or newer versions, might do better, but this was not tested.

Policy

The evidence is too thin, with one course and 52 submissions, to support policy advice beyond caution about using chatbots for grading complex code.

Limitations

Several limits affect how far these results can be trusted.

  • Few submissions. The data had only 52 submissions from 104 students, from one course in one year at one Spanish university. The authors say this is a limit. Results for rare errors are shaky: only 2 submissions had starvation.
  • Older tools. Because of budget, the team used ChatGPT 3.5 and Bard with PaLM 2. The authors say the field changes fast and the results may soon be outdated, though they could still serve as a reference point.
  • Prompts only. The study used prompt design alone. The authors note that fine-tuning (further training of a model) or retrieval-augmented generation (letting a model look up extra material) could improve results, but they did not test those.
  • Code was shortened. The paper does not mention, but removing comments and renaming variables could have changed how the chatbots read the code.
  • Single answer per prompt. The paper does not mention, but ChatGPT was run with some randomness in its settings, and one answer per submission was judged, so repeated runs might give somewhat different numbers.
  • Strict yes or no labels. Tentative answers counted as no. This is a reasonable rule, but it shapes the scores, and the paper does not say how often it changed the result.
  • Explanations are untested. The reason Bard did worse with more context is the authors' suggestion, not something they tested.
  • No student outcomes. The paper does not mention any test of how students would respond to the feedback.

Future Directions

The authors do not list a detailed research plan. They say the development of LLMs has only begun, and that newer versions, or models trained specifically for concurrent programming, may do better. They also name fine-tuning and retrieval-augmented generation as approaches that could improve results.

The study leaves several open questions:

  • Would newer chatbots, or models trained on concurrency tasks, give feedback that agrees more closely with teachers?
  • Would fine-tuning or retrieval-augmented generation reduce the false alarms?
  • Why did extra context help ChatGPT but hurt Bard? Is the size of the context window really the reason?
  • How would results change with a larger set of submissions that includes more cases of starvation?
  • How do students react to this kind of feedback, and does it help them learn? This study did not look at that.
  • Does the problem come from how the code used to train the models handled advanced tools such as semaphores and monitors? The authors suggest this as a possible cause.

The bottom line: In one Spanish university course, ChatGPT (GPT 3.5) and Bard (PaLM 2) did not give reliable feedback on 52 student Java submissions about concurrent programming. They caught most real errors but also flagged many that were not there, with precision reaching only 0.44. The evidence comes from one course, older chatbot versions and a small set of work, so it is a snapshot and not a final verdict. Teachers should check any chatbot feedback on tricky code before sharing it with students.