Saved in:
Bibliographic Details
Main Authors: Liu, Fang, Wang, Tianze, Zhang, Li, Yang, Zheyu, Jiang, Jing, Sun, Zian
Format: Preprint
Published: 2025
Subjects:
Online Access:https://arxiv.org/abs/2509.25676
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866914067081330688
author Liu, Fang
Wang, Tianze
Zhang, Li
Yang, Zheyu
Jiang, Jing
Sun, Zian
author_facet Liu, Fang
Wang, Tianze
Zhang, Li
Yang, Zheyu
Jiang, Jing
Sun, Zian
contents Providing timely and personalized guidance for students' programming assignments, offers significant practical value for helping students complete assignments and enhance their learning. In recent years, various automated Fault Localization (FL) techniques have demonstrated promising results in identifying errors in programs. However, existing FL techniques face challenges when applied to educational contexts. Most approaches operate at the method level without explanatory feedback, resulting in granularity too coarse for students who need actionable insights to identify and fix their errors. While some approaches attempt line-level fault localization, they often depend on predicting line numbers directly in numerical form, which is ill-suited to LLMs. To address these challenges, we propose FLAME, a fine-grained, explainable Fault Localization method tailored for programming assignments via LLM-guided Annotation and Model Ensemble. FLAME leverages rich contextual information specific to programming assignments to guide LLMs in identifying faulty code lines. Instead of directly predicting line numbers, we prompt the LLM to annotate faulty code lines with detailed explanations, enhancing both localization accuracy and educational value. To further improve reliability, we introduce a weighted multi-model voting strategy that aggregates results from multiple LLMs to determine the suspiciousness of each code line. Extensive experimental results demonstrate that FLAME outperforms state-of-the-art fault localization baselines on programming assignments, successfully localizing 207 more faults at top-1 over the best-performing baseline. Beyond educational contexts, FLAME also generalizes effectively to general-purpose software codebases, outperforming all baselines on the Defects4J benchmark.
format Preprint
id arxiv_https___arxiv_org_abs_2509_25676
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Explainable Fault Localization for Programming Assignments via LLM-Guided Annotation
Liu, Fang
Wang, Tianze
Zhang, Li
Yang, Zheyu
Jiang, Jing
Sun, Zian
Software Engineering
Providing timely and personalized guidance for students' programming assignments, offers significant practical value for helping students complete assignments and enhance their learning. In recent years, various automated Fault Localization (FL) techniques have demonstrated promising results in identifying errors in programs. However, existing FL techniques face challenges when applied to educational contexts. Most approaches operate at the method level without explanatory feedback, resulting in granularity too coarse for students who need actionable insights to identify and fix their errors. While some approaches attempt line-level fault localization, they often depend on predicting line numbers directly in numerical form, which is ill-suited to LLMs. To address these challenges, we propose FLAME, a fine-grained, explainable Fault Localization method tailored for programming assignments via LLM-guided Annotation and Model Ensemble. FLAME leverages rich contextual information specific to programming assignments to guide LLMs in identifying faulty code lines. Instead of directly predicting line numbers, we prompt the LLM to annotate faulty code lines with detailed explanations, enhancing both localization accuracy and educational value. To further improve reliability, we introduce a weighted multi-model voting strategy that aggregates results from multiple LLMs to determine the suspiciousness of each code line. Extensive experimental results demonstrate that FLAME outperforms state-of-the-art fault localization baselines on programming assignments, successfully localizing 207 more faults at top-1 over the best-performing baseline. Beyond educational contexts, FLAME also generalizes effectively to general-purpose software codebases, outperforming all baselines on the Defects4J benchmark.
title Explainable Fault Localization for Programming Assignments via LLM-Guided Annotation
topic Software Engineering
url https://arxiv.org/abs/2509.25676