Command Palette
Search for a command to run...
Neural Code Search Revisited: Enhancing Code Snippet Retrieval through Natural Language Intent
Heyman Geert ; Van Cutsem Tom

Abstract
In this work, we propose and study annotated code search: the retrieval ofcode snippets paired with brief descriptions of their intent using naturallanguage queries. On three benchmark datasets, we investigate how coderetrieval systems can be improved by leveraging descriptions to better capturethe intents of code snippets. Building on recent progress in transfer learningand natural language processing, we create a domain-specific retrieval modelfor code annotated with a natural language description. We find that our modelyields significantly more relevant search results (with absolute gains up to20.6% in mean reciprocal rank) compared to state-of-the-art code retrievalmethods that do not use descriptions but attempt to compute the intent ofsnippets solely from unannotated code.
Code Repositories
Benchmarks
| Benchmark | Methodology | Metrics |
|---|---|---|
| annotated-code-search-on-pacs-conala | USE | MRR: 0.181 |
| annotated-code-search-on-pacs-conala | Ensemble:USE-tuned+NCS | MRR: 0.351 |
| annotated-code-search-on-pacs-conala | NCS | MRR: 0.167 |
| annotated-code-search-on-pacs-conala | USE-tuned | MRR: 0.340 |
| annotated-code-search-on-pacs-so-ds | USE-tuned | MRR: 0.304 |
| annotated-code-search-on-pacs-so-ds | USE | MRR: 0.244 |
| annotated-code-search-on-pacs-so-ds | Ensemble:USE-tuned+NCS | MRR: 0.323 |
| annotated-code-search-on-pacs-so-ds | NCS | MRR: 0.113 |
| annotated-code-search-on-pacs-staqc-py | USE-tuned | MRR: 0.117 |
| annotated-code-search-on-pacs-staqc-py | USE | MRR: 0.104 |
| annotated-code-search-on-pacs-staqc-py | NCS | MRR: 0.030 |
| annotated-code-search-on-pacs-staqc-py | Ensemble:USE-tuned+NCS | MRR: 0.126 |
Build AI with AI
From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.