English

Multimodal Representation for Neural Code Search

Software Engineering 2022-01-14 v3 Machine Learning

Abstract

Semantic code search is about finding semantically relevant code snippets for a given natural language query. In the state-of-the-art approaches, the semantic similarity between code and query is quantified as the distance of their representation in the shared vector space. In this paper, to improve the vector space, we introduce tree-serialization methods on a simplified form of AST and build the multimodal representation for the code data. We conduct extensive experiments using a single corpus that is large-scale and multi-language: CodeSearchNet. Our results show that both our tree-serialized representations and multimodal learning model improve the performance of code search. Last, we define intuitive quantification metrics oriented to the completeness of semantic and syntactic information of the code data, to help understand the experimental findings.

Keywords

Cite

@article{arxiv.2107.00992,
  title  = {Multimodal Representation for Neural Code Search},
  author = {Jian Gu and Zimin Chen and Martin Monperrus},
  journal= {arXiv preprint arXiv:2107.00992},
  year   = {2022}
}

Comments

12 pages, 9 figures, 7 tables, accepted by ICSME 2021, the camera-ready version

R2 v1 2026-06-24T03:50:24.669Z