[Paper Review] Differentiable Functional Program Interpreters
This paper introduces a differentiable functional programming language and interpreter designed to improve program synthesis from input-output examples. By incorporating functional programming principles—immutability, higher-order combinators, type systems, and automatic memory management—the authors demonstrate significantly enhanced learning performance on complex list-processing tasks compared to prior differentiable approaches.
Programming by Example (PBE) is the task of inducing computer programs from input-output examples. It can be seen as a type of machine learning where the hypothesis space is the set of legal programs in some programming language. Recent work on differentiable interpreters relaxes the discrete space of programs into a continuous space so that search over programs can be performed using gradient-based optimization. While conceptually powerful, so far differentiable interpreter-based program synthesis has only been capable of solving very simple problems. In this work, we study modeling choices that arise when constructing a differentiable programming language and their impact on the success of synthesis. The main motivation for the modeling choices comes from functional programming: we study the effect of memory allocation schemes, immutable data, type systems, and built-in control-flow structures. Empirically we show that incorporating functional programming ideas into differentiable programming languages allows us to learn much more complex programs than is possible with existing differentiable languages.
Motivation & Objective
- To improve the scalability and expressiveness of differentiable interpreters for program synthesis beyond simple tasks.
- To investigate how functional programming paradigms—such as immutability, combinators, and type systems—impact gradient-based program learning.
- To address the limitation of existing differentiable languages in generalizing from few examples by designing a more structured, functional programming substrate.
- To empirically validate that functional language design choices lead to measurable improvements in success rates for program induction.
Proposed method
- Design a differentiable functional programming language operating on integers and lists, with built-in support for recursion and control flow via combinators and if-then-else constructs.
- Implement a differentiable interpreter that supports automatic memory management and enforces immutability of data structures during execution.
- Integrate a simple type system to constrain the search space and improve generalization during training.
- Use gradient-based optimization to train the interpreter on input-output examples, with discrete program outputs obtained via hard attention or sampling.
- Compare the proposed interpreter against baselines such as NRAM and discrete search methods on list-processing tasks like length computation and list search.
- Conduct extensive hyperparameter search and ablation studies to evaluate the impact of each design choice on learning performance.
Experimental results
Research questions
- RQ1How do functional programming principles such as immutability and higher-order combinators affect the ability of differentiable interpreters to generalize from few examples?
- RQ2To what extent does incorporating a type system and automatic memory management improve the success rate of differentiable program synthesis?
- RQ3Can differentiable interpreters based on functional languages outperform existing differentiable models like NRAM on complex, real-world program induction tasks?
- RQ4Does the use of structured control flow (e.g., combinators and if-then-else) lead to better optimization dynamics and faster convergence in gradient-based synthesis?
- RQ5In what ways do different modeling choices in differentiable interpreters influence generalization on unseen input-output pairs?
Key findings
- The proposed differentiable interpreter with functional language design choices achieved significantly higher success rates on complex list-processing tasks than prior differentiable models.
- The use of combinators and if-then-else constructs for control flow improved generalization, especially on tasks requiring conditional logic and recursion-like behavior.
- Immutability and automatic memory management were critical for stable training and improved generalization, particularly on small training sets.
- The inclusion of a simple type system reduced the hypothesis space and led to faster convergence and higher success rates in program synthesis.
- The NRAM baseline failed to generalize on the len task when trained on fewer than 50 examples, confirming the hypothesis that non-functional differentiable models struggle with few-shot learning.
- The model outperformed discrete search methods like λ² on certain tasks, particularly when soft constraints or perceptual inputs were involved, suggesting a complementary role in hybrid learning systems.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.