Structural Language Models for Any-Code Generation

By Uri Alon, Roy Sadaka, Omer Levy, Eran Yahav. 2019

19 citations recorded by the source corpus.

We address the problem of Any-Code Generation (AnyGen) - generating code without any restriction on the vocabulary or structure. The state-of-the-art in this problem is the sequence-to-sequence (seq2seq) approach, which treats code as a sequence and does not leverage any structural information. We introduce a new approach to AnyGen that leverages the strict syntax of programming languages to model a code snippet as a tree - structural language modeling (SLM). SLM estimates the probability of the program's abstract syntax tree (AST) by decomposing it into a product of conditional probabilities over its nodes. We present a neural model that computes these conditional probabilities by considering all AST paths leading to a target node. Unlike previous structural techniques that have severely restricted the kinds of expressions that can be generated, our approach can generate arbitrary expressions in any programming language. Our model significantly outperforms both seq2seq and a variety of existing structured approaches in generating Java and C# code. We make our code, datasets, and models available online.

Subfields: Information Systems, Software, Natural Language Processing

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Information Systems

  1. Baptiste Rozière
  2. Congzheng Song
  3. Guillaume Lample
  4. Uri Alon
  5. Eran Tromer
  6. Roei Schuster
  7. Seohyun Kim
  8. Eran Yahav

In Software

  1. Uri Alon
  2. Baptiste Rozière
  3. Seohyun Kim
  4. Marie-Anne Lachaux
  5. Satish Chandra
  6. Vitaly Shmatikov
  7. Eran Yahav
  8. Guillaume Lample

In Natural Language Processing

  1. Baptiste Rozière
  2. Congzheng Song
  3. Marie-Anne Lachaux
  4. Roei Schuster
  5. Eran Tromer
  6. Vitaly Shmatikov
  7. Uri Alon
  8. Guillaume Lample

Citations in the corpus