Compile Once, Differentiate Everywhere: A Differentiable Meta-Circular Interpreter
Not on the map. Why?
Abstract (arXiv)
The boundary between program execution and gradient-based optimization has long limited the use of code itself as a learnable scientific model. We present a compiler that translates a self-hosting subset of Scheme into differentiable computation graphs for autograd backends. Because the subset can compile its own evaluator, this yields differentiable meta-circular interpretation (DMCI): a compiled Scheme interpreter executes programs supplied as data, while reverse-mode autodiff propagates gradients to continuous constants embedded in those programs. The interpreter is compiled once, so new programs inherit differentiability without recompilation or custom gradient machinery, while retaining closures, recursion, and data structures. We prove that gradients through the compiled interpreter are correct almost everywhere and show that they match direct compilation to numerical precision across 171 recursive and higher-order program-seed pairs. We then use DMCI for program-and-parameter co-search, where a large language model proposes Scheme programs and exact gradients calibrate their continuous parameters through a single frozen interpreter. This enables OpenEvolve-style program search in which an outer loop proposes discrete program structures and DMCI supplies exact gradient-based calibration of each candidate's continuous parameters. On battery capacity-fade data, the search recovers a knee-like degradation structure and improves held-out extrapolation over hand-crafted baselines on the harder early-extrapolation split, matching them on the later split. On a high-dimensional El Nino inverse problem, DMCI optimizes an interpreted Kalman-filter likelihood where gradient-free search fails. These results extend symbolic regression and neurosymbolic search from closed-form expressions to executable, stateful programs, making model-generated code directly optimizable against data.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 19 of its 54 references that are in the map. First posted on arXiv 7 Jun 2026.
Builds on
19 of 54 references.
References · 19
- 2016Categorical Reparameterization with Gumbel-Softmaxcited by 2,739
- 2018DARTS: Differentiable Architecture Searchcited by 1,798
- 2016The Concrete Distribution: A Continuous Relaxation of Discrete Random Variablescited by 1,148
- 2025AlphaEvolve: A coding agent for scientific and algorithmic discoverycited by 867
- 2014Neural Turing Machinescited by 644
- 2015Neural GPUs Learn Algorithmscited by 121
- 2023Tracr: Compiled Transformers as a Laboratory for Interpretabilitycited by 104
- 2015Neural Programmer-Interpreterscited by 101
- 2019A Differentiable Programming System to Bridge Machine Learning and Scientific Computingcited by 83
- 2023Interpretable Machine Learning for Science with PySR and SymbolicRegression.jlcited by 54
- 2020Learning Differentiable Programs with Admissible Neural Heuristicscited by 32
- 2016TerpreT: A Probabilistic Programming Language for Program Inductioncited by 13
7 more
- 2016Differentiable Functional Program Interpreterscited by 7
- 2023Smoothing Methods for Automatic Differentiation Across Conditional Branchescited by 7
- 2026Gradient-Based Program Synthesis with Neurally Interpreted Languagescited by 5
- 2023ωPAP Spaces: Reasoning Denotationally About Higher-Order, Recursive Probabilistic and Differentiable Programscited by 3
- 2025Combining Large Language Models and Gradient-Free Optimization for Automatic Control Policy Synthesiscited by 2
- 2025Compiling to linear neuronscited by 2
- 2026The Neural Compiler: Program-to-Network Translation for Hybrid Scientific Machine Learningcited by 2
Built on by
Not cited yet.