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.
Abstract (translated)
自动化代码生成在智能计算机编程和系统部署中日益重要。然而,当前的方法常常面临计算效率低下的挑战,并且缺乏强大的代码解析和错误修正机制。为此,我们提出了一种新颖的框架——PyCapsule,该框架采用简单而有效的双代理管道以及高效的自我调试模块来实现Python代码生成。PyCapsule具有复杂的提示推理、迭代错误处理及案例测试功能,确保了生成的高度稳定性、安全性和正确性。 在实践中,与最先进的方法相比,PyCapsule在HumanEval上的成功率提高了5.7%,在HumanEval-ET上提高了10.3%,在BigCodeBench上则大幅提升了24.4%。我们还观察到,在更多的自我调试尝试中,标准化的成功率有所下降,这可能是由于保留过程中有限和噪声的错误反馈导致的影响。 PyCapsule展示了其对促进轻量级且高效的代码生成技术应用于人工智能系统中的广泛影响。
URL
https://arxiv.org/abs/2502.02928