← back

Programs that learn

Code as prior, gradient as fit. Why an LLM should write a learnable program instead of editing its own weights. Sourced map, 2026-11-03.

One sentence
Let the LLM write the structure and let an optimizer fit the numbers. The structure is source code: you can read it, diff it, and find the wrong assumption after a failure. A weight update gives you none of that. Where the two loops meet on the same task, the program loop is winning so far.

The two loops

Both loops start from a model that proposes a change and a judge that scores it. They differ in what the change is made of.

Weight loop

The model writes training data or an update rule, then applies it to its own parameters. SEAL, Titans, MEMIT.

+ no search over discrete structure; one gradient step moves everything
− forgets old knowledge; the change has no readable diff; one rollout = one fine-tune
Program loop

The model writes a program skeleton. An optimizer fits the parameters to data. A judge scores the result. LLM-SR, AlphaEvolve, Darwin Gödel Machine.

+ the prior is explicit; failures are visible in source; cheap rollouts; nothing to forget
− discrete search space; brittle when the skeleton is wrong; hand-built structure loses to scale when data is plentiful

Where the program loop already wins

Each result below holds the model fixed and improves code. Numbers come from the cited paper.

Darwin Gödel Machine
Zhang, Hu, Lu, Lange, Clune · ICLR 2026 · arXiv 2505.22954

The agent rewrites its own code, not its weights, and keeps every validated variant in an open archive. SWE-bench 20.0% → 50.0%, Polyglot 14.2% → 30.7%. Without self-modification it plateaus at 39.0%. The strongest "self-improving agent" result on record edits source.

GEPA
Agrawal, Khattab et al. · ICLR 2026 oral · arXiv 2507.19457

The LLM reads its own execution traces and rewrites the program, prompts and structure, in natural language, with Pareto selection per instance. Beats GRPO weight-RL by +6% on average, up to +20%, with up to 35x fewer rollouts. Reflection over a program beats gradient over weights at equal budget.

AlphaEvolve
Novikov et al., Google DeepMind · 2025 · arXiv 2506.13131

Gemini proposes code mutations, automated evaluators score them, the loop keeps the best. Found a 48-multiplication algorithm for 4×4 complex matrix multiplication, the first gain over Strassen in that setting in 56 years. Also used on datacenter scheduling and on the training of its own base model. The output is a program a human can verify.

ASI-Arch
Xu et al. · COLM 2026 · arXiv 2507.18074

Researcher, Engineer and Analyst agents propose linear-attention architectures as code; each one is trained and scored. 1,773 experiments, 20,000 GPU-hours, 105 architectures that beat the existing designs. The gradient runs inside the loop, over the parameters of each proposed program.

ADAS and FunSearch
Hu, Lu, Clune · arXiv 2408.08435 · Romera-Paredes et al., Nature 625, 2023 · DeepMind

ADAS: a meta-agent writes agent code into a growing archive; the found agents beat hand-built ones and transfer across models. FunSearch: a frozen LLM plus an evaluator in an evolutionary loop over code found new cap-set constructions and a better bin-packing heuristic. Both ship compact programs, not weights.

Skeleton plus optimizer

The pattern Kron asked about has a name in equation discovery: the LLM proposes the form, a numeric optimizer fits the constants, the residual says what to change.

LLM-SR
Shojaee et al. · ICLR 2025 oral · arXiv 2404.18400

Equation skeletons written as code from scientific priors; evolutionary search over skeletons, optimizer over parameters. Beats symbolic-regression baselines, with the largest margin out of domain, where a wrong black box has nothing to fall back on.

LLM-SRBench
Shojaee et al. · ICML 2025 oral · arXiv 2504.10415

239 tasks built to block recall of memorized laws. The best system reaches 31.5% symbolic accuracy. The route is real and it is far from solved: most of the time the LLM proposes the wrong skeleton.

DSPy and TextGrad
Khattab et al. · arXiv 2310.03714 · Yuksekgonul et al. · arXiv 2406.07496

The same idea applied to LLM pipelines. DSPy compiles declared modules into a pipeline and tunes the program against a metric. TextGrad runs autograd over a graph of LLM calls and sends natural-language feedback backward: GPT-4o GPQA 51% → 55%. The program is the thing that learns; the model stays fixed.

Substrates

A program can learn from data only if an optimizer can reach its parameters. These are the tools that make a program differentiable or fittable.

Neural ODEs — the ODE solver is the forward pass; the adjoint method gives gradients through the solver. Chen et al., NeurIPS 2018.
JAX-MD — molecular dynamics where whole trajectories differentiate; networks plug in as potentials. Schoenholz, Cubuk, NeurIPS 2020.
Pyro / NumPyro — the program is the probabilistic model; SVI or HMC fits it. Bingham et al., JMLR 2019.
PySINDy — sparse regression over a library of candidate terms; the fitted equation is the program. de Silva et al., JOSS.
Scallop — Datalog with provenance semirings, so logic programs get gradients. Li, Huang, Naik, 2023.
DreamCoder — wake-sleep loop grows a code library and a neural guide over it; rediscovers Newton's and Coulomb's laws. Ellis et al., PLDI 2021.
Bayesian Program Learning — a concept is a short program that best explains the examples; one-shot character learning at human level. Lake, Salakhutdinov, Tenenbaum, Science 2015.

The weight side, stated fairly

SEAL
Zweiger et al., MIT · NeurIPS 2025 · arXiv 2506.10943

The model writes its own fine-tuning data and update directives; RL rewards the edits that raise downstream scores after the weight update. Its self-written data beats GPT-4.1-written data on their tasks. The authors list catastrophic forgetting and compute cost as open problems.

Titans, ROME, MEMIT

Titans updates a memory module's weights at test time from a surprise signal and scales past 2M tokens of context. ROME rewrites one fact with a rank-one update to one MLP layer; MEMIT spreads thousands of edits over several layers. These solve memory and recall. None of them produce a reason you can read.

Forgetting is the documented cost. Three surveys of continual learning in foundation models report the same thing after adaptation: 2404.16789, 2405.18653, 2506.13045. The finding: performance drops on the old domains. A source diff cannot forget; a weight diff can.

Biology and physics: the open lane

The mechanistic side of this exists without LLMs. The LLM side exists without mechanism. Nobody has joined them end to end.

Mechanistic programs with gradient fit, no LLM
leads, abstracts not re-opened this pass

FLeCS wires gene-network structure into coupled differential equations for single-cell dynamics. CLAMP (ICML 2026) fits a differentiable Hill-kinetics regulatory network and treats a perturbation as a steady-state constraint. Φ-ROM puts a differentiable PDE solver inside reduced-order-model training and generalizes to unseen parameters better than data-only models.

LLM reasoning over biology, no gradient
lead, abstract not re-opened this pass

MechPert steers an LLM agent toward directed regulatory relationships for few-shot perturbation prediction: +10.5% relative gain over similarity-based prompting. The LLM supplies structure; nothing is fitted.

The gap

No paper found puts an LLM inside a differentiable cell or physics simulator with the loop closed: LLM writes the mechanism as code, the optimizer fits the rate constants, the residual goes back to the LLM. The pieces are on this page. The join is unclaimed.

Against the program route

The bitter lesson
Sutton, 2019 · incompleteideas.net

Methods that scale with compute beat methods that encode human structure, and they have done so every time. A hand-written skeleton is human structure. When data is plentiful, expect the black box to win.

Discrete search has no gradient
structural, not one paper

Program space is discrete. The optimizer can fit the constants but cannot walk from one skeleton to a better one; that step is search, and search is what costs. LLM-SRBench's 31.5% ceiling is this cost measured. Fixes are relaxations of the program space or neural-guided search, both still open.

Humans do not give enough examples
Hocquette et al., AAAI 2026 · lead, not re-opened

Non-experts rarely supply enough examples for a synthesizer to learn the intended program. The "a human can teach it" argument for programs is weaker than it sounds.

Verification note

Verified against the arXiv abstract or primary page: LLM-SR, LLM-SRBench, ASI-Arch, SEAL, GEPA, Darwin Gödel Machine, AlphaEvolve, ADAS, JAX-MD, Neural ODEs, Pyro, DreamCoder, Bayesian Program Learning, Scallop, ROME, MEMIT, Titans, the bitter lesson. Items marked lead come from search results only and carry no numbers beyond their abstract.