Large Language Model Guided Self-Debugging Code Generation

📅 2025-02-05
📈 Citations: 0
Influential: 0
📄 PDF

career value

160K/year
🤖 AI Summary
Existing automatic code generation methods suffer from limitations in computational efficiency, parsing accuracy, and error correction capability. To address these issues, this paper proposes PyCapsule, a lightweight dual-agent framework featuring a novel large language model (LLM)-driven self-debugging architecture. PyCapsule integrates an error-feedback-aware iterative refinement mechanism to enable fully autonomous, end-to-end code generation, debugging, and verification—without human intervention. Technically, it unifies prompt engineering, static program analysis, dynamic error localization, test case generation, and feedback filtering with resampling. Extensive experiments demonstrate that PyCapsule achieves absolute improvements of +5.7%, +10.3%, and +24.4% over state-of-the-art baselines on HumanEval, HumanEval-ET, and BigCodeBench, respectively. These gains reflect substantial enhancements in generated code correctness, robustness, and production readiness.

Technology Category

Application Category

📝 Abstract
Automated code generation is gaining significant importance in intelligent computer programming and system deployment. However, current approaches often face challenges in computational efficiency and lack robust mechanisms for code parsing and error correction. In this work, we propose a novel framework, PyCapsule, with a simple yet effective two-agent pipeline and efficient self-debugging modules for Python code generation. PyCapsule features sophisticated prompt inference, iterative error handling, and case testing, ensuring high generation stability, safety, and correctness. Empirically, PyCapsule achieves up to 5.7% improvement of success rate on HumanEval, 10.3% on HumanEval-ET, and 24.4% on BigCodeBench compared to the state-of-art methods. We also observe a decrease in normalized success rate given more self-debugging attempts, potentially affected by limited and noisy error feedback in retention. PyCapsule demonstrates broader impacts on advancing lightweight and efficient code generation for artificial intelligence systems.
Problem

Research questions and friction points this paper is trying to address.

Enhances computational efficiency in code generation
Improves code parsing and error correction
Advances lightweight code generation for AI systems
Innovation

Methods, ideas, or system contributions that make the work stand out.

Two-agent pipeline for Python code generation
Efficient self-debugging modules for error correction
Sophisticated prompt inference for generation stability
🔎 Similar Papers
No similar papers found.