Code Generation Using Self-Interactive Assistant

Zixiao Zhao,Jing Sun,Cheng-Hao Cai,Zhiyuan Wei
DOI: https://doi.org/10.1109/compsac61105.2024.00377
2024-01-01
Abstract:The rise of large language models (LLMs) has expanded the possibilities for generative tasks. While LLMs excel at tasks like information retrieval and question-answering, conventional code generation LLMs often struggle to maintain fidelity to prompts, leading to coding hallucinations that produce inaccurate results. In this study, we present Self Coder, a self-guided, single-agent framework for code generation utilising the OpenAI Assistant API built upon GPT-4. By tapping into a comprehensive Python code knowledge base, Self Coder creates an initial draft and refines it iteratively through a feedback loop using the Code Interpreter tool. This approach minimizes contextual inconsistencies and significantly reduces errors, achieving state-of-the-art results on the HumanEval and MBPP datasets, outperforming other code generation frameworks.
What problem does this paper attempt to address?