Alignment with Fill-In-the-Middle for Enhancing Code Generation
By: Houxing Ren , Zimu Lu , Weikang Shi and more
Potential Business Impact:
Makes computers write better computer code.
The code generation capabilities of Large Language Models (LLMs) have advanced applications like tool invocation and problem-solving. However, improving performance in code-related tasks remains challenging due to limited training data that is verifiable with accurate test cases. While Direct Preference Optimization (DPO) has shown promise, existing methods for generating test cases still face limitations. In this paper, we propose a novel approach that splits code snippets into smaller, granular blocks, creating more diverse DPO pairs from the same test cases. Additionally, we introduce the Abstract Syntax Tree (AST) splitting and curriculum training method to enhance the DPO training. Our approach demonstrates significant improvements in code generation tasks, as validated by experiments on benchmark datasets such as HumanEval (+), MBPP (+), APPS, LiveCodeBench, and BigCodeBench. Code and data are available at https://github.com/SenseLLM/StructureCoder.
Similar Papers
Learning to Align Human Code Preferences
Software Engineering
Teaches computers to write better code.
DPO-F+: Aligning Code Repair Feedback with Developers' Preferences
Software Engineering
Helps computers explain code fixes to people.
Teaching Your Models to Understand Code via Focal Preference Alignment
Computation and Language
Teaches computers to fix their own coding mistakes.