Abstract
We introduce AutoCoder, the first Large Language Model to surpass GPT-4 Turbo (April 2024) and GPT-4o in pass@1 on the Human Eval benchmark test (90.9% vs. 90.2%). In addition, AutoCoder offers a more versatile code interpreter compared to GPT-4 Turbo and GPT-4o. Its code interpreter can install external packages instead of being limited to built-in packages. AutoCoder's training data is a multi-turn dialogue dataset created by a system combining agent interaction and external code execution verification, a method we term AIEV-Instruct (Instruction Tuning with Agent-Interaction and Execution-Verified). Compared to previous large-scale code dataset generation methods, AIEV-Instruct reduces dependence on proprietary large models and provides an execution-validated code dataset.
Introduction: Breaking the Performance Ceiling
Training high-performing code models typically relies on "knowledge distillation," where a powerful "teacher" model (like GPT-4) generates synthetic instructions for a smaller "student" model. However, this approach faces two significant hurdles: the student often inherits the teacher's errors, and the cost of generating massive datasets via proprietary APIs is prohibitive. Furthermore, most existing code interpreters are "sandboxed," limiting their utility for real-world tasks requiring external libraries.
AutoCoder addresses these issues by introducing a verification-heavy training pipeline and an enhanced code interpreter capable of managing its own environment.
Methodology: AIEV-Instruct
The core innovation of AutoCoder is AIEV-Instruct (Instruction Tuning with Agent-Interaction and Execution-Verified). This system simulates a professional development workflow using two primary roles: a Questioner and a Programmer.
The process involves:
- Multi-Agent Interaction: The Questioner defines the problem and unit tests, while the Programmer writes the code.
- Execution Verification: Code is executed in a Docker container. If it fails, the error message (
Stderr) is returned to the Questioner to prompt a fix. This loop continues for up to 7 iterations until the code passes. - Two-Stage Evolution: Initially, a proprietary model (GPT-4 Turbo) acts as the agents (Teaching Stage). Once AutoCoder reaches a performance threshold, it takes over these roles (Self-learning Stage), allowing for autonomous, cost-effective data generation.
Dataset Construction
The researchers curated a dataset of 169K high-quality code instruction samples, resulting in 241K dialogue rounds. By refining existing datasets like Magicoder-Evol-Instruct through the AIEV-Instruct pipeline, the team ensured that the training data was not just plausible but verified as correct. AutoCoder (33B) was fine-tuned using only 320 million tokens, demonstrating that data quality and verification are more impactful than sheer volume.
Key Results and Performance
AutoCoder (33B) achieved a record-breaking 90.9% pass@1 on the HumanEval benchmark, surpassing both GPT-4o and GPT-4 Turbo.
Beyond the headline HumanEval score, AutoCoder demonstrated:
- Multilingual Proficiency: Strong performance in Java (61.4%), C++ (68.9%), and Rust (60.8%), often outperforming models specifically tuned for those languages.
- Data Science Capabilities: On the DS-1000 benchmark, it surpassed GPT-4 Turbo on Matplotlib tasks and was the only model besides GPT-4 to achieve an overall pass@1 exceeding 45%.
- Versatile Interpreter: Unlike many sandboxed models, AutoCoder can identify when a task requires an external library and generate
pip installcommands to set up the necessary environment dynamically.
Conclusion and Limitations
AutoCoder proves that execution feedback is a powerful "source of truth" that allows open-source models to break the performance ceiling. By verifying code against unit tests, the model can identify and discard errors in the training data.
However, the system currently caps feedback at 7 iterations, which may not suffice for extremely complex bugs. Additionally, as AutoCoder is fine-tuned from DeepSeek-Coder, it remains influenced by the underlying architecture's limits. Future work will explore more complex agent configurations and scaling the self-learning stage to further widen the gap over proprietary models.
Summary updated