Reproduce “Learning to Represent Programs with Graphs” 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

Miltiadis Allamanis, Marc Brockschmidt, Mahmoud Khademi

This work introduces a comprehensive graph representation for source code, integrating both syntactic and diverse semantic information, and employs Gated Graph Neural Networks (GGNNs) to learn deep program representations. The approach achieved 85.5% accuracy on a new variable misuse prediction task and 53.6% accuracy on variable naming, leading to the discovery of six real-world bugs in mature open-source projects.

Key insights

  • Explicitly modeling both syntactic and diverse semantic relationships in a comprehensive program graph significantly enhances a machine learning model's ability to understand and reason about source code structure and behavior.
  • Gated Graph Neural Networks effectively learn meaningful, generalizable representations from heterogeneous program graphs, outperforming traditional sequence- and tree-based methods for code understanding tasks.
  • The learned graph representations enable models to identify subtle logical errors (VARMISUSE) and infer appropriate variable names (VARNAMING) that require deep contextual understanding, complementing existing static analysis tools.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.