mlsanityData to 7 Oct 2026

Enhancing the Non-Functional Quality Compliance of LLM-Generated Code through Quality-Aware Preference Learning

arXiv 2503.09020 ↗First posted 12 Mar 2025cs.SE cs.AIcited by 1

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

  1. 2020Language Models are Few-Shot Learnerscited by 32,199
  2. 2023GPT-4 Technical Reportcited by 18,132
  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. 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,304
  6. 2021Program Synthesis with Large Language Modelscited by 3,509
  7. 2023Code Llama: Open Foundation Models for Codecited by 2,105
  8. 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Codecited by 1,906
  9. 2024SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineeringcited by 1,628
  10. 2022Competition-Level Code Generation with AlphaCodecited by 1,427
  11. 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,154
  12. 2024Qwen2.5-Coder Technical Reportcited by 1,151
17 more
  1. 2021Measuring Coding Challenge Competence With APPScited by 879
  2. 2022CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learningcited by 342
  3. 2024AutoCodeRover: Autonomous Program Improvementcited by 272
  4. 2023The Impact of AI on Developer Productivity: Evidence from GitHub Copilotcited by 264
  5. 2023OctoPack: Instruction Tuning Code Large Language Modelscited by 178
  6. 2023Large Language Models for Code: Security Hardening and Adversarial Testingcited by 149
  7. 2022Calibrating Sequence likelihood Improves Conditional Language Generationcited by 121
  8. 2023Execution-based Code Generation using Deep Reinforcement Learningcited by 95
  9. 2023Refining ChatGPT-Generated Code: Characterizing and Mitigating Code Quality Issuescited by 78
  10. 2023A Large-Scale Survey on the Usability of AI Programming Assistants: Successes and Challengescited by 75
  11. 2023Evaluating the Code Quality of AI-Assisted Code Generation Tools: An Empirical Study on GitHub Copilot, Amazon CodeWhisperer, and ChatGPTcited by 71
  12. 2024Instruction Tuning for Secure Code Generationcited by 63
  13. 2022Compilable Neural Code Generation with Compiler Feedbackcited by 46
  14. 2024Prompting Techniques for Secure Code Generation: A Systematic Investigationcited by 33
  15. 2023InstructCoder: Instruction Tuning Large Language Models for Code Editingcited by 28
  16. 2024Optimizing Large Language Model Hyperparameters for Code Generationcited by 10
  17. 2024Creative and Correct: Requesting Diverse Code Solutions from AI Foundation Modelscited by 2

Built on by

Cited by year

Citing papers per year: 2025: 1.

1 paper.

Similar, not cited

Close in wording, no citation either way

  1. 2026Reward-Free Code Alignment from Pretrained or Fine-Tuned LLM: Unpacking the Trade-offs for Code Generation
  2. 2024CodeLutra: Boosting LLM Code Generation via Preference-Guided Refinement
  3. 2025Teaching Your Models to Understand Code via Focal Preference Alignment
  4. 2025Learning to Align Human Code Preferences
  5. 2024DSTC: Direct Preference Learning with Only Self-Generated Tests and Code to Improve Code LMs
  6. 2026Improving Code Translation with Syntax-Guided and Semantic-aware Preference Optimization
  7. 2024Learning Code Preference via Synthetic Evolution
  8. 2026Self-Improving Code Generation via Semantic Entropy and Behavioral Consensus