Latent Programmer: Discrete Latent Codes for Program Synthesis
Joey Hong, David Dohan, Rishabh Singh, Charles Sutton, Manzil Zaheer
Abstract
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.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
9 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- ExeDec: Execution Decomposition for Compositional Generalization in Neural Program Synthesis cites Just-in-time learning for bottom-up enumerative synthesis
- ExeDec: Execution Decomposition for Compositional Generalization in Neural Program Synthesis cites CrossBeam: Learning to Search in Bottom-Up Program Synthesis
- ExeDec: Execution Decomposition for Compositional Generalization in Neural Program Synthesis cites BUSTLE: Bottom-Up Program Synthesis Through Learning-Guided Exploration
- CrossBeam: Learning to Search in Bottom-Up Program Synthesis cites Just-in-time learning for bottom-up enumerative synthesis
- CrossBeam: Learning to Search in Bottom-Up Program Synthesis cites BUSTLE: Bottom-Up Program Synthesis Through Learning-Guided Exploration
- Hierarchical Programmatic Reinforcement Learning via Learning to Compose Programs cites Learning to Synthesize Programs as Interpretable and Generalizable Policies
Cited by top-tier papers9
- Learning to Synthesize Programs as Interpretable and Generalizable PoliciesDweep Trivedi, Jesse Zhang, Shao-Hua Sun, Joseph J. LimNeurIPS 2021 · 104 citations
- Outline, Then Details: Syntactically Guided Coarse-To-Fine Code GenerationWenqing Zheng, S. P. Sharan, Ajay Kumar Jaiswal, Kevin Wang et al.ICML 2023 · 35 citations
- CrossBeam: Learning to Search in Bottom-Up Program SynthesisKensen Shi, Hanjun Dai, Kevin Ellis, Charles SuttonICLR 2022 · 28 citations
- ExeDec: Execution Decomposition for Compositional Generalization in Neural Program SynthesisKensen Shi, Joey Hong, Yinlin Deng, Pengcheng Yin et al.ICLR 2024 · 21 citations
- Hierarchical Programmatic Reinforcement Learning via Learning to Compose ProgramsGuan-Ting Liu, En-Pei Hu, Pu-Jen Cheng, Hung-Yi Lee et al.ICML 2023 · 21 citations
Builds on2
Related papers
- Language Models as Semantic IndexersBowen Jin, Hansi Zeng, Guoyin Wang, Xiusi Chen et al.ICML 2024 · 31 citations
- Gradient-Based Program Synthesis with Neurally Interpreted LanguagesMatthew Macfarlane, Clément Bonnet, Herke van Hoof, Levi LelisICLR 2026 · 3 citations
- Latent Diffusion for Language GenerationJustin Lovelace, Varsha Kishore, Chao Wan, Eliot Shekhtman et al.NeurIPS 2023 · 177 citations
- HYSYNTH: Context-Free LLM Approximation for Guiding Program SynthesisShraddha Barke, Emmanuel Anaya Gonzalez, Saketh Ram Kasibatla, Taylor Berg-Kirkpatrick et al.NeurIPS 2024 · 34 citations
- Compositional Discrete Latent Code for High Fidelity, Productive Diffusion ModelsSamuel Lavoie, Michael Noukhovitch, Aaron C. CourvilleNeurIPS 2025 · 3 citations
