Towards Effectively Leveraging Execution Traces for Program Repair with Code LLMs

Mirazul Haque, Petr Babkin, Farima Farmahinifarahani, Manuela Veloso
5/7/2025
cs.LGcs.SE

No confident code implementation found for this paper.

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 prompts and 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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{haque2025towards,
  title  = {Towards Effectively Leveraging Execution Traces for Program Repair with Code LLMs},
  author = {Mirazul Haque and Petr Babkin and Farima Farmahinifarahani and Manuela Veloso},
  year   = {2025},
  eprint = {2505.04441},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2505.04441v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2505.04441.svg)](https://codeofpaper.com/paper/2505.04441)

Discussion