Data-Efficient Learning with Neural Programs

Alaia Solko-Breslin, Seewon Choi, Ziyang Li, Neelay Velingker, Rajeev Alur, Mayur Naik, Eric Wong

Overview

Researchers from the University of Pennsylvania have introduced ISED (Infer-Sample-Estimate-Descend), a novel framework for training "neural programs"—hybrid systems that compose neural networks with arbitrary black-box code, such as Python scripts or Large Language Model (LLM) API calls. By treating the symbolic program as a black box and estimating gradients through a sampled symbolic summary, ISED achieves state-of-the-art performance with significantly higher data and sample efficiency than traditional reinforcement learning baselines.

The Challenge of Black-Box Logic

A central goal in artificial intelligence is the integration of perception (neural networks) with logical reasoning (symbolic programs). For example, a system might use a vision model to identify objects in a scene and then use a program to determine the room type based on those objects.

The primary difficulty arises when training the neural component using only end-to-end labels. If the reasoning program is written in a standard language like Python or involves an external API call (e.g., GPT-4), it is a black box. Standard backpropagation cannot calculate gradients through such non-differentiable components. Existing solutions, such as rewriting programs in specialized logic languages or using reinforcement learning (REINFORCE), often suffer from limited expressivity or extreme sample inefficiency.

The ISED Framework

The ISED framework bridges the gap between neural models ($M_\theta$) and black-box programs ($P$) by generating a "symbolic summary." The process follows four distinct stages:

  1. Infer: The neural network predicts a probability distribution over potential symbolic inputs (e.g., identifying an object as a "cup" with 60% confidence).
  2. Sample: ISED draws $k$ samples from this predicted distribution.
  3. Estimate: The black-box program is executed on these samples to observe the resulting outputs. This creates a "summary logic program"—a collection of conditional rules that describe the program's behavior for the sampled inputs.
  4. Descend: Utilizing techniques from Weighted Model Counting (WMC), ISED estimates the gradient across this symbolic summary. This provides a much stronger learning signal than REINFORCE because it accounts for how combinations of symbols contribute to the final result.
The ISED pipeline applied to a scene recognition task, illustrating the flow from image input through a neural model ($M_\theta$) to a symbolic reasoning component ($P$) powered by GPT-4.

To ensure broad applicability, ISED includes a structural mapping interface that handles diverse data types, including discrete categories, permutations, and lists. It also offers "semiring flexibility," allowing users to tune the learning signal aggregation based on specific task requirements.

Experimental Results

The researchers evaluated ISED on 16 benchmark tasks across three categories:

  • Neurosymbolic Benchmarks: Including MNIST-R (arithmetic on handwritten digits), Visual Sudoku, and Handwritten Formula (HWF) evaluation.
  • NeuroPython: Tasks where the symbolic component is a standard Python program, such as leaf classification using decision trees.
  • NeuroGPT: Tasks involving calls to GPT-4, such as scene recognition based on YOLOv8 object detections.

Performance and Efficiency

ISED was the top performer in 8 out of 16 tasks. In the GPT-4-based scene recognition task, it outperformed purely neural baselines by 31.42%. In terms of efficiency, ISED reached ~88% accuracy on multi-digit addition tasks in just 5 minutes, significantly outperforming surrogate-based methods like A-NeSI. Furthermore, ISED demonstrated remarkable robustness, successfully completing complex tasks like Visual Sudoku where other neurosymbolic frameworks often timed out.

Conclusion and Future Work

ISED demonstrates that treating complex logic as a black box and sampling it can be more robust and efficient than attempting to differentiate through massive logic chains. While the framework currently faces challenges scaling to extremely high-dimensional input spaces, future work involving Bayesian Optimization or advanced sampling strategies promises to extend its capabilities. ISED represents a significant step toward a new generation of neurosymbolic languages that combine the flexibility of general-purpose programming with the power of probabilistic deep learning.

Summary updated

BibTeX
@inproceedings{solkobreslin2024data,
  author = {Alaia Solko-Breslin and Seewon Choi and Ziyang Li and Neelay Velingker and Rajeev Alur and Mayur Naik and Eric Wong},
  title = {{Data-Efficient Learning with Neural Programs}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=QXQY58xU25},
}
Figure