Learn Locally, Recurse Globally: Neural Circuit Synthesis Beyond Training Depth
Abstract
Reasoning, planning, and agentic systems demand extrapolation from training instances to harder, more compositional problem instances they encounter at deployment. Neural networks trained by gradient descent generalize reliably within their training domain but struggle to extrapolate beyond it, even when global solutions are representable in their architecture class. We study the learn locally, recurse globally paradigm: train a neural model on problems of bounded difficulty and apply it iteratively under a verifiable outer loop that decomposes hard instances into a sequence of in-distribution sub-instances and reassembles the result. We instantiate this idea in Boolean circuit synthesis from truth-tables, which we adopt as a controllable abstraction of logical reasoning: a truth-table is a complete specification, so verification is exact, and circuit depth is a clean proxy for the difficulty of the underlying reasoning task. Empirically, a 2.2 M-parameter encoder-decoder Transformer trained on depth <= 2 circuits, wrapped in an XOR residual refinement loop, synthesizes circuits exactly at 5x training depth, with circuits of about half the depth, counted with unbounded fan-in gates, of those of a standard EDA tool. Extrapolation to input arities beyond the encoder's reach is harder in general and relies on identifying subsets of active variables. We connect the algorithms to classical Boolean decomposition theory and to recent results on the expressivity limits of constant-depth Transformers.