paper-with-me

홈 › Papers

Learning to Represent Programs with Heterogeneous Graphs

2020-12-08 · Kechi Zhang, Wenhan Wang, Huangzhao Zhang, Ge Li, Zhi Jin

Program source code contains complex structure information, which can be represented in structured data forms like trees or graphs. To acquire the structural information in source code, most existing researches use abstract syntax trees (AST). A group of works add additional edges to ASTs to convert source code into graphs and use graph neural networks to learn representations for program graphs. Although these works provide additional control or data flow information to ASTs for downstream tasks, they neglect an important aspect of structure information in AST itself: the different types of nodes and edges. In ASTs, different nodes contain different kinds of information like variables or control flow, and the relation between a node and all its children can also be different. To address the information of node and edge types, we bring the idea of heterogeneous graphs to learning on source code and present a new formula of building heterogeneous program graphs from ASTs with additional type information for nodes and edges. We use the ASDL grammar of programming language to define the node and edge types of program graphs. Then we use heterogeneous graph neural networks to learn on these graphs. We evaluate our approach on two tasks: code comment generation and method naming. Both tasks require reasoning on the semantics of complete code snippets. Experiment results show that our approach outperforms baseline models, including homogeneous graph-based models, showing that leveraging the type information of nodes and edges in program graphs can help in learning program semantics.

📄 PDF Abstract BibTeX arXiv:2012.04188

Code (0)

등록된 구현이 없습니다.

Tasks

Code Comment GenerationComment Generation

Similar Papers 제목 키워드 기반

End-to-end Mapping in Heterogeneous Systems Using Graph Representation Learning

2022-04-25 · Yao Xiao, Guixiang Ma, Nesreen K. Ahmed, Mihai Capota 외

To enable heterogeneous computing systems with autonomous programming and optimization capabilities, we propose a unified, end-to-end, programmable graph representation learning (PGL) framework that is capable of mining …

Graph Representation LearningRepresentation Learning

A Library for Representing Python Programs as Graphs for Machine Learning

2022-08-15 · David Bieber, Kensen Shi, Petros Maniatis, Charles Sutton 외

Graph representations of programs are commonly a central element of machine learning for code research. We introduce an open source Python library python_graphs that applies static analysis to construct graph representat…

TpuGraphs: A Performance Prediction Dataset on Large Tensor Computational Graphs

2023-08-25 · NeurIPS 2023 11 · Phitchaya Mangpo Phothilimthana, Sami Abu-El-Haija, Kaidi Cao, Bahare Fatemi 외

Precise hardware performance models play a crucial role in code optimizations. They can assist compilers in making heuristic decisions or aid autotuners in identifying the optimal configuration for a given program. For e…

Graph Property PredictionPredictionProperty PredictionRuntime ranking

Convolutional Neural Networks over Control Flow Graphs for Software Defect Prediction

2018-02-14 · Anh Viet Phan, Minh Le Nguyen, Lam Thu Bui

Existing defects in software components is unavoidable and leads to not only a waste of time and money but also many serious consequences. To build predictive models, previous studies focus on manually extracting feature…

Teaching machines to understand data science code by semantic enrichment of dataflow graphs

2018-07-16 · Evan Patterson, Ioana Baldini, Aleksandra Mojsilovic, Kush R. Varshney

Your computer is continuously executing programs, but does it really understand them? Not in any meaningful sense. That burden falls upon human knowledge workers, who are increasingly asked to write and understand code. …