ICLR2026

Structure-Aware Graph Hypernetworks for Neural Program Synthesis

Wenhao Li, Yudong Xu, Elias Boutros Khalil, Scott Sanner

Abstract

We study the neural program synthesis of parameterized\textit{parameterized} function families through the lens of meta-learning with hypernetworks. Given a user intent UU, a meta-learner MϕM_{\phi} produces a full weight set θ^=Mϕ(U)\hat{\theta}=M_{\phi}(U) for a target neural network with fixed architecture SS, and the instantiated network mS,θ^(X)Ym_{S,\hat{\theta}}(X)\to Y realizes the behavior intended for UU. Classical hypernetworks typically ignore the target network’s structure\textit{ignore the target network’s structure} and emit a flat list of weights; as a consequence, they fail to account for neuron-permutation symmetry\textit{neuron-permutation symmetry}—many distinct parameterizations of SS implement the same function—so equivalent solutions are treated as different targets, fragmenting supervision and hurting out-of-distribution generalization. To address this, we propose Meta-GNN\textit{Meta-GNN}, a hypernetwork that constructs a neural graph\textit{neural graph} from the target architecture SS and applies structure-aware\textbf{structure-aware} message passing with parameter-tied encoders and decoders. This design reduces the search space during learning by collapsing equivalent classes of target networks, without loss of expressivity. Empirically, across modular arithmetic (AddMod\textit{AddMod}-pp), array operations (SumFirst\textit{SumFirst}-nn), and inverse-rule tasks from 1D-ARC, Meta-GNN\textit{Meta-GNN} substantially improves learning and out-of-distribution generalization\textbf{out-of-distribution generalization} compared to classic hypernetworks and direct (U,X)Y(U,X)\to Y baselines. Mechanistic analyses reveal what is learned\textit{what is learned}: on AddMod\textit{AddMod}-pp the synthesized Transformers recover the canonical clock representation and admit a compact closed-form map UθU\mapsto\theta. These results demonstrate that structure-aware Meta-GNNs enable reliable generalization to unseen program parameterizations\textit{unseen program parameterizations}, providing a critical advance for the nascent field of neural program synthesis.