Neural Proposals, Symbolic Guarantees: Neuro-Symbolic Graph Generation with Hard Constraints

Chuqin Geng, Li Zhang, Mark Zhang, Haolin Ye, Ziyu Zhao, Xujie SiarXiv 2026

TL;DR

Purely deep learning approaches for molecule generation often act as black boxes, struggling with precise controllability and failing to provide formal structural guarantees. This paper introduces Neuro-Symbolic Graph Generative Modeling (NSGGM), a framework that pairs an autoregressive neural network for proposing molecular fragments with an SMT solver to guarantee 100% chemical validity and strict adherence to user-defined logical constraints by construction.

What Problem Does This Paper Address?

Generating novel molecular graphs is a cornerstone of modern drug discovery and materials science. While deep learning models (like VAEs and diffusion models) excel at learning the underlying distribution of chemical datasets, they learn structural and chemical rules implicitly.

As a result, they frequently generate chemically impossible structures or require brute-force, post-hoc filtering to meet specific design criteria (e.g., "the molecule must contain fragment A, and if it contains fragment B, it must also contain fragment C"). Post-hoc filtering scales terribly as constraints become more complex or scaffolds grow larger. In high-stakes domains like pharmacology, researchers need transparent, verifiable control over graph generation where constraints are explicitly guaranteed rather than merely hoped for.

Methods

NSGGM splits the graph generation task into a two-stage neuro-symbolic pipeline:

  1. Neural Proposal: Molecules are first decomposed into a vocabulary of fundamental motifs (subgraph tokens like rings and tree structures). A VAE with a Graph Neural Network (GNN) encoder maps these structures to a latent space. At generation time, an autoregressive Transformer decoder proposes a sequence of these motif tokens, while a bidirectional refinement network predicts how these fragments should interface (predicting slots, merge types, and parent-child guidance).
  2. Symbolic Assembly: Instead of letting the neural network stitch the pieces together imperfectly, NSGGM hands the proposed blueprint over to a Satisfiability Modulo Theories (SMT) solver (specifically, Z3). The assembly is formulated as a Constraint Satisfaction Problem (CSP). The solver enforces hard constraints ($\phi_{hard}$) like valency caps, element consistency, and topological integrity, alongside any complex, non-local user-defined logical constraints ($\phi_{user}$). It uses Max-SMT to optimize soft constraints (like maximizing connectivity) to ensure the final graph isn't fragmented.
An overview of the NSGGM framework, showcasing the pipeline from preprocessing to neural proposal and symbolic assembly.

Datasets

The authors evaluate NSGGM on standard molecular and non-molecular benchmarks:

  • QM9: A small-scale dataset of organic molecules up to nine heavy atoms.
  • MOSES & GuacaMol: Large-scale medicinal chemistry datasets used to evaluate distribution learning, diversity, and novelty.
  • Non-Molecular Graphs: Stochastic Block Models (SBM) and Planar graphs to test the framework's generalizability.
  • Logical-Constraint Molecular Benchmark: A newly introduced benchmark by the authors. It features synthetic, chemistry-inspired logical constraints (using XOR, IFF, and implication gates) designed to test how well models handle highly restrictive, non-local structural rules, including an intentionally unsatisfiable constraint ($\phi_{UNSAT}$) to verify if a model can formally prove infeasibility.

Key Insights and Ideas

  • Separation of Concerns: The core philosophy is to let neural networks do what they do best (learning complex data-driven priors and high-level guidance) and let symbolic solvers do what they do best (perfectly executing hard logic and combinatorial search).
  • Zero-Shot Constraint Enforcement: Because constraints are handled entirely by the SMT solver at inference time, users can introduce entirely new, highly complex logical constraints without retraining the neural model.
  • Handling the Unseen: Purely neural models completely fail when asked to generate structures that satisfy constraints with zero support in the training data. NSGGM bypasses this limitation because the SMT solver can mathematically deduce valid combinations of fragments even if the network has never seen them combined that way before.
  • Formal Unverifiability Detection: If a user provides an impossible set of constraints ($\phi_{UNSAT}$), NSGGM doesn't waste time generating bad molecules; the SMT solver formally returns UNSAT, providing a clear certificate of infeasibility.

Key Results

  • 100% Validity: NSGGM achieves a perfect 100% chemical validity rate across QM9, MOSES, and GuacaMol benchmarks by construction, while matching or exceeding state-of-the-art distributional fidelity (FCD and KL divergence metrics).
  • Superior Sample Efficiency: Under complex logical constraints ($\phi_1, \phi_2$), NSGGM requires drastically fewer attempts to generate valid molecules compared to purely neural baselines like MoLeR and GenMol.
  • Cracking the Zero-Support Challenge: For constraint $\phi_3$ (which has zero satisfying examples in the training set), purely neural models generated exactly zero valid molecules within a 50k sampling budget. NSGGM achieved a ~25% satisfaction rate thanks to exact symbolic enforcement.
Sample efficiency under logical constraints: cumulative number of constraint-satisfying molecules versus the number of generation attempts.
Figure 3. Example generated molecule satisfying φ3
  • Non-Molecular Success: On SBM and Planar graph generation, NSGGM achieved the highest proportion of valid, unique, and novel graphs (V.U.N. of 77% on SBM) and the lowest degree distribution errors.

Limitations and Future Work

  • Logical Fragility: Explicitly specifying constraints in first-order logic can be rigid and fragile. It requires users to know exactly what they want to restrict, which might not capture fuzzy or under-specified human preferences.
  • Solver Overhead: While the SMT solver is CPU-efficient, scaling to exceptionally large graphs with dense, highly complex combinatorial constraints could potentially introduce computational bottlenecks compared to pure single-forward-pass neural networks.
  • Future Directions: The authors suggest future work should focus on better balancing the flexibility of soft neural preferences with the rigid verification of symbolic logic, as well as extending the framework to more diverse non-molecular domains.

Summary updated

BibTeX
@misc{geng2026neural,
  author = {Chuqin Geng and Li Zhang and Mark Zhang and Haolin Ye and Ziyu Zhao and Xujie Si},
  title = {{Neural Proposals, Symbolic Guarantees: Neuro-Symbolic Graph Generation with Hard Constraints}},
  year = {2026},
  eprint = {2602.16954},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2602.16954},
}
Figure