Papers
Topics
Authors
Recent
Gemini 2.5 Flash
Gemini 2.5 Flash
80 tokens/sec
GPT-4o
59 tokens/sec
Gemini 2.5 Pro Pro
43 tokens/sec
o3 Pro
7 tokens/sec
GPT-4.1 Pro
50 tokens/sec
DeepSeek R1 via Azure Pro
28 tokens/sec
2000 character limit reached

Automated Repair of Programs from Large Language Models (2205.10583v4)

Published 21 May 2022 in cs.SE

Abstract: LLMs such as Codex, have shown the capability to produce code for many programming tasks. However, the success rate of existing models is low, especially for complex programming tasks. One of the reasons is that LLMs lack awareness of program semantics, resulting in incorrect programs, or even programs which do not compile. In this paper, we systematically study whether automated program repair (APR) techniques can fix the incorrect solutions produced by LLMs in LeetCode contests. The goal is to study whether APR techniques can enhance reliability in the code produced by LLMs. Our study revealed that: (1) automatically generated code shares common programming mistakes with human-crafted solutions, indicating APR techniques may have potential to fix auto-generated code; (2) given bug location information provided by a statistical fault localization approach, the newly released Codex edit mode, which supports editing code, is similar to or better than existing Java repair tools TBar and Recoder in fixing incorrect solutions. By analyzing the experimental results generated by these tools, we provide several suggestions: (1) enhancing APR tools to surpass limitations in patch space (e.g., introducing more flexible fault localization) is desirable; (2) as LLMs can derive more fix patterns by training on more data, future APR tools could shift focus from adding more fix patterns to synthesis/semantics based approaches, (3) combination of LLMs with APR to curate patch ingredients, is worth studying.

User Edit Pencil Streamline Icon: https://streamlinehq.com
Authors (5)
  1. Zhiyu Fan (7 papers)
  2. Xiang Gao (210 papers)
  3. Martin Mirchev (4 papers)
  4. Abhik Roychoudhury (41 papers)
  5. Shin Hwei Tan (20 papers)
Citations (87)