Enhancing the Non-Functional Quality Compliance of LLM-Generated Code through Quality-Aware Preference Learning
Not on the map. Why?
Abstract (arXiv)
Large Language Models (LLMs) have been widely adopted in commercial code completion engines, significantly enhancing coding efficiency and productivity. However, even functionally correct LLM-generated code may exhibit non-functional quality issues that violate coding standards and best practices, such as poor style and limited maintainability. To address this, we propose a framework for quality-aware preference learning that guides LLMs toward generating criteria-compliant code. Our approach consists of three phases. First, we construct a dataset of paired criteria-violating and criteria-compliant samples, where each pair contains code exhibiting a specific non-functional quality issue and its repaired version that resolves the issue. Second, we design an adaptive token weighting mechanism to emphasize quality-sensitive code regions. Third, we introduce a hybrid optimization objective that combines ranking loss with language modeling loss and KL divergence to enable effective comparative optimization. Extensive experiments on DeepSeek-Coder and Qwen2.5-Coder show that our method substantially improves compliance with the targeted non-functional quality criteria while maintaining functional correctness, achieving a 75.7% relative increase in Quality Reciprocal Score (QRS) on MBPP-sanitized for Qwen2.5-Coder. Fine-tuning a 7B model requires less than three hours, indicating strong practical viability. Ablation studies and a user study further support the effectiveness of the proposed framework.
Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Builds on 29 of its 57 references that are in the map. First posted on arXiv 12 Mar 2025.
Builds on
29 of 57 references.
References · 29
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2023GPT-4 Technical Reportcited by 18,132
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 7,916
- 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,304
- 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
- 2024SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineeringcited by 1,628
- 2022Competition-Level Code Generation with AlphaCodecited by 1,427
- 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,154
- 2024Qwen2.5-Coder Technical Reportcited by 1,151
17 more
- 2021Measuring Coding Challenge Competence With APPScited by 879
- 2022CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learningcited by 342
- 2024AutoCodeRover: Autonomous Program Improvementcited by 272
- 2023The Impact of AI on Developer Productivity: Evidence from GitHub Copilotcited by 264
- 2023OctoPack: Instruction Tuning Code Large Language Modelscited by 178
- 2023Large Language Models for Code: Security Hardening and Adversarial Testingcited by 149
- 2022Calibrating Sequence likelihood Improves Conditional Language Generationcited by 121
- 2023Execution-based Code Generation using Deep Reinforcement Learningcited by 95
- 2023Refining ChatGPT-Generated Code: Characterizing and Mitigating Code Quality Issuescited by 78
- 2023A Large-Scale Survey on the Usability of AI Programming Assistants: Successes and Challengescited by 75
- 2023Evaluating the Code Quality of AI-Assisted Code Generation Tools: An Empirical Study on GitHub Copilot, Amazon CodeWhisperer, and ChatGPTcited by 71
- 2024Instruction Tuning for Secure Code Generationcited by 63
- 2022Compilable Neural Code Generation with Compiler Feedbackcited by 46
- 2024Prompting Techniques for Secure Code Generation: A Systematic Investigationcited by 33
- 2023InstructCoder: Instruction Tuning Large Language Models for Code Editingcited by 28
- 2024Optimizing Large Language Model Hyperparameters for Code Generationcited by 10
- 2024Creative and Correct: Requesting Diverse Code Solutions from AI Foundation Modelscited by 2
Built on by
Citing papers per year: 2025: 1.
1 paper.
Similar, not cited
Close in wording, no citation either way
- 2026Reward-Free Code Alignment from Pretrained or Fine-Tuned LLM: Unpacking the Trade-offs for Code Generation
- 2024CodeLutra: Boosting LLM Code Generation via Preference-Guided Refinement
- 2025Teaching Your Models to Understand Code via Focal Preference Alignment
- 2025Learning to Align Human Code Preferences
- 2024DSTC: Direct Preference Learning with Only Self-Generated Tests and Code to Improve Code LMs
- 2026Improving Code Translation with Syntax-Guided and Semantic-aware Preference Optimization
- 2024Learning Code Preference via Synthetic Evolution
- 2026Self-Improving Code Generation via Semantic Entropy and Behavioral Consensus