Enriching Query Semantics for Code Search with Reinforcement Learning
Not on the map. Why?
Abstract (arXiv)
Code search is a common practice for developers during software implementation. The challenges of accurate code search mainly lie in the knowledge gap between source code and natural language (i.e., queries). Due to the limited code-query pairs and large code-description pairs available, the prior studies based on deep learning techniques focus on learning the semantic matching relation between source code and corresponding description texts for the task, and hypothesize that the semantic gap between descriptions and user queries is marginal. In this work, we found that the code search models trained on code-description pairs may not perform well on user queries, which indicates the semantic distance between queries and code descriptions. To mitigate the semantic distance for more effective code search, we propose QueCos, a Query-enriched Code search model. QueCos learns to generate semantic enriched queries to capture the key semantics of given queries with reinforcement learning (RL). With RL, the code search performance is considered as a reward for producing accurate semantic enriched queries. The enriched queries are finally employed for code search. Experiments on the benchmark datasets show that QueCos can significantly outperform the state-of-the-art code search models.
Key facts. Cited by 7 papers in the map (data through 14 Oct 2026). First posted on arXiv 20 May 2021.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2022: 1; 2023: 1; 2024: 1; 2025: 1; 2026: 3.
7 papers.
- 2023Reinforcement Learning for Generative AI: A Surveycited by 11
- 2025RANGER -- Repository-Level Agent for Graph-Enhanced Retrievalcited by 7
- 2026AlignCoder: Aligning Retrieval with Target Intent for Repository-Level Code Completioncited by 7
- 2024An Empirical Study on Large Language Models in Accuracy and Robustness under Chinese Industrial Scenarioscited by 3
- 2026DRAINCODE: Stealthy Energy Consumption Attacks on Retrieval-Augmented Code Generation via Context Poisoningcited by 3
- 2026PhoenixRepair: Rethinking Repair Strategy Exploration in Software Agentscited by 2
- 2022CSSAM:Code Search via Attention Matching of Code Semantics and Structurescited by 0
- 2026PhoenixRepair: Rethinking Repair Strategy Exploration in Software Agents21 Jul 2026
- 2026DRAINCODE: Stealthy Energy Consumption Attacks on Retrieval-Augmented Code Generation via Context Poisoning28 Jan 2026
- 2026AlignCoder: Aligning Retrieval with Target Intent for Repository-Level Code Completion27 Jan 2026
- 2025RANGER -- Repository-Level Agent for Graph-Enhanced Retrieval27 Sep 2025
- 2024An Empirical Study on Large Language Models in Accuracy and Robustness under Chinese Industrial Scenarios27 Jan 2024
- 2023Reinforcement Learning for Generative AI: A Survey28 Aug 2023
- 2022CSSAM:Code Search via Attention Matching of Code Semantics and Structures8 Aug 2022