Towards Better Correctness and Efficiency in Code Generation
Not on the map. Why?
Abstract (arXiv)
While code large language models have demonstrated remarkable progress in code generation, the generated code often exhibits poor runtime efficiency, limiting its practical application in performance-sensitive scenarios. To address this limitation, we propose an efficiency-oriented reinforcement learning framework guided by a novel performance reward. Based on this framework, we take a deeper dive into the code efficiency problem, identifying then proposing methods to overcome key bottlenecks: (1) Dynamic exploration overcomes the static data constraints of offline fine-tuning, enabling the discovery of more efficient code implementations. (2) The error-insensitive reinforcement learning method and high-contrast efficiency signals are crucial for mitigating systematic errors and achieving effective optimization. (3) Online exploration is most effective when starting from a high-correctness baseline, as this allows for efficiency improvements without sacrificing accuracy. With these discoveries, we finally propose a two-stage tuning method, which achieves high and balanced performance across correctness and efficiency. The results of experiments show the effectiveness of the method, which improves code correctness by 10.18% and runtime efficiency by 7.75% on a 7B model, achieving performance comparable to much larger model.
Key facts. Cited by 9 papers in the map (data through 14 Oct 2026). Builds on 11 of its 19 references that are in the map. First posted on arXiv 24 Aug 2025.
Builds on
11 of 19 references.
References · 11
- 2024The Llama 3 Herd of Modelscited by 14,715
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
- 2024DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Modelscited by 9,379
- 2023Qwen Technical Reportcited by 3,344
- 2024HybridFlow: A Flexible and Efficient RLHF Frameworkcited by 2,057
- 2024LlamaFactory: Unified Efficient Fine-Tuning of 100+ Language Modelscited by 1,464
- 2024Qwen2.5-Coder Technical Reportcited by 1,203
- 2024StarCoder 2 and The Stack v2: The Next Generationcited by 502
- 2024Evaluating Language Models for Efficient Code Generationcited by 73
- 2024ACECode: A Reinforcement Learning Framework for Aligning Code Efficiency and Correctness in Code Language Modelscited by 10
- 2025LLM4EFFI: Leveraging Large Language Models to Enhance Code Efficiency and Correctnesscited by 10
Built on by
Citing papers per year: 2025: 3; 2026: 6.
9 papers.
- 2025The Landscape of Agentic Reinforcement Learning for LLMs: A Surveycited by 205
- 2025A Survey on Agentic Multimodal Large Language Modelscited by 23
- 2025FasterPy: An LLM-based Code Execution Efficiency Optimization Frameworkcited by 3
- 2026BranPO: Scalable Contrastive Branch Sampling for Long-Horizon Agentic Reinforcement Learningcited by 3
- 2026Themis: Training Robust Multilingual Code Reward Models for Flexible Multi-Criteria Scoringcited by 1
- 2026Groupwise Agentic Grading and Advantage Redistribution for Code Agent RLcited by 1
- 2026AutoVecCoder: Teaching LLMs to Generate Explicitly Vectorized Codecited by 0
- 2026Rethinking Code Performance Benchmarks for LLMscited 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
- 2026Groupwise Agentic Grading and Advantage Redistribution for Code Agent RL26 Sep 2026
- 2026Rethinking Code Performance Benchmarks for LLMs8 Jul 2026
- 2026AutoVecCoder: Teaching LLMs to Generate Explicitly Vectorized Code18 May 2026
- 2026Themis: Training Robust Multilingual Code Reward Models for Flexible Multi-Criteria Scoring1 May 2026
- 2026BranPO: Scalable Contrastive Branch Sampling for Long-Horizon Agentic Reinforcement Learning3 Feb 2026
- 2025FasterPy: An LLM-based Code Execution Efficiency Optimization Framework28 Dec 2025
- 2025A Survey on Agentic Multimodal Large Language Models13 Oct 2025
- 2025The Landscape of Agentic Reinforcement Learning for LLMs: A Survey2 Sep 2025
Similar, not cited
Close in wording, no citation either way
- 2025Afterburner: Reinforcement Learning Facilitates Self-Improving Code Efficiency Optimization
- 2024Enhancing Code LLMs with Reinforcement Learning in Code Generation: A Survey
- 2024StepCoder: Improve Code Generation with Reinforcement Learning from Compiler Feedback
- 2026RLPF: Reinforcement Learning from Performance Feedback for Code Generation
- 2026MaxCode: A Max-Reward Reinforcement Learning Framework for Automated Code Optimization
- 2024Process Supervision-Guided Policy Optimization for Code Generation
- 2023Execution-based Code Generation using Deep Reinforcement Learning
- 2026Reinforcement Learning for Code Optimization