Self-Improving Code Generation via Semantic Entropy and Behavioral Consensus
On the map: LLM alignment / RLHF / preference optimisation → Process reward models for reasoning
Abstract (arXiv)
Improving the code generation capabilities of large language models (LLMs) typically relies on supervised fine-tuning or preference optimization, both of which require costly external resources such as powerful teacher models or reliable test units. However, in real-world scenarios, it is much harder to obtain reference solutions and test oracles than problem descriptions and test inputs. In this paper, we tackle a challenging yet realistic question: Can a code language model improve itself without access to a superior teacher and a test oracle? To answer this, we propose ConSelf, a self-improving approach built upon two key ideas. First, we introduce code semantic entropy, a novel metric that measures problem-level uncertainty by assessing the functional diversity of program behaviors, enabling a curriculum construction with the most learnable problems. Second, we present consensus-driven direct preference optimization (Con-DPO), a preference-based fine-tuning method that weights each preference pair by its behavioral consensus, thereby mitigating the impact of noisy self-generated supervision. Experiments on various benchmarks and backbone LLMs demonstrate that ConSelf significantly outperforms baselines, validating the effectiveness of semantic entropy-based curriculum construction and consensus-driven optimization in improving code generation without external supervision.
Key facts. Cited by 1 paper 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 39 of its 56 references that are in the map. First posted on arXiv 31 Mar 2026.
Builds on
39 of 56 references.
Closest ancestors · 2
Same direction, newest first
- 2025Dynamic Scaling of Unit Tests for Code Reward Modeling2 Jan
- 2024Preference Optimization for Reasoning with Pseudo Feedback25 Nov
Other references · 37
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 7,916
- 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,767
- 2021Program Synthesis with Large Language Modelscited by 3,509
- 2023Code Llama: Open Foundation Models for Codecited by 2,105
- 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Codecited by 1,906
- 2022Competition-Level Code Generation with AlphaCodecited by 1,427
- 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,332
- 2021Measuring Coding Challenge Competence With APPScited by 879
- 2023WizardCoder: Empowering Code Large Language Models with Evol-Instructcited by 728
- 2022Large Language Models Can Self-Improvecited by 656
- 2022CodeT: Code Generation with Generated Testscited by 369
25 more
- 2022CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learningcited by 342
- 2023A Survey of Confidence Estimation and Calibration in Large Language Modelscited by 253
- 2023Magicoder: Empowering Code Generation with OSS-Instructcited by 251
- 2023TACO: Topics in Algorithmic COde generation datasetcited by 150
- 2023Structured Chain-of-Thought Prompting for Code Generationcited by 136
- 2023Self-planning Code Generation with Large Language Modelscited by 121
- 2025KodCode: A Diverse, Challenging, and Verifiable Synthetic Dataset for Codingcited by 115
- 2023RLTF: Reinforcement Learning from Unit Test Feedbackcited by 110
- 2024SelfCodeAlign: Self-Alignment for Code Generationcited by 61
- 2021TOGA: A Neural Method for Test Oracle Generationcited by 57
- 2025OpenCodeInstruct: A Large-scale Instruction Tuning Dataset for Code LLMscited by 57
- 2022Pynguin: Automated Unit Test Generation for Pythoncited by 49
- 2023WaveCoder: Widespread And Versatile Enhancement For Code Large Language Models By Instruction Tuningcited by 42
- 2024TESTEVAL: Benchmarking Large Language Models for Test Case Generationcited by 38
- 2024CodeDPO: Aligning Code Models with Self Generated and Verified Source Codecited by 32
- 2024Large Language Models as Test Case Generators: Performance Evaluation and Enhancementcited by 27
- 2024TOGLL: Correct and Strong Test Oracle Generation with LLMscited by 23
- 2025HardTests: Synthesizing High-Quality Test Cases for LLM Codingcited by 22
- 2024A Pair Programming Framework for Code Generation via Multi-Plan Exploration and Feedback-Driven Refinementcited by 21
- 2025Revisit Self-Debugging with Self-Generated Tests for Code Generationcited by 21
- 2024Code-Optimise: Self-Generated Preference Data for Correctness and Efficiencycited by 16
- 2025Learning to Generate Unit Tests for Automated Debuggingcited by 16
- 2024LLM-Powered Test Case Generation for Detecting Bugs in Plausible Programscited by 14
- 2025Focused-DPO: Enhancing Code Generation Through Focused Preference Optimization on Error-Prone Pointscited by 14
- 2024DolphCoder: Echo-Locating Code Large Language Models with Diverse and Multi-Objective Instruction Tuningcited by 11
Built on by
Citing papers per year: 2026: 1.
1 paper.
Similar, not cited
Close in wording, no citation either way
- 2025Learning to Align Human Code Preferences
- 2024Learning Code Preference via Synthetic Evolution
- 2024CodeLutra: Boosting LLM Code Generation via Preference-Guided Refinement
- 2024HumanEval Pro and MBPP Pro: Evaluating Large Language Models on Self-invoking Code Generation
- 2026Ensemble-Based Uncertainty Estimation for Code Correctness Estimation ↗
- 2025CodeChemist: Test-Time Scaling for Low-Resource Code Generation via Functional Knowledge Transfer
- 2024Comments as Natural Logic Pivots: Improve Code Generation via Comment Perspective
- 2025Alignment with Fill-In-the-Middle for Enhancing Code Generation