NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

OpenCodeInterpreter: Integrating Code Generation with Execution and Refinement

Tianyu Zheng, Ge Zhang, Tianhao Shen, Xueling Liu, Bill Yuchen Lin, Jie Fu, Wenhu Chen, Xiang Yue

Introduction

While large language models (LLMs) have demonstrated significant prowess in code generation, most open-source models operate in a "one-shot" fashion, lacking the iterative refinement capabilities seen in proprietary systems like GPT-4 Code Interpreter. Programming is inherently iterative, involving a cycle of writing, executing, and debugging. OpenCodeInterpreter is a family of open-source models designed to bridge this gap by integrating execution feedback and human instructions into the generation process.

The Code-Feedback Dataset

The cornerstone of OpenCodeInterpreter is the Code-Feedback dataset, a large-scale collection of 68,000 multi-turn interactions. Unlike traditional datasets that pair a single prompt with a single solution, Code-Feedback captures the dynamic nature of coding. It includes sequences of code generation, execution logs (including compiler errors), and subsequent corrections.

To generate high-quality data at scale, the researchers employed an "LLM-in-the-loop" strategy. GPT-3.5 acted as the initial coder, a real-world compiler provided execution feedback, and GPT-4 simulated a human user providing critiques or suggestions. This synthetic approach allowed for the creation of 192,000 total turns of dialogue, covering complex logic and diverse programming scenarios.

Methodology: Execution and Human Feedback

OpenCodeInterpreter models (ranging from 7B to 70B parameters) are trained to process two distinct types of feedback:

  1. Execution Feedback: This includes raw compiler errors and runtime outputs. The model learns to interpret these logs to identify syntax errors, logical bugs, or resource issues.
  2. Human Feedback: This consists of natural language instructions. It allows the model to align its output with user intent, such as requests for better efficiency, different library usage, or stylistic changes.

The researchers found that these feedback types are complementary. While execution feedback is vital for technical correctness, human feedback is essential for high-level alignment and refinement.

Performance and Results

The integration of iterative feedback loops significantly boosts performance. The OpenCodeInterpreter-33B model, based on DeepSeekCoder, achieves state-of-the-art results for open-source models.

Performance of OpenCodeInterpreter across different feedback modes compared to GPT-4 and GPT-3.5.

As shown in the benchmarks, the 33B model's performance on HumanEval Pass@1 improves dramatically with feedback. Starting from a single-turn score of 79.3, it reaches 82.9 with execution feedback and 88.4 with human feedback—surpassing the standard GPT-4 baseline. When provided with "Oracle" (perfect) human feedback, the score climbs to 92.7, demonstrating the model's high ceiling for refinement.

Conclusion

OpenCodeInterpreter represents a significant step forward for open-source AI in software engineering. By moving beyond static generation and embracing the "write-execute-fix" workflow, these models achieve parity with top-tier proprietary systems. The release of the Code-Feedback dataset and the OpenCodeInterpreter models provides a robust foundation for future research into autonomous and collaborative coding agents.

Summary updated

BibTeX
@inproceedings{zheng2024opencodeinterpreter,
  author = {Tianyu Zheng and Ge Zhang and Tianhao Shen and Xueling Liu and Bill Yuchen Lin and Jie Fu and Wenhu Chen and Xiang Yue},
  title = {{OpenCodeInterpreter: Integrating Code Generation with Execution and Refinement}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.findings-acl.762},
}
Figure