mlsanityData to 7 Oct 2026

DSTC: Direct Preference Learning with Only Self-Generated Tests and Code to Improve Code LMs

arXiv 2411.13611 ↗First posted 20 Nov 2024cs.SE cs.AIcited by 9

On the map: LLM alignment / RLHF / preference optimisation → Process reward models for reasoning

also in 1 more
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

  1. 2023GPT-4 Technical Reportcited by 18,132
  2. 2017Proximal Policy Optimization Algorithmscited by 14,441
  3. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  4. 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 7,916
  5. 2021Program Synthesis with Large Language Modelscited by 3,509
  6. 2023Code Llama: Open Foundation Models for Codecited by 2,105
  7. 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,332
  8. 2024Qwen2.5-Coder Technical Reportcited by 1,151
  9. 2023A General Theoretical Paradigm to Understand Learning from Human Preferencescited by 906
  10. 2023WizardCoder: Empowering Code Large Language Models with Evol-Instructcited by 728
  11. 2024A Survey on Large Language Models for Code Generationcited by 646
  12. 2024ORPO: Monolithic Preference Optimization without Reference Modelcited by 556
25 more
  1. 2024BigCodeBench: Benchmarking Code Generation with Diverse Function Calls and Complex Instructionscited by 527
  2. 2024StarCoder 2 and The Stack v2: The Next Generationcited by 484
  3. 2024Negative Preference Optimization: From Catastrophic Collapse to Effective Unlearningcited by 484
  4. 2023SLiC-HF: Sequence Likelihood Calibration with Human Feedbackcited by 395
  5. 2022CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learningcited by 342
  6. 2024DeepSeek-Coder-V2: Breaking the Barrier of Closed-Source Models in Code Intelligencecited by 325
  7. 2023Statistical Rejection Sampling Improves Preference Optimizationcited by 321
  8. 2024Large Language Models for Mathematical Reasoning: Progresses and Challengescited by 283
  9. 2023Magicoder: Empowering Code Generation with OSS-Instructcited by 251
  10. 2024Smaug: Fixing Failure Modes of Preference Optimisation with DPO-Positivecited by 239
  11. 2024Self-Play Preference Optimization for Language Model Alignmentcited by 228
  12. 2020Implementation Matters in Deep Policy Gradients: A Case Study on PPO and TRPOcited by 184
  13. 2024Preference Fine-Tuning of LLMs Should Leverage Suboptimal, On-Policy Datacited by 184
  14. 2024Direct Nash Optimization: Teaching Language Models to Self-Improve with General Preferencescited by 176
  15. 2024Generalized Preference Optimization: A Unified Approach to Offline Alignmentcited by 155
  16. 2023RLTF: Reinforcement Learning from Unit Test Feedbackcited by 110
  17. 2024Provably Mitigating Overoptimization in RLHF: Your SFT Loss is Implicitly an Adversarial Regularizercited by 109
  18. 2023Execution-based Code Generation using Deep Reinforcement Learningcited by 95
  19. 2024StepCoder: Improve Code Generation with Reinforcement Learning from Compiler Feedbackcited by 74
  20. 2024Self-Exploring Language Models: Active Preference Elicitation for Online Alignmentcited by 63
  21. 2024SelfCodeAlign: Self-Alignment for Code Generationcited by 61
  22. 2024Policy Filtration for RLHF to Mitigate Noise in Reward Modelscited by 21
  23. 2024Code-Optimise: Self-Generated Preference Data for Correctness and Efficiencycited by 16
  24. 2024Reward-Augmented Data Enhances Direct Preference Alignment of LLMscited by 10
  25. 2024Just Say What You Want: Only-prompting Self-rewarding Online Preference Optimizationcited by 1

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2025: 6; 2026: 3.

9 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2025Learning to Align Human Code Preferences
  2. 2024PLUM: Improving Code LMs with Execution-Guided On-Policy Preference Learning Driven By Synthetic Test Cases
  3. 2024CodeLutra: Boosting LLM Code Generation via Preference-Guided Refinement
  4. 2025Enhancing the Non-Functional Quality Compliance of LLM-Generated Code through Quality-Aware Preference Learning
  5. 2024Learning Code Preference via Synthetic Evolution
  6. 2024Aligning CodeLLMs with Direct Preference Optimization
  7. 2026Self-Improving Code Generation via Semantic Entropy and Behavioral Consensus
  8. 2025Alignment with Fill-In-the-Middle for Enhancing Code Generation