We gratefully acknowledge support from
the Simons Foundation and member institutions.
Full-text links:

Download:

Current browse context:

cs.SE

Change to browse by:

cs

References & Citations

DBLP - CS Bibliography

Bookmark

(what is this?)
CiteULike logo BibSonomy logo Mendeley logo del.icio.us logo Digg logo Reddit logo

Computer Science > Software Engineering

Title: GraphCode2Vec: Generic Code Embedding via Lexical and Program Dependence Analyses

Abstract: Code embedding is a keystone in the application of machine learning on several Software Engineering (SE) tasks, e.g., method name prediction and code clone detection. To be effective, the embedding needs to capture program semantics in a way that is effective and generic, in a sense being able to effectively support a plethora of SE tasks. To this end, we propose an approach (called GraphCode2Vec) thatcaptures program semantics through lexical and program dependence features via an effective combination of code analysis and Graph Neural Networks. GraphCode2Vec is generic, i.e., it allows pre-training, and it is effectively applicable to several SE downstream tasks. We evaluate the effectiveness of GraphCode2Vec on three (3) tasks (method name prediction, solution classification and code clone detection), and compare it with four (4) similarly generic code embedding baselines (Code2Seq, Code2Vec, CodeBERT, GraphCodeBERT) and seven (7) task-specific, learning-based methods. In particular, GraphCode2Vec is more effective than both generic and task-specific learning-based baselines for all three tasks, with the exception of one task where it is slightly less effective than GraphCodeBERT. We also demonstrate through a purposely designed probing and ablation study that GraphCode2Vec effectively learns lexical and program dependence features and that pre-training improves its effectiveness.
Subjects: Software Engineering (cs.SE)
Cite as: arXiv:2112.01218 [cs.SE]
  (or arXiv:2112.01218v1 [cs.SE] for this version)

Submission history

From: Wei Ma [view email]
[v1] Thu, 2 Dec 2021 13:39:10 GMT (422kb,D)
[v2] Fri, 21 Jan 2022 16:39:11 GMT (403kb,D)

Link back to: arXiv, form interface, contact.