Searching Latent Program Spaces

Clément Bonnet,Matthew V Macfarlane
2024-11-13
Abstract:Program synthesis methods aim to automatically generate programs restricted to a language that can explain a given specification of input-output pairs. While purely symbolic approaches suffer from a combinatorial search space, recent methods leverage neural networks to learn distributions over program structures to narrow this search space significantly, enabling more efficient search. However, for challenging problems, it remains difficult to train models to perform program synthesis in one shot, making test-time search essential. Most neural methods lack structured search mechanisms during inference, relying instead on stochastic sampling or gradient updates, which can be inefficient. In this work, we propose the Latent Program Network (LPN), a general algorithm for program induction that learns a distribution over latent programs in a continuous space, enabling efficient search and test-time adaptation. We explore how to train these networks to optimize for test-time computation and demonstrate the use of gradient-based search both during training and at test time. We evaluate LPN on ARC-AGI, a program synthesis benchmark that evaluates performance by generalizing programs to new inputs rather than explaining the underlying specification. We show that LPN can generalize beyond its training distribution and adapt to unseen tasks by utilizing test-time computation, outperforming algorithms without test-time adaptation mechanisms.
Machine Learning,Artificial Intelligence
What problem does this paper attempt to address?
The problem that this paper attempts to solve is how to effectively generate programs that can interpret given input - output pairs in program synthesis. Specifically, the author points out the limitations of existing methods in dealing with complex problems: 1. **Limitations of Symbolic Methods**: Although traditional symbolic methods have been successful in some limited fields, due to the huge combinatorial search space, they are difficult to scale to modern challenges, especially when dealing with large search spaces and complex patterns, such as the problems in the ARC - AGI dataset. 2. **Limitations of Neural Methods**: Although in recent years, methods using neural networks have improved search efficiency by learning the probability distribution of program structures to reduce the search space, these methods lack an effective search mechanism during testing. Most neural methods rely on random sampling or gradient updates, which may be inefficient when dealing with challenging problems. To overcome these limitations, the paper proposes the **Latent Program Network (LPN)**, which is a general - purpose algorithm for program inductive learning. The main features of LPN include: - **Continuous Latent Space**: LPN learns a continuous latent space representing the space of possible programs, enabling efficient search and test - time adaptation. - **Test - Time Adaptation**: LPN directly builds a test - time adaptation mechanism into the neural architecture without parameter updates and utilizes training objectives suitable for test - time search. - **Gradient Optimization**: LPN utilizes gradient optimization in the latent space to find the latent program that can best explain the given specification during training and inference. Through these innovations, LPN can adapt to new tasks more efficiently during testing, especially when dealing with tasks such as ARC - AGI that are designed to be outside the training distribution. The paper verifies the effectiveness of LPN through experiments and shows its superior performance on the ARC - AGI benchmark.