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

DreamDecompiler: Improved Bayesian Program Learning by Decompiling Amortised Knowledge

Alessandro B. Palmarini, Christopher G. Lucas, N. Siddharth · DOI

Introduction

Inductive program synthesis—the task of automatically generating code from input/output examples—remains a fundamental challenge in artificial intelligence. The search space for valid programs is vast, often described as finding a "needle in a haystack." To navigate this complexity, state-of-the-art systems like DREAMCODER employ a dual strategy: reducing the breadth of the search via neural policies and reducing the depth of the search by building a library of reusable components. However, these two mechanisms have traditionally operated in isolation. This paper introduces DreamDecompiler, a novel approach that bridges this gap by "decompiling" the intuition stored in neural search policies directly into the program library.

The Synthesis Challenge: Breadth vs. Depth

Efficient program synthesis requires balancing two dimensions of search. First, a system must reduce search breadth by learning which paths in a program's derivation tree are most promising. This is typically handled by a neural "recognition model" or search policy. Second, it must reduce search depth by identifying common patterns and "chunking" them into single, higher-level primitives.

The Wake-Sleep cycle in program synthesis, highlighting the roles of chunking and recognition models.

In existing frameworks, library construction (chunking) occurs by analyzing solved tasks to find compression patterns. This ignores the "amortized knowledge" within the neural policy—the patterns the model has learned to favor even for tasks it has not yet successfully solved.

The DreamDecompiler Approach

DreamDecompiler (DDC) proposes that the search policy itself should guide the evolution of the library. By leveraging the neural network's "intuition" about what combinations of primitives are likely to be useful, DDC can restructure the search space more effectively.

The authors explore two primary variants:

  1. DREAMDECOMPILER-AVG: A baseline that ranks potential library additions based on their frequency of use by the neural policy across tasks.
  2. DREAMDECOMPILER-PC (Probabilistic Chunking): A more principled approach using information theory. It calculates a "caching benefit" metric to evaluate how much a new library component reduces the self-information (difficulty) of generating a program.
Illustration of how library chunking (defining g = f ∘ f) reduces the depth of the search tree.

As shown in the figure above, by defining a new primitive $g$ as a composition of existing functions (e.g., $g = f \circ f$), the system can reach complex solutions in fewer steps, effectively shortening the path to a solution.

Experimental Evaluation

The DDC framework was evaluated across six diverse domains: List Processing, Text Editing, Block Towers, Symbolic Regression, LOGO Graphics, and Regexes. The core "aha" moment of the research is realizing that the search policy and the library should evolve together. Because the neural policy is trained on "fantasies" (programs sampled from the generative model), it can suggest useful library components even before the system has solved many real-world training tasks, helping overcome the "cold start" problem.

Key Results and Insights

The integration of search policy and library construction yielded significant performance gains:

  • Enhanced Proficiency: DDC-PC reached high accuracy levels significantly faster than the standard DREAMCODER baseline.
  • Superior Generalization: On average, DDC-PC outperformed the baseline by 13.25% in test accuracy during the learning process.
  • Data Efficiency: The benefits were most pronounced in early learning stages. In the List Processing domain, DDC-PC showed a 17% improvement in generalization when training data was extremely scarce.
  • Optimized Search: Despite the potential for a larger library to increase search breadth, the "smarter" primitives led to shallower solutions, resulting in lower overall search times.

Conclusion and Future Work

DreamDecompiler demonstrates that "decompiling" neural intuition into symbolic library components is a powerful way to bootstrap program synthesis. By closing the loop between search breadth and depth, the system achieves better generalization with less data. Future research directions include using the neural policy to generate candidate functions rather than just selecting them, and implementing continuous learning techniques to avoid retraining the search policy from scratch after every library update.

Summary updated

BibTeX
@inproceedings{palmarini2024dreamdecompiler,
  author = {Alessandro B. Palmarini and Christopher G. Lucas and N. Siddharth},
  title = {{DreamDecompiler: Improved Bayesian Program Learning by Decompiling Amortised Knowledge}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=CbIRQgAYE4},
}
Figure