Large Language Model Guided Self-Debugging Code Generation
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.
Community
๐ Think, Code, Debug, Repeat: PyCapsule's Human-Inspired Approach to Code Generation
Novel two-agent LLM framework that outperforms 32B models using just 7B parameters
Achieves SOTA with 96.5% accuracy on HumanEval and 25% improvement on BigCodeBench
Uses up to 3x fewer API calls than existing frameworks while maintaining higher accuracy
Introduces intelligent error handling and self-debugging capabilities
๐ก Why it matters:
While Large Language Models have revolutionized code generation, PyCapsule demonstrates that the future of AI-assisted programming isn't just about scaling up models. Our specialized modules - like intelligent error message processing and signature conversion - consistently enhance LLM performance without requiring additional computational resources. This hybrid approach shows that thoughtfully designed deterministic components can significantly boost AI capabilities while reducing resource usage. PyCapsule achieves state-of-the-art performance not through larger models or complex multi-agent systems, but through smart integration of focused, reliable software modules with LLM capabilities.
The beauty of this approach is that while LLM capabilities may vary, these specialized modules will always provide consistent, reliable support, making code generation more robust and efficient. PyCapsule points to a future where AI and traditional software engineering principles work in harmony, each amplifying the other's strengths.
Models citing this paper 0
No model linking this paper
Datasets citing this paper 0
No dataset linking this paper
Spaces citing this paper 0
No Space linking this paper
Collections including this paper 0
No Collection including this paper