Fixing Function-Level Code Generation Errors for Foundation Large Language Models
Hao WenYueheng ZhuCLChao LiuXRXiaoxue RenWeiwei Du
Meng Yan Hao Wen
Yueheng Zhu
CLChao Liu
XRXiaoxue Ren
Weiwei Du

Meng Yan
+6
This paper investigates function-level code generation errors in foundation large language models by empirically analyzing 12,837 errors from 14 LLMs on the HumanEval dataset, identifying 19 error cause categories. Three causes—indentation errors, redundant code, and missing imports—are directly fixable. The authors propose LlmFix, a three-step method filtering code for indentation correction, truncating redundant code, and importing missing modules. On an error-fixing dataset, LlmFix achieves a 17.1% fix rate, outperforming the best baseline LDB by 8.9%. It also improves code generation accuracy by 7.5% on average across 14 LLMs on HumanEval and MBPP.

arXiv ·
· September 1, 2024