Is Self-Repair a Silver Bullet for Code Generation?

Theo X. Olausson, J. Inala, Chenglong Wang, Jianfeng Gao, Armando Solar-Lezama
2/12/2026

No official code found. Best implementation: theoxo/self-repair (15 stars, last commit 2024-05-02).

Abstract

Large language models have shown remarkable aptitude in code generation, but still struggle to perform complex tasks. Self-repair -- in which the model debugs and repairs its own code -- has recently become a popular way to boost performance in these settings. However, despite its increasing popularity, existing studies of self-repair have been limited in scope; in many settings, its efficacy thus remains poorly understood. In this paper, we analyze Code Llama, GPT-3.5 and GPT-4's ability to perform self-repair on problems taken from HumanEval and APPS. We find that when the cost of carrying out repair is taken into account, performance gains are often modest, vary a lot between subsets of the data, and are sometimes not present at all. We hypothesize that this is because self-repair is bottlenecked by the model's ability to provide feedback on its own code; using a stronger model to artificially boost the quality of the feedback, we observe substantially larger performance gains. Similarly, a small-scale study in which we provide GPT-4 with feedback from human participants suggests that even for the strongest models, self-repair still lags far behind what can be achieved with human-level debugging.

View on arXivView PDF

Code Implementations(1)

theoxo/self-repairCommunity100%

[ICLR 2024]: Is Self-Repair a Silver Bullet for Code Generation?

153Shell, PythonJan 26, 20242 years ago

Similar Papers

Cite this paper

@article{olausson2026selfrepair,
  title  = {Is Self-Repair a Silver Bullet for Code Generation?},
  author = {Theo X. Olausson and J. Inala and Chenglong Wang and Jianfeng Gao and Armando Solar-Lezama},
  year   = {2026},
  eprint = {2306.09896},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2306.09896},
  journal = {ICLR 2023 2023}
}

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/2306.09896.svg)](https://codeofpaper.com/paper/2306.09896)

Discussion