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 \emph{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.
翻译:在许多序列学习任务中,例如程序合成和文档汇总,一个关键问题是搜索大量可能的输出序列空间。 我们提议学习用于搜索的具体输出的表达方式: 足够丰富,足以指定想要的输出,但足够紧凑,可以提高搜索效率。 隐形代码对此很有吸引力, 因为它们自然允许复杂的组合搜索策略。 隐形代码是使用一种自我监督的学习原则学习的, 首先对离散自动编码器进行输出序列培训, 然后将由此产生的潜在编码用作端到端序列预测任务的中间目标。 基于这些洞察, 我们引入了 \ emph{ Latent 程序}, 这是一种程序合成方法, 首先从输入/ 输出示例中预测离散的潜在代码, 然后用目标语言生成程序。 我们从两个领域评估 Lent 程序: 字符串转换程序的综合, 从自然语言描述生成程序。 我们证明离散的潜在表达方式大大改进了合成准确性 。