Logo image
Knowledge-Enhanced Program Repair for Data Science Code
Conference proceeding

Knowledge-Enhanced Program Repair for Data Science Code

Shuyin Ouyang, Jie M. Zhang, Zeyu Sun, Albert Merono Penuela and IEEE COMPUTER SOC
Proceedings of the IEEE/ACM 47th International Conference on Software Engineering, pp.898-910
ACM Conferences
ICSE '25: IEEE/ACM 47th International Conference on Software Engineering
27/04/2025

Abstract

General and reference General and reference -- Cross-computing tools and techniques General and reference -- Cross-computing tools and techniques -- Empirical studies Software and its engineering Software and its engineering -- Software creation and management Software and its engineering -- Software creation and management -- Search-based software engineering Software and its engineering -- Software creation and management -- Software post-development issues Software and its engineering -- Software creation and management -- Software post-development issues -- Maintaining software Software and its engineering -- Software creation and management -- Software verification and validation Software and its engineering -- Software creation and management -- Software verification and validation -- Software defect analysis Software and its engineering -- Software notations and tools Software and its engineering -- Software notations and tools -- Software maintenance tools Software and its engineering -- Software organization and properties Software and its engineering -- Software organization and properties -- Contextual software domains Software and its engineering -- Software organization and properties -- Contextual software domains -- Operating systems Software and its engineering -- Software organization and properties -- Contextual software domains -- Operating systems -- Process management Software and its engineering -- Software organization and properties -- Contextual software domains -- Operating systems -- Process management -- Concurrency control
This paper introduces DSrepair, a knowledge-enhanced program repair approach designed to repair the buggy code generated by LLMs in the data science domain. DSrepair uses knowledge graph based RAG for API knowledge retrieval and bug knowledge enrichment to construct repair prompts for LLMs. Specifically, to enable knowledge graph-based API retrieval, we construct DS-KG (Data Science Knowledge Graph) for widely used data science libraries. For bug knowledge enrichment, we employ an abstract syntax tree (AST) to localize errors at the AST node level. We evaluate DSrepair's effectiveness against five state-of-the-art LLM-based repair baselines using four advanced LLMs on the DS-1000 dataset. The results show that DSrepair outperforms all five baselines. Specifically, when compared to the second-best baseline, DSrepair achieves substantial improvements, fixing 44.4%, 14.2%, 20.6%, and 32.1% more buggy code snippets for each of the four evaluated LLMs, respectively. Additionally, it achieves greater efficiency, reducing the number of tokens required per code task by 17.49%, 34.24%, 24.71%, and 17.59%, respectively.

Metrics

1 Record Views

Details

Logo image