Full text

Turn on search term navigation

© The Author(s) 2025. This work is published under http://creativecommons.org/licenses/by/4.0/ (the "License"). Notwithstanding the ProQuest Terms and Conditions, you may use this content in accordance with the terms of the License.

Abstract

We present a reinforcement learning framework that enhances natural language queries to improve DeepSeek code generation. A parametric refiner (Qwen with LoRA) is trained via REINFORCE while the generator remains fixed, using a scalar reward that can combine text similarity (BLEU-4, ROUGE-L, F1, Overlap) with execution signals (unit tests, syntax/timeout penalties). On the DS1000 benchmark (800 train / 200 test), RL4QE improves the code similarity by 34.3%. Ablations show that BLEU-4 is the most reliable text reward overall (with F1 competitive on a larger scale), and LoRA with rank outperforms complete fine-tuning on most metrics while being more parameter efficient. The approach is transferred across foundation models (e.g., Qwen1.5/2/2.5 variants), where architecture often matters more than size. RL4QE is easy to integrate in practice (LoRA in attention projections) and supports reproducibility.

Details

Title
Enhancing queries for code generation with reinforcement learning
Author
Yuan, Dawei 1 ; Liang, Guojun 2 ; Li, Tingting 1 ; Liu, Suping 1 

 School of Computer Science, Guangdong University of Science and Technology, 523083, Dongguan, China (ROR: https://ror.org/054fysp39) (GRID: grid.472284.f) 
 School of Information Technology, Halmstad University, 30118, Halmstad, Sweden (ROR: https://ror.org/03h0qfp10) (GRID: grid.73638.39) (ISNI: 0000 0000 9852 2034) 
Pages
37300
Section
Article
Publication year
2025
Publication date
2025
Publisher
Nature Publishing Group
e-ISSN
20452322
Source type
Scholarly Journal
Language of publication
English
ProQuest document ID
3264794527
Copyright
© The Author(s) 2025. This work is published under http://creativecommons.org/licenses/by/4.0/ (the "License"). Notwithstanding the ProQuest Terms and Conditions, you may use this content in accordance with the terms of the License.