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

Bayesian Program Learning by Decompiling Amortized Knowledge

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

TL;DR

This paper introduces Dream Decompiling, a novel approach to library learning in program synthesis. By "decompiling" the knowledge stored in a neural search policy back into explicit code components, the system can more effectively restructure its search space. This leads to faster learning and significantly better generalization—especially when training data is scarce.

What Problem Does This Paper Address?

Inductive program synthesis—generating code that matches specific input/output examples—is notoriously difficult because the search space of possible programs grows exponentially. To make this tractable, state-of-the-art systems like DreamCoder use a "wake-sleep" strategy:

  1. Wake: Search for programs using a neural "recognition model" (a policy that predicts which code components are likely to work).
  2. Sleep (Abstraction): Look at successful programs and "chunk" common patterns into a library of reusable functions, which reduces the depth of future searches.
  3. Sleep (Dreaming): Train the neural policy on synthetic tasks to reduce the breadth of future searches.
The Wake-Sleep cycle in program synthesis, highlighting the new feedback loop where the recognition model influences library learning.

The authors identify a missed opportunity: in the standard DreamCoder architecture, library learning (depth) and the neural policy (breadth) are largely disconnected. The library only learns from programs that have already been found. This paper proposes that the neural policy—which "compiles" knowledge about the domain during training—should directly guide which new functions are added to the library.

Methods

The authors propose Dream Decompiling, where the system leverages the neural recognition model to identify useful library components. They introduce two main variants:

  • DREAMDECOMPILER-AVG: A simpler version that ranks potential library additions based on how often the recognition model wants to use them across all tasks.
  • DREAMDECOMPILER-PC (Probabilistic Chunking): A more sophisticated approach that treats chunking as a decision-theoretic problem. It calculates a "caching benefit" for each potential function, considering not just how often it's used, but how much it simplifies the overall program generation process.

The core idea is that the recognition model might "know" a useful pattern even if it hasn't successfully solved a specific task yet. By "decompiling" this latent knowledge into the library, the system can solve harder tasks in subsequent cycles.

Key Insights and Ideas

  • The Decompiler Metaphor: Just as a software decompiler translates machine code back into high-level source code, Dream Decompiling translates the "compiled" weights of a neural network back into high-level, human-readable library components.
  • Amortizing Depth: Standard amortized inference uses a neural network to speed up search breadth. This paper shows that the same amortized knowledge can be used to reduce search depth by informing library structure.
  • Information-Theoretic "Difficulty": The authors define the benefit of a library component based on how much "surprise" or "difficulty" it removes from the program generation process.
Visualization of the caching benefit desiderata. Caching a function is most beneficial when it makes a highly unlikely program much easier to generate.

Datasets and Key Results

The researchers evaluated their approach across six diverse program synthesis domains originally used to benchmark DreamCoder: List Processing, Text Editing, Block Towers, Symbolic Regression, LOGO Graphics, and Regexes.

The experiments demonstrate that Dream Decompiling consistently outperforms the original DreamCoder baseline:

  • Faster Proficiency: The system reaches higher accuracy levels in fewer wake-sleep cycles.
  • Superior Generalization: On held-out test tasks, DREAMDECOMPILER-PC outperformed DreamCoder by an average of 13.25% at its peak performance difference across deterministic domains.
  • Data Efficiency: The advantage was most pronounced in domains where fewer training solutions were available, proving that the neural policy can effectively "fill in the gaps" when data is thin.

Limitations and Future Work

  • Candidate Generation: This paper focuses on selecting the best functions to add to a library from a set of candidates. It still relies on existing methods to generate those candidates in the first place.
  • Chunking Thresholds: While the probabilistic model helps rank functions, the system still uses heuristics to decide exactly how many functions to add in each cycle.
  • Neural Architecture: The authors used the standard, relatively simple neural models from DreamCoder. They suggest that more modern, powerful architectures (like Transformers) could potentially extract even richer knowledge during the "decompilation" phase.

Summary updated

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