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.
Loading