Program synthesis, the automated construction of programs from specifications, is AI’s core problem made formal: can a machine reliably do what you mean, not just what you say? The sixty-year quest to answer that question has produced the three paradigms now reshaping intelligence itself: deductive reasoning, statistical learning, and their union. We are living through the third transition.
Every interaction between a human and a computer conceals a gap. The human has an intent. The computer has instructions: an exact sequence of operations it will execute without interpretation. Between these two things lies the specification problem, which asks how you translate a human meaning into a machine command precisely enough that the machine does what you meant.
Program synthesis formalises this gap mathematically. Given a specification φ, find a program P in a program space ℒ such that P ⊨ φ. The framing decouples the what, the specification, from the how, the program. But this narrow technical problem is, at its core, the general problem of machine intelligence: can a system reliably infer what a person means from incomplete, ambiguous evidence? And it is structurally identical to the alignment problem in AI safety. Both ask how to encode human values into a formal representation a machine can act on, completely enough that its behaviour matches intent, including in situations the specifier did not anticipate. Every advance in synthesis is, implicitly, an advance in alignment.
The synthesis problem in its most general form is undecidable. Every practical approach achieves tractability by restricting the specification language or the program space. The history of the field is a history of finding those restrictions clever enough to be useful. Three paradigms have shaped that history. Each found a different restriction. None of them, alone, turned out to be enough.
The Specification Gap is the Alignment Gap. The formal tools developed to bridge the specification gap, namely version space algebras, CEGIS loops, type systems and formal verification, are the same tools needed to build AI systems that are auditable, governable, and correct by construction. Program synthesis has been studying alignment, at smaller scale, since 1971.
The first practical breakthrough came from reframing specification as a dialogue. Sumit Gulwani’s Programming by Example (PBE) replaced formal descriptions with demonstration: show the system what you mean, and let it infer the rule. The theoretical structure that makes PBE tractable is the Version Space Algebra (VSA): rather than enumerating consistent programs, the VSA represents them symbolically as a directed acyclic graph, intersecting version spaces as each new example narrows the hypothesis set. Flash Fill’s DSL, comprising roughly 40 production rules covering substring extraction, regex-based positioning, and concatenation, combined with VSA compression produces synthesis fast enough to run interactively inside Excel. Program ranking uses Minimum Description Length: shorter programs are preferred, formalising Occam’s razor with Bayesian optimality guarantees.
PROSE (PROgram Synthesis using Examples) generalised Flash Fill into a framework using witness functions, which are per-operator inversions of operator semantics that enable top-down pruning of the search tree, and has been deployed at enterprise scale across Microsoft’s product suite: PowerShell, Azure SQL, number formatting. Sketch-based synthesis (Solar-Lezama, MIT 2006) adds a different guidance mode: the programmer supplies an algorithmic skeleton with holes, and the CEGIS loop fills them by alternating between a synthesizer filling holes and a verifier producing counterexamples until a correct program emerges. Both traditions formalise the same insight: synthesis is most powerful not when it eliminates human guidance, but when it makes that guidance as effortless as possible.
The frontier of guided synthesis is active learning. Chaudhuri et al.’s 2025 work on Active Learning for Neurosymbolic Program Synthesis uses constrained conformal evaluation (CCE) to select the targeted question that most reduces specification ambiguity given that neural components may mispreddict. The system converges to the intended program with far fewer user interactions than passive example collection requires. This is synthesis as a cooperative human-machine dialogue, representing the most mature realisation yet of the guided synthesis programme.
“The goal is not to eliminate human guidance from synthesis. The real aim is to make that guidance as effortless and natural as possible. A system that asks the right question at the right moment is more powerful than a system that demands a complete specification.”
Swarat Chaudhuri, UT Austin, Neurosymbolic Program Synthesis Handbook (2025)
The Transformer architecture (2017), applied to code at scale, unlocked the third paradigm. Codex (Chen et al. 2021), trained on 159 GB of GitHub code across 54 million repositories, achieved pass@1 of 28.8% on HumanEval, a benchmark effectively saturated above 90% by 2024. AlphaCode (Science 2022), generating up to 1 million candidates per competitive programming problem then filtering via execution, reached the 50th percentile of human competitors. AlphaCode 2 (2023) reached the 85th percentile. SWE-bench, covering 300 real GitHub issues in large codebases, moved from near-zero in 2023 to approximately 50% by early 2025. The performance trajectory is among the steepest in AI benchmarking history.
But neural synthesis carries a structural weakness: the hallucination-correctness gap. Language models predict token by token according to the statistical patterns of their training data. Pearce et al. (IEEE S&P 2022) found exploitable security vulnerabilities in roughly 40% of GitHub Copilot outputs across CWE Top-25 scenarios. The deeper limitation is epistemic: a language model has no model of program semantics. It knows what programs that look like this program tend to do, not what this program actually does. Fluency is not understanding. Statistical confidence is not correctness.
The pass@k insight. Neural synthesis is a sampler, not a solver. Codex achieves pass@1 of 28.8% but pass@100 of 72.3% on HumanEval. The correct program is often in the output distribution; the challenge is identifying it, which is precisely where symbolic verification becomes not optional but essential.
The neurosymbolic revolution: neural expressiveness and symbolic precision, unified in a pipeline that is simultaneously fast, expressive, and verifiably correct.
Neural systems are fast, expressive, and scalable but cannot guarantee correctness. Symbolic systems can guarantee correctness but are brittle to specification imprecision and cannot operate outside their defined grammar. Kambhampati’s LLM-Modulo framework (ICML 2024) formalises this complementarity: LLMs are approximate retrieval engines, appropriate as generators within pipelines that include sound critics: symbolic verifiers, type checkers, SMT solvers that can certify or reject proposals. The LLM contributes search breadth; the critics contribute soundness. Neither is replaceable by the other.
ALGO (Ni et al., NeurIPS 2023) instantiates this architecture for competitive programming, improving pass@1 from 56.2% to 73.6% on MBPP. DreamCoder (Ellis et al., PLDI 2021) reveals what this combination becomes when the architecture is designed to improve itself: alternating between a wake phase (neural search over a primitive library) and a sleep phase (library learning, abstracting recurring program fragments into new higher-level primitives), DreamCoder discovered standard functional programming patterns, including map, fold and filter, independently from synthesis data. A synthesis system that restructures its own search space through experience is qualitatively different from one that merely generates candidates.
Grammar-constrained decoding (Synchromesh, Poesia et al. 2022) brings this integration into the inference step itself: constraining Transformer decoding to generate only strings parseable by a specified context-free grammar, weaving symbolic structure into the generation process rather than applying it as a post-hoc filter. Reflexion (Shinn et al., NeurIPS 2023) uses iterative execution feedback, running the generated program, capturing failure traces and prompting the model to revise, to improve pass@1 from 80.1% to 91.0% on HumanEval (GPT-4 baseline), with gains attributable entirely to the execution loop, not model weights.
“The right mental model for LLMs in synthesis tasks is not a solver. Think of it as an approximation oracle. The moment you forget that distinction, you will be surprised by failures that look like hallucinations but structurally exactly what you should expect from a system with no model of truth.”
Subbarao Kambhampati, Arizona State University, ICML 2024
At the top of the correctness stack sits formal verification, and the landmark result here is AlphaProof (Hubert et al., Nature 2025): an AlphaZero-inspired agent learning to construct formal proofs in the Lean 4 theorem prover via reinforcement learning, trained on auto-formalised mathematical problems generated by a fine-tuned Gemini model. At the 2024 International Mathematical Olympiad, AlphaProof solved three of five non-geometry problems, including the competition’s hardest, and reached silver medalist level combined with AlphaGeometry 2.
AlphaProof matters beyond its benchmark score. It is the first large-scale demonstration that a neurosymbolic system can produce formally verified correct outputs on problems requiring genuine mathematical creativity. Every proof it generates is machine-checkable in Lean: not “it seems right,” not “it passed the tests,” but a certificate verifiable by an independent formal system. And it improves through the act of trying. Successful proofs become training data, failures reveal gaps filled by harder auto-formalised problems. The system bootstraps its own curriculum. This is the property that makes the neurosymbolic programme genuinely new: not just that hybrid systems outperform their components, but that they can self-improve in ways that neither neural nor symbolic systems achieve alone.
The formal verification infrastructure of the deductive tradition, dismissed as impractical for forty years, turns out to be exactly what the neural era needs to make its outputs trustworthy. The legacy of each generation is load-bearing for the next.
Correctness is necessary but not sufficient for trustworthy AI. A program can be formally verified to satisfy its specification and still cause harm if the specification was incomplete, or written by someone whose incentives diverged from the users’, or the verified behaviour is correct in the test environment but misaligned in deployment. An AI system generating code or decisions in high-stakes settings requires not only correctness guarantees but audibility, the ability to trace any output back to the reasoning that produced it, and adaptability, the ability to update behaviour as requirements change without full retraining. Hybrid neurosymbolic architectures have structural advantages on both: symbolic components are inspectable by design, and modular separation between neural generators and symbolic critics makes partial updates tractable in ways that monolithic networks are not.
Three unsolved problems define the frontier. Specification inference: can a synthesis system construct a formal specification from informal user behaviour and use it to verify its own outputs? Compositional synthesis: can a system synthesise large multi-module programs by decomposing them into independently synthesisable subproblems and verifying the composition? Adaptive synthesis: can synthesised programs be updated incrementally as specifications change, without full re-synthesis? These are not distant research goals. They are the architectural requirements for AI systems that can be trusted in the real world.
What AlphaProof proves, beyond its IMO silver medal, is that the combination of neural expressiveness, symbolic precision, and reinforcement-driven self-improvement can produce verifiably correct outputs on problems requiring genuine creative reasoning. The spreadsheet anecdote captures where synthesis has been. AlphaProof captures where it is going. The distance between these two points is sixty years of accumulated theory about what it means for a machine to understand what you mean. That theory is now, finally, becoming infrastructure. The systems built on it, auditable, adaptive and co-built with the humans who use them, are the AI of the next era.
“As software becomes more accessible, the frontier shifts to what’s harder to replicate: systems strategy, adaptive AI, deep collaboration, and governed context. The platform where human teams supervise, co-build, and co-own long-horizon outcomes.”
Daice Labs, on the next frontier of hybrid AI
Key references: Hubert T. et al., "Olympiad-level formal mathematical reasoning with reinforcement learning" (Nature 2025); Chaudhuri S. et al., "Neurosymbolic Program Synthesis" (Handbook 2025); Chaudhuri S. et al., "Active Learning for Neurosymbolic Program Synthesis" (PACMPL 2025); Kambhampati S. et al., "LLMs Can't Plan" (ICML 2024); Gulwani S. et al., FlashFill (POPL 2011); Solar-Lezama A., Sketch (MIT 2008); Ellis K. et al., DreamCoder (PLDI 2021); Ni A. et al., ALGO (NeurIPS 2023); Shinn N. et al., Reflexion (NeurIPS 2023); Pearce H. et al. (IEEE S&P 2022); Li Y. et al., AlphaCode (Science 2022); Chen M. et al., Codex (2021); Poesia G. et al., Synchromesh (2022); Polikarpova N. et al. (PLDI 2016); Manna Z. & Waldinger R. (1971).
Daice Labs Inc.
Brookline, MA, USA
Roll the "daice"–exploration & programmable adaptation.