NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Learning Differentiable Programs with Admissible Neural Heuristics

Ameesh Shah, Eric Zhan, Jennifer J. Sun, Abhinav Verma, Yisong Yue, Swarat Chaudhuri

Machine learning often forces practitioners into a difficult compromise: choose highly performant but opaque "black-box" neural networks, or opt for interpretable, modular programmatic models that suffer from combinatorial explosion during optimization. Finding a program that perfectly fits a dataset requires searching through a massive space of possible code structures. Traditional search methods, such as greedy enumeration or genetic algorithms, often struggle because they cannot effectively evaluate the potential of a partially constructed program.

This paper introduces NEAR (Neural Admissible Relaxation), a novel framework that bridges the gap between discrete program synthesis and continuous optimization. By using neural networks as differentiable "placeholders" for missing code, NEAR provides a powerful heuristic to guide search algorithms toward optimal program architectures without sacrificing the interpretability of the final symbolic output.

The NEAR Framework

The authors frame program learning as a search problem within a weighted graph. In this graph, nodes represent partial programs, and edges represent the application of rules from a Domain-Specific Language (DSL).

A search tree illustrating the NEAR framework, where nodes represent partial programs evaluated using neural heuristics.

The core innovation of NEAR relies on several key components:

  1. Neural Placeholders: When the search algorithm encounters an incomplete program (e.g., if (condition) then [???] else [???]), it fills the structural "holes" with neural networks, such as RNNs or MLPs, that match the required input and output types.
  2. Differentiable Training: Because the DSL primitives are designed to be differentiable, the entire hybrid program—combining symbolic logic and neural placeholders—can be trained end-to-end using gradient descent.
  3. Admissible Heuristics: The training loss of this hybrid program serves as a heuristic ($h(u)$) for the search algorithm. Because neural networks are universal function approximators, their optimized performance represents a "best-case scenario" for what that partial program could eventually achieve. In search theory, this creates an "admissible" heuristic that never overestimates the cost to reach the goal.
  4. Search Algorithms: This neural heuristic is plugged into classic graph search algorithms, yielding A*-NEAR (a best-first search prioritizing paths with the lowest estimated total cost) and IDS-BB-NEAR (an iteratively deepened depth-first search with branch-and-bound pruning for memory-constrained environments).

Experimental Setup and Key Results

The authors evaluated NEAR on three complex sequence classification tasks involving behavioral dynamics:

  • CRIM13: Classifying social behaviors (e.g., "sniffing") between pairs of mice based on trajectory data.
  • Fly-vs.-Fly: Detecting aggressive or courtship actions in fruit flies.
  • Basketball: Predicting which player is the "ballhandler" based on the XY-coordinates of the ball and all ten players.
Path cost versus wall-clock time across three datasets, demonstrating that NEAR-guided searches outperform baseline methods.

NEAR-guided searches consistently outperformed baseline methods, including Monte Carlo Tree Search (MCTS), genetic algorithms, and top-down enumeration, particularly in achieving higher F1-scores and lower path costs in less time. Furthermore, NEAR successfully discovered programs with a depth of 6 to 8 levels—highly complex structures that are typically unreachable for standard enumerative solvers due to the sheer size of the search space.

Interpretability and the $\epsilon$-Admissibility Bridge

The synthesized programs achieved accuracies within 2-10% of state-of-the-art LSTM models while remaining significantly more compact and readable. For example, the discovered programs revealed human-understandable logic, such as calculating the Euclidean distance between players to determine ball possession, rather than relying on opaque high-dimensional weights.

The authors also provide a theoretical framework showing that if the neural relaxation is sufficiently expressive, the search remains "$\epsilon$-admissible," mathematically guaranteeing a solution very close to the global optimum. Additionally, by adjusting a structural cost weight parameter ($\lambda$), users can explicitly control the trade-off between program simplicity (interpretability) and raw accuracy.

Limitations and Future Work

While highly effective, the NEAR framework has limitations. Training a neural network at many nodes in a search tree is computationally expensive, even if it is vastly more efficient than exhaustive search. Furthermore, the method requires the DSL primitives to be differentiable; while many operations fit this requirement, purely discrete logical operations may require further relaxation techniques.

Future work could explore integrating NEAR with "program sketching"—where a human expert provides a high-level template—and extending the approach to reinforcement learning domains where interpretability, safety, and verifiable logic are paramount.

Summary updated

BibTeX
@inproceedings{shah2020learning,
  author = {Ameesh Shah and Eric Zhan and Jennifer J. Sun and Abhinav Verma and Yisong Yue and Swarat Chaudhuri},
  title = {{Learning Differentiable Programs with Admissible Neural Heuristics}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2020},
  url = {https://openreview.net/forum?id=1tHy7Htue5o},
}
Figure