Table of Contents
Fetching ...

Guided Sketch-Based Program Induction by Search Gradients

Ahmad Ayaz Amin

TL;DR

This work addresses the gap where purely statistical models struggle and symbolic approaches are preferred by proposing a sketch-based program induction framework optimized with search gradients via Natural Evolution Strategies (NES). By allowing programmers to provide a partial program (a sketch) with holes, the method combines structured priors with gradient-based optimization over discrete and continuous token spaces using mixed distributions. The approach is demonstrated on simple one- and two-input programs, showing that it can recover equivalent behaviors and generalize to new inputs, while revealing stability and scalability limitations for more complex constructs like loops. The work highlights a promising direction for scalable, interpretable program induction, with future work suggested in integrating evolutionary and genetic techniques to address dynamic program sizes and verification concerns. $\phi$ denotes the holes in the sketch and is optimized through gradient estimates, enabling a bridge between symbolic program structure and statistical optimization.

Abstract

Many tasks can be easily solved using machine learning techniques. However, some tasks cannot readily be solved using statistical models, requiring a symbolic approach instead. Program induction is one of the ways that such tasks can be solved by means of capturing an interpretable and generalizable algorithm through training. However, contemporary approaches to program induction are not sophisticated enough to readily be applied to various types of tasks as they tend to be formulated as a single, all-encompassing model, usually parameterized by neural networks. In an attempt to make program induction a viable solution for many scenarios, we propose a framework for learning parameterized programs via search gradients using evolution strategies. This formulation departs from traditional program induction as it allows for the programmer to impart task-specific code to the program 'sketch', while also enjoying the benefits of accelerated learning through end-to-end gradient-based optimization.

Guided Sketch-Based Program Induction by Search Gradients

TL;DR

This work addresses the gap where purely statistical models struggle and symbolic approaches are preferred by proposing a sketch-based program induction framework optimized with search gradients via Natural Evolution Strategies (NES). By allowing programmers to provide a partial program (a sketch) with holes, the method combines structured priors with gradient-based optimization over discrete and continuous token spaces using mixed distributions. The approach is demonstrated on simple one- and two-input programs, showing that it can recover equivalent behaviors and generalize to new inputs, while revealing stability and scalability limitations for more complex constructs like loops. The work highlights a promising direction for scalable, interpretable program induction, with future work suggested in integrating evolutionary and genetic techniques to address dynamic program sizes and verification concerns. denotes the holes in the sketch and is optimized through gradient estimates, enabling a bridge between symbolic program structure and statistical optimization.

Abstract

Many tasks can be easily solved using machine learning techniques. However, some tasks cannot readily be solved using statistical models, requiring a symbolic approach instead. Program induction is one of the ways that such tasks can be solved by means of capturing an interpretable and generalizable algorithm through training. However, contemporary approaches to program induction are not sophisticated enough to readily be applied to various types of tasks as they tend to be formulated as a single, all-encompassing model, usually parameterized by neural networks. In an attempt to make program induction a viable solution for many scenarios, we propose a framework for learning parameterized programs via search gradients using evolution strategies. This formulation departs from traditional program induction as it allows for the programmer to impart task-specific code to the program 'sketch', while also enjoying the benefits of accelerated learning through end-to-end gradient-based optimization.
Paper Structure (17 sections, 5 equations, 2 figures, 1 algorithm)

This paper contains 17 sections, 5 equations, 2 figures, 1 algorithm.

Figures (2)

  • Figure 1: Loss of parameterized program over 10,000 iterations. Lower loss indicates better program behaviour.
  • Figure 2: Loss of parameterized program over 20,000 iterations. Lower loss indicates better program behaviour.