paper-with-me

Papers

Enhancing High-Quality Code Generation in Large Language Models with Comparative Prefix-Tuning

2025-03-12 · Yuan Jiang, Yujian Zhang, Liang Lu, Christoph Treude, Xiaohong Su, Shan Huang, Tiantian Wang

Large Language Models (LLMs) have been widely adopted in commercial code completion engines, significantly enhancing coding efficiency and productivity. However, LLMs may generate code with quality issues that violate coding standards and best practices, such as poor code style and maintainability, even when the code is functionally correct. This necessitates additional effort from developers to improve the code, potentially negating the efficiency gains provided by LLMs. To address this problem, we propose a novel comparative prefix-tuning method for controllable high-quality code generation. Our method introduces a single, property-specific prefix that is prepended to the activations of the LLM, serving as a lightweight alternative to fine-tuning. Unlike existing methods that require training multiple prefixes, our approach trains only one prefix and leverages pairs of high-quality and low-quality code samples, introducing a sequence-level ranking loss to guide the model's training. This comparative approach enables the model to better understand the differences between high-quality and low-quality code, focusing on aspects that impact code quality. Additionally, we design a data construction pipeline to collect and annotate pairs of high-quality and low-quality code, facilitating effective training. Extensive experiments on the Code Llama 7B model demonstrate that our method improves code quality by over 100% in certain task categories, while maintaining functional correctness. We also conduct ablation studies and generalization experiments, confirming the effectiveness of our method's components and its strong generalization capability.

📄 PDF Abstract BibTeX arXiv:2503.09020

Code (1)

YuanJiangGit/EnhancedCQ 공식 구현 pytorch

Tasks

Code CompletionCode Generation

Methods 이 논문이 사용한 방법론

LLaMA LLaMA is a collection of foundation language models ranging from 7B to 65B parameters. It is based on the transformer architecture with various improvements that were…

Similar Papers 제목 키워드 기반

HyperRAG: Enhancing Quality-Efficiency Tradeoffs in Retrieval-Augmented Generation with Reranker KV-Cache Reuse

2025-04-03 · Yuwei An, Yihua Cheng, Seo Jin Park, Junchen Jiang

Retrieval-Augmented Generation (RAG) has emerged as a powerful paradigm for enhancing the performance of large language models (LLMs) by integrating external knowledge into the generation process. A key component of RAG …

DecoderRAGRetrieval-augmented Generation

EffiCoder: Enhancing Code Generation in Large Language Models through Efficiency-Aware Fine-tuning

2024-10-14 · Dong Huang, Guangtao Zeng, Jianbo Dai, Meng Luo 외

As large language models (LLMs) play an increasingly important role in code generation, enhancing both correctness and efficiency has become crucial. Current methods primarily focus on correctness, often overlooking effi…

Code Generation

Reinforcement Learning from Automatic Feedback for High-Quality Unit Test Generation

2024-12-18 · Benjamin Steenhoek, Michele Tufano, Neel Sundaresan, Alexey Svyatkovskiy

Software testing is a crucial but time-consuming aspect of software development, and recently, Large Language Models (LLMs) have gained popularity for automated test case generation. However, because LLMs are trained on …

software testing

UniTSyn: A Large-Scale Dataset Capable of Enhancing the Prowess of Large Language Models for Program Testing

2024-02-04 · Yifeng He, Jiabo Huang, Yuyang Rong, Yiwen Guo 외

The remarkable capability of large language models (LLMs) in generating high-quality code has drawn increasing attention in the software testing community. However, existing code LLMs often demonstrate unsatisfactory cap…

software testing

PillarGen: Enhancing Radar Point Cloud Density and Quality via Pillar-based Point Generation Network

2024-03-04 · Jisong Kim, Geonho Bang, Kwangjin Choi, Minjae Seong 외

In this paper, we present a novel point generation model, referred to as Pillar-based Point Generation Network (PillarGen), which facilitates the transformation of point clouds from one domain into another. PillarGen can…

object-detectionObject Detection