Reproduce “CodeDPO: Aligning Code Models with Self Generated and Verified Source Code” on OpenResearch
Run Claude Code, Codex or any coding agent as a research agent: literature, hypotheses and experiments on your laptop, cluster or cloud GPUs.
Universal app for Apple silicon and Intel. Requires macOS 11 or later.
About this paper
Kechi Zhang, Ge Li, Yihong Dong, Jingjing Xu, Jun Zhang, Jing Su, Yongfei Liu, Zhi Jin
CodeDPO, a framework developed by researchers from Peking University and ByteDance, aligns large language models with both correct and efficient code generation using a novel self-generation and validation mechanism for preference data. It improves the HumanEval pass rate for DeepSeekCoder-6.7B from 73.17% to 83.54% and enhances runtime efficiency by 1.25 to 1.45 times on relevant benchmarks.
Key insights
- A PageRank-inspired self-generation and validation algorithm effectively curates high-quality, balanced preference data for code generation, reliably correlating with actual code accuracy (Spearman correlation of 0.8598 on HumanEval).
- Direct Preference Optimization (DPO) is a superior strategy for code model alignment when provided with well-balanced preference pairs, outperforming alternative methods like KTO and SFT for enhancing correctness and efficiency.
- Integrating both correctness and execution efficiency into the preference learning framework is crucial and yields demonstrable improvements in both aspects of code quality, moving beyond single-metric optimization.
Summary by alphaXiv.
Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.