Structured Generative Models of Natural Source Code

  • Chris J. Maddison ,
  • Daniel Tarlow

The 31st International Conference on Machine Learning (ICML) |

Published by JMLR.org

Publication

We study the problem of building generative models of natural source code (NSC); that is, source code written by humans and meant to be understood by humans. Our primary contribution is to describe new generative models that are tailored to NSC. The models are based on probabilistic context free grammars (PCFGs) and neuro-probabilistic language models (Mnih & Teh, 2012), which are extended to incorporate additional source code-specific structure. These models can be efficiently trained on a corpus of source code and outperform a variety of less structured baselines in terms of predictive log likelihoods on held-out data.