DSTC: Direct Preference Learning with Only Self-Generated Tests and Code to Improve Code LMs
On the map: LLM alignment / RLHF / preference optimisation → Process reward models for reasoning
Abstract (arXiv)
Direct preference learning offers a promising and computation-efficient beyond supervised fine-tuning (SFT) for improving code generation in coding large language models (LMs). However, the scarcity of reliable preference data is a bottleneck for the performance of direct preference learning to improve the coding accuracy of code LMs. In this paper, we introduce underlineDirect Preference Learning with Only underlineSelf-Generated underlineTests and underlineCode (DSTC), a framework that leverages only self-generated code snippets and tests to construct reliable preference pairs such that direct preference learning can improve LM coding accuracy without external annotations. DSTC combines a minimax selection process and test-code concatenation to improve preference pair quality, reducing the influence of incorrect self-generated tests and enhancing model performance without the need for costly reward models. When applied with direct preference learning methods such as Direct Preference Optimization (DPO) and Kahneman-Tversky Optimization (KTO), DSTC yields stable improvements in coding accuracy (pass@1 score) across diverse coding benchmarks, including HumanEval, MBPP, and BigCodeBench, demonstrating both its effectiveness and scalability for models of various sizes. This approach autonomously enhances code generation accuracy across LLMs of varying sizes, reducing reliance on expensive annotated coding datasets.
Key facts. Cited by 9 papers in the map (data through 7 Oct 2026). Placed in Process reward models for reasoning, one of 10 directions in LLM alignment / RLHF / preference optimisation. Builds on 37 of its 47 references that are in the map. First posted on arXiv 20 Nov 2024.
Builds on
37 of 47 references.
References · 37
- 2023GPT-4 Technical Reportcited by 18,132
- 2017Proximal Policy Optimization Algorithmscited by 14,441
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 7,916
- 2021Program Synthesis with Large Language Modelscited by 3,509
- 2023Code Llama: Open Foundation Models for Codecited by 2,105
- 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,332
- 2024Qwen2.5-Coder Technical Reportcited by 1,151
- 2023A General Theoretical Paradigm to Understand Learning from Human Preferencescited by 906
- 2023WizardCoder: Empowering Code Large Language Models with Evol-Instructcited by 728
- 2024A Survey on Large Language Models for Code Generationcited by 646
- 2024ORPO: Monolithic Preference Optimization without Reference Modelcited by 556
25 more
- 2024BigCodeBench: Benchmarking Code Generation with Diverse Function Calls and Complex Instructionscited by 527
- 2024StarCoder 2 and The Stack v2: The Next Generationcited by 484
- 2024Negative Preference Optimization: From Catastrophic Collapse to Effective Unlearningcited by 484
- 2023SLiC-HF: Sequence Likelihood Calibration with Human Feedbackcited by 395
- 2022CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learningcited by 342
- 2024DeepSeek-Coder-V2: Breaking the Barrier of Closed-Source Models in Code Intelligencecited by 325
- 2023Statistical Rejection Sampling Improves Preference Optimizationcited by 321
- 2024Large Language Models for Mathematical Reasoning: Progresses and Challengescited by 283
- 2023Magicoder: Empowering Code Generation with OSS-Instructcited by 251
- 2024Smaug: Fixing Failure Modes of Preference Optimisation with DPO-Positivecited by 239
- 2024Self-Play Preference Optimization for Language Model Alignmentcited by 228
- 2020Implementation Matters in Deep Policy Gradients: A Case Study on PPO and TRPOcited by 184
- 2024Preference Fine-Tuning of LLMs Should Leverage Suboptimal, On-Policy Datacited by 184
- 2024Direct Nash Optimization: Teaching Language Models to Self-Improve with General Preferencescited by 176
- 2024Generalized Preference Optimization: A Unified Approach to Offline Alignmentcited by 155
- 2023RLTF: Reinforcement Learning from Unit Test Feedbackcited by 110
- 2024Provably Mitigating Overoptimization in RLHF: Your SFT Loss is Implicitly an Adversarial Regularizercited by 109
- 2023Execution-based Code Generation using Deep Reinforcement Learningcited by 95
- 2024StepCoder: Improve Code Generation with Reinforcement Learning from Compiler Feedbackcited by 74
- 2024Self-Exploring Language Models: Active Preference Elicitation for Online Alignmentcited by 63
- 2024SelfCodeAlign: Self-Alignment for Code Generationcited by 61
- 2024Policy Filtration for RLHF to Mitigate Noise in Reward Modelscited by 21
- 2024Code-Optimise: Self-Generated Preference Data for Correctness and Efficiencycited by 16
- 2024Reward-Augmented Data Enhances Direct Preference Alignment of LLMscited by 10
- 2024Just Say What You Want: Only-prompting Self-rewarding Online Preference Optimizationcited by 1
Built on by
Citing papers per year: 2025: 6; 2026: 3.
9 papers.
- 2025SWE-smith: Scaling Data for Software Engineering Agentscited by 255
- 2025ACECODER: Acing Coder RL via Automated Test-Case Synthesiscited by 89
- 2025Teaching Your Models to Understand Code via Focal Preference Alignmentcited by 10
- 2025Scoring Verifiers: Evaluating Synthetic Verification for Code and Reasoningcited by 8
- 2025Code Reasoning for Software Engineering Tasks: A Survey and A Call to Actioncited by 4
- 2025GiFT: Gibbs Fine-Tuning for Code Generationcited by 3
- 2026ACE: Self-Evolving LLM Coding Framework via Adversarial Unit Test Generation and Preference Optimizationcited by 3
- 2026InfoSynth: Information-Guided Benchmark Synthesis for LLMscited by 1
- 2026Themis: Training Robust Multilingual Code Reward Models for Flexible Multi-Criteria Scoringcited by 0
- 2026Themis: Training Robust Multilingual Code Reward Models for Flexible Multi-Criteria Scoring1 May 2026
- 2026ACE: Self-Evolving LLM Coding Framework via Adversarial Unit Test Generation and Preference Optimization17 Apr 2026
- 2026InfoSynth: Information-Guided Benchmark Synthesis for LLMs2 Jan 2026
- 2025Code Reasoning for Software Engineering Tasks: A Survey and A Call to Action16 Jun 2025
- 2025SWE-smith: Scaling Data for Software Engineering Agents30 Apr 2025
- 2025Teaching Your Models to Understand Code via Focal Preference Alignment4 Mar 2025
- 2025Scoring Verifiers: Evaluating Synthetic Verification for Code and Reasoning19 Feb 2025
- 2025GiFT: Gibbs Fine-Tuning for Code Generation17 Feb 2025
- 2025ACECODER: Acing Coder RL via Automated Test-Case Synthesis3 Feb 2025
Similar, not cited
Close in wording, no citation either way
- 2025Learning to Align Human Code Preferences
- 2024PLUM: Improving Code LMs with Execution-Guided On-Policy Preference Learning Driven By Synthetic Test Cases
- 2024CodeLutra: Boosting LLM Code Generation via Preference-Guided Refinement
- 2025Enhancing the Non-Functional Quality Compliance of LLM-Generated Code through Quality-Aware Preference Learning
- 2024Learning Code Preference via Synthetic Evolution
- 2024Aligning CodeLLMs with Direct Preference Optimization
- 2026Self-Improving Code Generation via Semantic Entropy and Behavioral Consensus
- 2025Alignment with Fill-In-the-Middle for Enhancing Code Generation