Towards Effectively Leveraging Execution Traces for Program Repair with Code LLMs
Mirazul Haque, Petr Babkin, Farima Farmahinifarahani, Manuela Veloso
Abstract
Large Language Models (LLMs) show promising performance on various programming tasks, including Automatic Program Repair (APR).However, most approaches to LLM-based APR are limited to the static analysis of the programs, while disregarding their runtime behavior.Inspired by knowledge-augmented NLP, in this work, we aim to remedy this potential blind spot by augmenting standard APR prompts with program execution traces.We evaluate our approach using the GPT family of models on three popular APR datasets. Our findings suggest that simply incorporating execution traces into the prompt provides a limited performance improvement over trace-free baselines, in only 2 out of 6 tested dataset/model configurations. We further find that the effectiveness of execution traces for APR diminishes as their complexity increases. We explore several strategies for leveraging traces in promptsand demonstrate that LLM-optimized prompts help outperform trace-free prompts more consistently.Additionally, we show trace-based prompting to be superior to finetuning a smaller LLM on a small-scale dataset; and conduct probing studies reinforcing the notion that execution traces can complement the reasoning abilities of the LLMs.- Anthology ID:
- 2025.knowledgenlp-1.17
- Volume:
- Proceedings of the 4th International Workshop on Knowledge-Augmented Methods for Natural Language Processing
- Month:
- May
- Year:
- 2025
- Address:
- Albuquerque, New Mexico, USA
- Editors:
- Weijia Shi, Wenhao Yu, Akari Asai, Meng Jiang, Greg Durrett, Hannaneh Hajishirzi, Luke Zettlemoyer
- Venues:
- KnowledgeNLP | WS
- SIG:
- Publisher:
- Association for Computational Linguistics
- Note:
- Pages:
- 160–179
- Language:
- URL:
- https://preview.aclanthology.org/fix-sig-urls/2025.knowledgenlp-1.17/
- DOI:
- Cite (ACL):
- Mirazul Haque, Petr Babkin, Farima Farmahinifarahani, and Manuela Veloso. 2025. Towards Effectively Leveraging Execution Traces for Program Repair with Code LLMs. In Proceedings of the 4th International Workshop on Knowledge-Augmented Methods for Natural Language Processing, pages 160–179, Albuquerque, New Mexico, USA. Association for Computational Linguistics.
- Cite (Informal):
- Towards Effectively Leveraging Execution Traces for Program Repair with Code LLMs (Haque et al., KnowledgeNLP 2025)
- PDF:
- https://preview.aclanthology.org/fix-sig-urls/2025.knowledgenlp-1.17.pdf