MGS3 trains code search models on multi-granularity comment-code alignments, improving retrieval across function, block, and statement-level benchmarks.
Neural Code Search Revisited: Enhancing Code Snippet Retrieval through Natural Language Intent
1 Pith paper cite this work. Polarity classification is still indexing.
abstract
In this work, we propose and study annotated code search: the retrieval of code snippets paired with brief descriptions of their intent using natural language queries. On three benchmark datasets, we investigate how code retrieval systems can be improved by leveraging descriptions to better capture the intents of code snippets. Building on recent progress in transfer learning and natural language processing, we create a domain-specific retrieval model for code annotated with a natural language description. We find that our model yields significantly more relevant search results (with absolute gains up to 20.6% in mean reciprocal rank) compared to state-of-the-art code retrieval methods that do not use descriptions but attempt to compute the intent of snippets solely from unannotated code.
citation-role summary
citation-polarity summary
fields
cs.SE 1years
2025 1verdicts
CONDITIONAL 1roles
background 1polarities
background 1representative citing papers
citing papers explorer
-
MGS3: A Multi-Granularity Self-Supervised Code Search Framework
MGS3 trains code search models on multi-granularity comment-code alignments, improving retrieval across function, block, and statement-level benchmarks.