[Paper Review] A study on Prompt Design, Advantages and Limitations of ChatGPT for Deep Learning Program Repair
The paper evaluates ChatGPT's ability to debug, locate faults, and repair deep learning (DL) programs, and shows that enhanced prompt design and dialogue can substantially improve repair performance compared to baselines.
ChatGPT has revolutionized many research and industrial fields. ChatGPT has shown great potential in software engineering to boost various traditional tasks such as program repair, code understanding, and code generation. However, whether automatic program repair (APR) applies to deep learning (DL) programs is still unknown. DL programs, whose decision logic is not explicitly encoded in the source code, have posed unique challenges to APR. While to repair DL programs, an APR approach needs to not only parse the source code syntactically but also needs to understand the code intention. With the best prior work, the performance of fault localization is still far less than satisfactory (only about 30\%). Therefore, in this paper, we explore ChatGPT's capability for DL program repair by asking three research questions. (1) Can ChatGPT debug DL programs effectively? (2) How can ChatGPT's repair performance be improved by prompting? (3) In which way can dialogue help facilitate the repair? On top of that, we categorize the common aspects useful for prompt design for DL program repair. Also, we propose various prompt templates to facilitate the performance and summarize the advantages and disadvantages of ChatGPT's abilities such as detecting bad code smell, code refactoring, and detecting API misuse/deprecation.
Motivation & Objective
- Assess ChatGPT's effectiveness in debugging DL programs (fault detection, localization, repair).
- Investigate how prompting strategies influence ChatGPT's repair performance on DL code.
- Explore the role of multi-turn dialogue in facilitating DL program repair.
- Categorize prompt-design factors that influence DL program repair outcomes.
Proposed method
- Use a DL program repair benchmark of 58 buggy programs with multiple dependencies (TensorFlow, PyTorch, etc.).
- Compare ChatGPT against AutoTrainer and DeepFD baselines for fault detection, localization, and repair.
- Evaluate three prompt templates: basic (PT-B), enhanced (PT-E), and prompt-dialogue variants integrated with fault-location information (PT-Loc, PT-IncR).
- Run five independent ChatGPT requests per query to account for non-determinism and report majority conclusions.
- Analyze real-world developer questions to inform prompt design and derive an enhanced prompt template.
- Document prompts and responses for reproducibility.

Experimental results
Research questions
- RQ1RQ1: Can ChatGPT debug DL programs effectively (fault detection, localization, repair) compared to baselines?
- RQ2RQ2: How can ChatGPT’s repair performance be improved by prompting (template design, code intention, dependency/version awareness)?
- RQ3RQ3: Can dialogue (multi-turn interaction) further facilitate the repair process?
Key findings
- ChatGPT with the basic prompt detects faults in 27 of 34 buggy DL programs, while the DeepFD baseline detects all 34/34.
- An enhanced prompt (PT-E) improves fault detection to 34/34 and doubles correct fault localization (from 23 to 50) and triples correct repairs (from 16 to 43).
- When using PT-E, 16/34 cases can be fully repaired versus 6/34 with PT-B, showing substantial gains from clearer intent and task/dataset guidance.
- Incorporating real-world prompt information (symptom, task, dataset, version/dependency, etc.) yields significant gains in fault localization and repair accuracy.
- Dialogue-based prompting (adding fault-location guidance and iterative corrections) further increases correct repairs (from 16 to 43 in the PT-E regime).
- ChatGPT shows strengths in detecting API misuse/deprecation and code smells but struggles with default parameter identification and maintaining correct localization without explicit repair objectives.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.