SEAISep 8, 2024

A Pair Programming Framework for Code Generation via Multi-Plan Exploration and Feedback-Driven Refinement

arXiv:2409.05001v134 citationsh-index: 3Has Code
Originality Incremental advance
AI Analysis

This addresses code generation for developers by improving accuracy on complex programming problems, though it is incremental as it builds on existing LLM-based methods.

The paper tackles the problem of rigid solution plans in code generation by proposing PairCoder, a framework with two collaborative LLM agents for multi-plan exploration and feedback-driven refinement, achieving relative pass@1 improvements of 12.00%-162.43% over direct prompting.

Large language models (LLMs) have achieved impressive performance on code generation. Although prior studies enhanced LLMs with prompting techniques and code refinement, they still struggle with complex programming problems due to rigid solution plans. In this paper, we draw on pair programming practices to propose PairCoder, a novel LLM-based framework for code generation. PairCoder incorporates two collaborative LLM agents, namely a Navigator agent for high-level planning and a Driver agent for specific implementation. The Navigator is responsible for proposing promising solution plans, selecting the current optimal plan, and directing the next iteration round based on execution feedback. The Driver follows the guidance of Navigator to undertake initial code generation, code testing, and refinement. This interleaved and iterative workflow involves multi-plan exploration and feedback-based refinement, which mimics the collaboration of pair programmers. We evaluate PairCoder with both open-source and closed-source LLMs on various code generation benchmarks. Extensive experimental results demonstrate the superior accuracy of PairCoder, achieving relative pass@1 improvements of 12.00%-162.43% compared to prompting LLMs directly.

Code Implementations1 repo
Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes