Code Summaries as Diagnostic Context for LLM-Based Program Repair
arXiv:2511.18782
Abstract
LLMs can generate useful code, but their outputs often contain small implementation-level bugs with large behavioural effects. In this paper, we ask whether natural-language code summaries provide useful diagnostic context for repairing these errors. We use summary-mediated repair as a simple prompt-only test of their diagnostic value: an LLM first summarises buggy code, then generates a candidate repair conditioned on that summary. We evaluate summary-mediated repair across eight LLMs in two function-level repair settings: existing bugs from HumanEvalPack and LLMs' own failed generations of MBPP. Diagnostic, error-aware summaries perform best, repairing up to 65% of previously unseen errors and improving over direct repair by 5% on average. However, overall gains are modest and model-dependent, and summaries do little to overcome the difficulty of prompt-only self-repair. Overall, our results suggest that code summaries are a useful lightweight diagnostic layer for LLM-based program repair, but not a complete repair method on their own.
7 pages, 3 tables, 1 figure