Latent Programmer: Discrete Latent Codes for Program Synthesis

by   Joey Hong, et al.

In many sequence learning tasks, such as program synthesis and document summarization, a key problem is searching over a large space of possible output sequences. We propose to learn representations of the outputs that are specifically meant for search: rich enough to specify the desired output but compact enough to make search more efficient. Discrete latent codes are appealing for this purpose, as they naturally allow sophisticated combinatorial search strategies. The latent codes are learned using a self-supervised learning principle, in which first a discrete autoencoder is trained on the output sequences, and then the resulting latent codes are used as intermediate targets for the end-to-end sequence prediction task. Based on these insights, we introduce the Latent Programmer, a program synthesis method that first predicts a discrete latent code from input/output examples, and then generates the program in the target language. We evaluate the Latent Programmer on two domains: synthesis of string transformation programs, and generation of programs from natural language descriptions. We demonstrate that the discrete latent representation significantly improves synthesis accuracy.


page 1

page 2

page 3

page 4


Neural Program Search: Solving Programming Tasks from Description and Examples

We present a Neural Program Search, an algorithm to generate programs fr...

Latent Attention For If-Then Program Synthesis

Automatic translation from natural language descriptions into programs i...

Predictive Synthesis of API-Centric Code

Today's programmers, especially data science practitioners, make heavy u...

BUSTLE: Bottom-up program-Synthesis Through Learning-guided Exploration

Program synthesis is challenging largely because of the difficulty of se...

Discrete Autoencoders for Sequence Models

Recurrent models for sequences have been recently successful at many tas...

Synthesis of Procedural Models for Deterministic Transition Systems

This paper introduces a general approach for synthesizing procedural mod...

Searching a Database of Source Codes Using Contextualized Code Search

We assume a database containing a large set of program source codes and ...

Please sign up or login with your details

Forgot password? Click here to reset