CodeDPO: Aligning Code Models with Self Generated and Verified Source Code
Not on the map. Why?
Abstract (arXiv)
Code generation models have shown significant potential for programming tasks. However, existing training methods like supervised fine-tuning face key limitations: they do not effectively teach models to prioritize correct over incorrect solutions in ambiguous situations, nor do they effectively optimize the runtime efficiency of the generated code. To address these challenges, we propose CodeDPO, a framework that integrates preference learning into code generation to improve two key code preference factors: code correctness and efficiency. CodeDPO employs a novel dataset construction method, utilizing a self-generation-and-validation mechanism that simultaneously generates and evaluates code and test cases. The underlying assumption is that test cases executable by multiple code snippets provide more reliable validation, and code that passes more tests is more likely to be correct. Through this self-validation process, our PageRank-inspired algorithm iteratively updates the ranking score of each code snippet, ultimately creating a code preference optimization dataset based on correctness and efficiency. CodeDPO is flexible and scalable, generating diverse preference optimization data without depending on external resources. Through comprehensive evaluations of five widely used benchmarks, CodeDPO demonstrates significant improvements in correctness and efficiency compared to existing methods. Our experiments prove that CodeDPO enhances the capabilities of LLMs in code generation and provides a robust foundation for conducting code preference optimization in more complex and challenging real-world scenarios.
Key facts. Cited by 34 papers in the map (data through 14 Oct 2026). First posted on arXiv 8 Oct 2024.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2025: 24; 2026: 10.
34 papers.
Sort:
By area:
- 2025Visual-RFT: Visual Reinforcement Fine-Tuningcited by 513
- 2025Unified Multimodal Chain-of-Thought Reward Model through Reinforcement Fine-Tuningcited by 90
- 2025VLN-R1: Vision-Language Navigation via Reinforcement Fine-Tuningcited by 63
- 2025JarvisArt: Liberating Human Artistic Creativity via an Intelligent Photo Retouching Agentcited by 39
- 2025A Survey of Direct Preference Optimizationcited by 36
- 2025Learning to Solve and Verify: A Self-Play Framework for Code and Test Generationcited by 35
- 2025Process-Supervised Reinforcement Learning for Code Generationcited by 22
- 2025GraphCodeAgent: Dual Graph-Guided LLM Agent for Retrieval-Augmented Repo-Level Code Generationcited by 17
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligencecited by 15
- 2025GRE Suite: Geo-localization Inference via Fine-Tuned Vision-Language Models and Enhanced Reasoning Chainscited by 14
- 2025SEAlign: Alignment Training for Software Engineering Agentcited by 11
- 2026Fine-R1: Make Multi-modal LLMs Excel in Fine-Grained Visual Recognition by Chain-of-Thought Reasoningcited by 11
22 more
- 2025RefineCoder: Iterative Improving of Large Language Models via Adaptive Critique Refinement for Code Generationcited by 8
- 2025Boosting Vulnerability Detection of LLMs via Curriculum Preference Optimization with Synthetic Reasoning Datacited by 8
- 2025GEMeX-RMCoT: An Enhanced Med-VQA Dataset for Region-Aware Multimodal Chain-of-Thought Reasoningcited by 8
- 2025R2Vul: Learning to Reason about Software Vulnerabilities with Reinforcement Learning and Structured Reasoning Distillationcited by 7
- 2025Smoke and Mirrors: Jailbreaking LLM-based Code Generation via Implicit Malicious Promptscited by 5
- 2025DecoupledESC: Enhancing Emotional Support Generation via Strategy-Response Decoupled Preference Optimizationcited by 5
- 2025CodeEvo: Interaction-Driven Synthesis of Code-centric Data through Hybrid and Iterative Feedbackcited by 5
- 2025Alignment with Fill-In-the-Middle for Enhancing Code Generationcited by 4
- 2025How Many Code and Test Cases Are Enough? Evaluating Test Cases Generation from a Binary-Matrix Perspectivecited by 4
- 2025VEHME: A Vision-Language Model For Evaluating Handwritten Mathematics Expressionscited by 4
- 2025CRPE: Expanding The Reasoning Capability of Large Language Model for Code Generationcited by 2
- 2025Learning to Align Human Code Preferencescited by 1
- 2026Self-Improving Code Generation via Semantic Entropy and Behavioral Consensuscited by 1
- 2026MiniOpt: Reasoning to Model and Solve General Optimization Problems with Limited Resourcescited by 1
- 2025Enhancing LLM Reasoning via Non-Human-Like Reasoning Path Preference Optimizationcited by 0
- 2026Specificity-aware reinforcement learning for fine-grained open-world classificationcited by 0
- 2026Improving Code Translation with Syntax-Guided and Semantic-aware Preference Optimizationcited by 0
- 2026Learn from Your Mistakes: Tree-like Self-Play for Secure Code LLMscited by 0
- 2026Reward-Free Code Alignment from Pretrained or Fine-Tuned LLM: Unpacking the Trade-offs for Code Generationcited by 0
- 2026GeoReward: Mitigating Contextual Variable Overestimation in Vision-Language Models for Cross-Market Preference Predictioncited by 0
- 2026Function-Level Execution Feedback for Code Preference Optimizationcited by 0
- 2026Not All Correct Fixes Run Alike: An Empirical Study of Patch Performance in Repository-Level Issue Resolutioncited by 0
- 2026Not All Correct Fixes Run Alike: An Empirical Study of Patch Performance in Repository-Level Issue Resolution9 Oct 2026
- 2026Function-Level Execution Feedback for Code Preference Optimization23 Aug 2026
- 2026GeoReward: Mitigating Contextual Variable Overestimation in Vision-Language Models for Cross-Market Preference Prediction5 Aug 2026
- 2026Reward-Free Code Alignment from Pretrained or Fine-Tuned LLM: Unpacking the Trade-offs for Code Generation27 Jun 2026
- 2026MiniOpt: Reasoning to Model and Solve General Optimization Problems with Limited Resources24 Jun 2026
- 2026Learn from Your Mistakes: Tree-like Self-Play for Secure Code LLMs2 Jun 2026
- 2026Improving Code Translation with Syntax-Guided and Semantic-aware Preference Optimization13 May 2026
- 2026Self-Improving Code Generation via Semantic Entropy and Behavioral Consensus31 Mar 2026
- 2026Specificity-aware reinforcement learning for fine-grained open-world classification3 Mar 2026
- 2026Fine-R1: Make Multi-modal LLMs Excel in Fine-Grained Visual Recognition by Chain-of-Thought Reasoning7 Feb 2026
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligence23 Nov 2025
- 2025VEHME: A Vision-Language Model For Evaluating Handwritten Mathematics Expressions26 Oct 2025
22 more
- 2025Enhancing LLM Reasoning via Non-Human-Like Reasoning Path Preference Optimization13 Oct 2025
- 2025How Many Code and Test Cases Are Enough? Evaluating Test Cases Generation from a Binary-Matrix Perspective9 Oct 2025
- 2025Alignment with Fill-In-the-Middle for Enhancing Code Generation27 Aug 2025
- 2025Learning to Align Human Code Preferences27 Jul 2025
- 2025CodeEvo: Interaction-Driven Synthesis of Code-centric Data through Hybrid and Iterative Feedback25 Jul 2025
- 2025GEMeX-RMCoT: An Enhanced Med-VQA Dataset for Region-Aware Multimodal Chain-of-Thought Reasoning22 Jun 2025
- 2025JarvisArt: Liberating Human Artistic Creativity via an Intelligent Photo Retouching Agent21 Jun 2025
- 2025VLN-R1: Vision-Language Navigation via Reinforcement Fine-Tuning20 Jun 2025
- 2025Boosting Vulnerability Detection of LLMs via Curriculum Preference Optimization with Synthetic Reasoning Data9 Jun 2025
- 2025GRE Suite: Geo-localization Inference via Fine-Tuned Vision-Language Models and Enhanced Reasoning Chains24 May 2025
- 2025DecoupledESC: Enhancing Emotional Support Generation via Strategy-Response Decoupled Preference Optimization22 May 2025
- 2025CRPE: Expanding The Reasoning Capability of Large Language Model for Code Generation15 May 2025
- 2025Unified Multimodal Chain-of-Thought Reward Model through Reinforcement Fine-Tuning6 May 2025
- 2025GraphCodeAgent: Dual Graph-Guided LLM Agent for Retrieval-Augmented Repo-Level Code Generation14 Apr 2025
- 2025R2Vul: Learning to Reason about Software Vulnerabilities with Reinforcement Learning and Structured Reasoning Distillation7 Apr 2025
- 2025SEAlign: Alignment Training for Software Engineering Agent24 Mar 2025
- 2025Smoke and Mirrors: Jailbreaking LLM-based Code Generation via Implicit Malicious Prompts23 Mar 2025
- 2025A Survey of Direct Preference Optimization12 Mar 2025
- 2025Visual-RFT: Visual Reinforcement Fine-Tuning3 Mar 2025
- 2025Learning to Solve and Verify: A Self-Play Framework for Code and Test Generation20 Feb 2025
- 2025RefineCoder: Iterative Improving of Large Language Models via Adaptive Critique Refinement for Code Generation13 Feb 2025
- 2025Process-Supervised Reinforcement Learning for Code Generation3 Feb 2025
- 2025Visual-RFT: Visual Reinforcement Fine-Tuningcited by 513
- 2025Unified Multimodal Chain-of-Thought Reward Model through Reinforcement Fine-Tuningcited by 90
- 2025GRE Suite: Geo-localization Inference via Fine-Tuned Vision-Language Models and Enhanced Reasoning Chainscited by 14
- 2026Fine-R1: Make Multi-modal LLMs Excel in Fine-Grained Visual Recognition by Chain-of-Thought Reasoningcited by 11
- 2025RefineCoder: Iterative Improving of Large Language Models via Adaptive Critique Refinement for Code Generationcited by 8
- 2025Boosting Vulnerability Detection of LLMs via Curriculum Preference Optimization with Synthetic Reasoning Datacited by 8
- 2025GEMeX-RMCoT: An Enhanced Med-VQA Dataset for Region-Aware Multimodal Chain-of-Thought Reasoningcited by 8
- 2025R2Vul: Learning to Reason about Software Vulnerabilities with Reinforcement Learning and Structured Reasoning Distillationcited by 7
- 2025CRPE: Expanding The Reasoning Capability of Large Language Model for Code Generationcited by 2
- 2026MiniOpt: Reasoning to Model and Solve General Optimization Problems with Limited Resourcescited by 1
- 2025Enhancing LLM Reasoning via Non-Human-Like Reasoning Path Preference Optimizationcited by 0
- 2026MiniOpt: Reasoning to Model and Solve General Optimization Problems with Limited Resources24 Jun 2026
- 2026Fine-R1: Make Multi-modal LLMs Excel in Fine-Grained Visual Recognition by Chain-of-Thought Reasoning7 Feb 2026
- 2025Enhancing LLM Reasoning via Non-Human-Like Reasoning Path Preference Optimization13 Oct 2025
- 2025GEMeX-RMCoT: An Enhanced Med-VQA Dataset for Region-Aware Multimodal Chain-of-Thought Reasoning22 Jun 2025
- 2025Boosting Vulnerability Detection of LLMs via Curriculum Preference Optimization with Synthetic Reasoning Data9 Jun 2025
- 2025GRE Suite: Geo-localization Inference via Fine-Tuned Vision-Language Models and Enhanced Reasoning Chains24 May 2025
- 2025CRPE: Expanding The Reasoning Capability of Large Language Model for Code Generation15 May 2025
- 2025Unified Multimodal Chain-of-Thought Reward Model through Reinforcement Fine-Tuning6 May 2025
- 2025R2Vul: Learning to Reason about Software Vulnerabilities with Reinforcement Learning and Structured Reasoning Distillation7 Apr 2025
- 2025Visual-RFT: Visual Reinforcement Fine-Tuning3 Mar 2025
- 2025RefineCoder: Iterative Improving of Large Language Models via Adaptive Critique Refinement for Code Generation13 Feb 2025
- 2025A Survey of Direct Preference Optimizationcited by 36
- 2025DecoupledESC: Enhancing Emotional Support Generation via Strategy-Response Decoupled Preference Optimizationcited by 5
- 2025Alignment with Fill-In-the-Middle for Enhancing Code Generationcited by 4
- 2025Learning to Align Human Code Preferencescited by 1
- 2026Self-Improving Code Generation via Semantic Entropy and Behavioral Consensuscited by 1
- 2026Improving Code Translation with Syntax-Guided and Semantic-aware Preference Optimizationcited by 0
- 2026Reward-Free Code Alignment from Pretrained or Fine-Tuned LLM: Unpacking the Trade-offs for Code Generationcited by 0
- 2026Reward-Free Code Alignment from Pretrained or Fine-Tuned LLM: Unpacking the Trade-offs for Code Generation27 Jun 2026
- 2026Improving Code Translation with Syntax-Guided and Semantic-aware Preference Optimization13 May 2026
- 2026Self-Improving Code Generation via Semantic Entropy and Behavioral Consensus31 Mar 2026
- 2025Alignment with Fill-In-the-Middle for Enhancing Code Generation27 Aug 2025
- 2025Learning to Align Human Code Preferences27 Jul 2025
- 2025DecoupledESC: Enhancing Emotional Support Generation via Strategy-Response Decoupled Preference Optimization22 May 2025
- 2025A Survey of Direct Preference Optimization12 Mar 2025
- 2025JarvisArt: Liberating Human Artistic Creativity via an Intelligent Photo Retouching Agentcited by 39
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligencecited by 15
- 2025SEAlign: Alignment Training for Software Engineering Agentcited by 11
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligence23 Nov 2025
- 2025JarvisArt: Liberating Human Artistic Creativity via an Intelligent Photo Retouching Agent21 Jun 2025
- 2025SEAlign: Alignment Training for Software Engineering Agent24 Mar 2025
- 2025VLN-R1: Vision-Language Navigation via Reinforcement Fine-Tuningcited by 63
- 2025Process-Supervised Reinforcement Learning for Code Generationcited by 22
- 2025CodeEvo: Interaction-Driven Synthesis of Code-centric Data through Hybrid and Iterative Feedbackcited by 5
- 2025How Many Code and Test Cases Are Enough? Evaluating Test Cases Generation from a Binary-Matrix Perspectivecited by 4
- 2026Function-Level Execution Feedback for Code Preference Optimizationcited by 0
- 2026Not All Correct Fixes Run Alike: An Empirical Study of Patch Performance in Repository-Level Issue Resolutioncited by 0
- 2026Not All Correct Fixes Run Alike: An Empirical Study of Patch Performance in Repository-Level Issue Resolution9 Oct 2026
- 2026Function-Level Execution Feedback for Code Preference Optimization23 Aug 2026
- 2025How Many Code and Test Cases Are Enough? Evaluating Test Cases Generation from a Binary-Matrix Perspective9 Oct 2025
- 2025CodeEvo: Interaction-Driven Synthesis of Code-centric Data through Hybrid and Iterative Feedback25 Jul 2025
- 2025VLN-R1: Vision-Language Navigation via Reinforcement Fine-Tuning20 Jun 2025
- 2025Process-Supervised Reinforcement Learning for Code Generation3 Feb 2025