Language-Agnostic Representation Learning of Source Code from Structure and Context

Daniel Zügner, Tobias Kirschstein, Michele Catasta, Jure Leskovec, Stephan Günnemann
3/21/2021
cs.LGcs.SE

Official code: danielzuegner/code-transformer (174 stars, MIT, last commit 2022-04-06).

Abstract

Source code (Context) and its parsed abstract syntax tree (AST; Structure) are two complementary representations of the same computer program. Traditionally, designers of machine learning models have relied predominantly either on Structure or Context.

Show full abstract

We propose a new model, which jointly learns on Context and Structure of source code. In contrast to previous approaches, our model uses only language-agnostic features, i.e., source code and features that can be computed directly from the AST. Besides obtaining state-of-the-art on monolingual code summarization on all five programming languages considered in this work, we propose the first multilingual code summarization model. We show that jointly training on non-parallel data from multiple programming languages improves results on all individual languages, where the strongest gains are on low-resource languages. Remarkably, multilingual training only from Context does not lead to the same improvements, highlighting the benefits of combining Structure and Context for representation learning on code.

View on arXivView PDF

Code Implementations(1)

MIT

Implementation of the paper "Language-agnostic representation learning of source code from structure and context".

17432Mar 4, 20214 years agoMIT
deep-learningiclr2021machine-learningml4codetransformers

Similar Papers

Cite this paper

@article{zgner2021languageagnostic,
  title  = {Language-Agnostic Representation Learning of Source Code from Structure and Context},
  author = {Daniel Zügner and Tobias Kirschstein and Michele Catasta and Jure Leskovec and Stephan Günnemann},
  year   = {2021},
  eprint = {2103.11318},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2103.11318}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2103.11318.svg)](https://codeofpaper.com/paper/2103.11318)

Discussion