Reproduce “GNN-Coder: Boosting Semantic Code Retrieval with Combined GNNs and Transformer” on OpenResearch
Turn your favorite coding agents into research agents that review literature, develop hypotheses, and run experiments.
Universal app for Apple silicon and Intel. Requires macOS 11 or later.
About this paper
Yufan Ye, Pu Pang, Ting Zhang, Hua Huang
GNN-Coder integrates Graph Neural Networks with Transformer models to enhance semantic code retrieval by fully leveraging Abstract Syntax Tree (AST) structural information. The framework improves retrieval accuracy across various programming languages and generates more uniformly distributed code embeddings, as quantified by a new Mean Angular Margin metric.
Key insights
- Explicitly leveraging complete Abstract Syntax Tree (AST) structural information via GNNs, rather than flattening them, significantly improves semantic code retrieval performance.
- The proposed ASTGPool pooling method, tailored to ASTs by considering both node features and connectivity, is effective in aggregating information and enhancing code representations.
- Optimizing for embedding uniformity, quantified by the new Mean Angular Margin (MAM) metric, correlates with improved retrieval performance and more discriminative code representations.
Summary by alphaXiv.
Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.