Compiling Science into Generative Models
Abstract
Scientific generation requires outputs to satisfy deterministic physical and structural constraints, yet generative models typically treat such constraints as losses to be learned, which can bias sampling toward validity but **cannot forbid violation**. Published molecular-generation systems report chemical validity of 50%–98%, underscoring that chemical validity remains an **empirical property** rather than a **constraint compiled into the generation process**. To address this issue, we propose **Scientific Compilation** and instantiate this principle in **Mass-ASM**, an executable graph-construction language that **makes illegal structures unrepresentable** as successful outputs under explicitly encoded contracts. Mass-ASM provides a common executable representation for neural navigation and spectrum-based candidate evaluation. Machine audits confirm **100% compilation fidelity** and verify that the compiled system preserves its invariants, rejects adversarially invalid constructions, and exposes boundary cases as structured failures rather than invalid outputs. A random-weight control shows that legality alone does not provide effective navigation: an untrained model reaches 0% valid halt closure. The pretrained generator SpectraForge effectively navigates the compiled space, reaching 25.8% Top-1 on MassSpecGym after deterministic physics-based reranking. In this paradigm, deterministic rules define the boundaries of the feasible space, neural models navigate it, and mass-spectrometry physics selects. Scientific knowledge thus ceases to be merely a criterion for judging outputs but **becomes part of the computational substrate** that defines the space of possible generation.
est. 32% chance this paper gets accepted at ICLR 2027.
What do you think this paper will get?
All positions stay anonymous.