acceptodds
Under review as a conference paper at ICLR 2027

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.

Primary area:
applications to physical sciences (physics, chemistry, biology, etc.)
Keywords:
Scientific Compilation, Validity by Construction, Executable Semantics, Constrained Generative Models, Neurosymbolic AI, De Novo Molecular Generation, Mass Spectrometry

Reviews

Among:
Shape:
1234this paper, Bottom 10%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 1.67 over 3 reviews, above 10% of the others.
Reviewer_kHLeOpenReview ↗
Rating
2
Confidence
2
Informativeness
2
Presentation
1
Soundness
2
Read review
Paper summary

The paper presents an approach for molecule generation from mass spectra that relies on the definition of a search space (states and actions) that guarantees chemical validity of the generated molecules.

Critical strengths

The approach is guaranteed to generate valid molecules, something that most alternative solutions cannot do.

Results show that the approach outperforms existing alternatives in a challenging benchmark, especially on top 10% de-novo structure identification.

Critical weaknesses

The work is presented as compiling science into generative models, hinting at a general approach that is valid across multiple scientific domains. However compilation in the paper is a principle rather than a technique, and the work specifically focuses on defining an instruction program for molecule generation from mass spectra. The contribution is thus overstated in the current form in my opinion.

The presentation is very much focused on the application task, and it is hard to follow for readers lacking domain expertise. There was no attempt at broadening the contribution or framing it in a way that simplifies as follow-up adaptation to other domains and tasks.

Questions for authors

You state that the exclusion criterion of very close structural neighbours was impossible due to computational cost. How does this affect the results? are results of different methods really comparable?

Reviewer_7YXAOpenReview ↗
Rating
2
Confidence
2
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

The paper proposes Mass-ASM, a molecular representation that generates structures as programs. An executor checks element quotas, valence, mass, and other constraints during decoding. A Transformer generates these programs from a molecular formula and a predicted ECFP fingerprint. The candidates are then reranked using the model score, MassProof, and MetFrag, with weights of 1:0.5:0.5.

Under the formula-conditioned bonus setting of MassSpecGym, SpectraForge reports 25.8% Top-1 and 40.6% Top-10 accuracy, compared with the published MS-GPT results of 23.91% and 28.65%. The paper also includes interpreter audits, a random-weight control, and experiments with different beam widths and fingerprint inputs. These help separate successful execution from finding the correct molecule. At beam 256, Any-Hit reaches 47.7% under MIST fingerprints and 76.7% under oracle fingerprints.

Critical strengths
  1. The paper carefully examines what the decoding constraints do and do not guarantee. The interpreter audit reports 100% pass on 4,657,064 reference-action checks, 6,635,476 adversarial-injection rejections, and InChIKey-14 round-trip agreement on 61,907 structure instances. It also reports boundary cases: 3,629 of 360,391 forced continuations reach an authorized HALT, which does not necessarily mean the returned structure is accepted. The random-weight control uses a 13.15M-parameter model on 500 test spectra with beam width 8 and reaches no valid closure. Together, these results show why enforcing constraints and learning to find the correct structure need to be evaluated separately.

  2. The supplementary provides useful details and artifacts for checking the interpreter. Supplementary sections D1–D7 describe the vocabulary, guards, state fields, tolerances, and implementation limits. The package also contains the audit code and records. I ran the supplied verifier, and its checks of the archived counts passed. This checks consistency within the archived results; it does not rerun the underlying experiments or validate the main identification results. I also appreciate that D4.4 clearly describes the limits of element and ring-tag tracking.

Critical weaknesses
  1. The identification experiments do not isolate the benefit of Mass-ASM. The full system combines MIST fingerprints, constrained beam search, and reranking. The six ranking arms, beam-width sweeps, oracle-versus-predicted fingerprints, and random-weight control are useful, but they do not provide a matched comparison with another representation or constraint mechanism. For example, a comparison with SELFIES using matched training data, model capacity, fingerprint inputs, ranking, and compute would help show what Mass-ASM adds. Accepted-candidate yield, Any-Hit, Top-k accuracy, runtime, and failure rates would all be useful measures.

    The reranking results make it important to distinguish the contributions of the different components. At beam 256, the reported gain from fusion is 2.5 percentage points under predicted fingerprints (Sec. 4.4). This gives a beam-only Top-1 accuracy of approximately 23.3%, below MS-GPT's published 23.91%. Thus, reranking is needed for this configuration to exceed that reported score. This does not mean Mass-ASM has no benefit: it produces the candidate pool that the reranker uses. However, the current experiments leave that benefit unclear. This missing comparison is the main reason for my recommendation.

  2. More information is needed to judge the reported improvements. The main identification results have no confidence intervals or reported variation across training runs. Table 4 imports baseline values "as published," so it is also unclear whether the test identities, filtering, denominators, and scoring conventions match. The aggregate scores alone are not enough to assess a paired comparison. A bootstrap that resamples molecular identities would help account for the fact that the 13,702 test spectra correspond to 2,903 InChIKey-14 identities.

    The known-formula setting is stated in Table 4, but the abstract reports the 25.8% Top-1 result without this qualifier. Separately, the approximately 110M-record pretraining corpus excludes exact matches to validation and test molecules, but does not apply the benchmark's recommended MCES < 2 exclusion for nearby structures (Sec. 4.1). The similarity between this corpus and the test set is not measured. These points do not invalidate the reported scores, but they leave uncertainty about whether the improvements are robust and the comparisons are on equal terms.

Questions for authors
  1. Implementation. Which vocabulary, compiler, masker, and repair logic produced the main results, and which audits cover them? D4.4 notes missing quota guards for some elements and missing anchor tracking for T17–T32. How are these cases handled during decoding and final validation? Please also share any available post-HALT rejection rates and common failure modes.

  2. Mass-ASM’s contribution (main experimental question). How does Mass-ASM compare with an alternative such as SELFIES under comparable training, model capacity, fingerprint inputs, ranking, and compute? Candidate yield, Any-Hit, Top-k accuracy, and runtime would be useful. A smaller controlled comparison would be welcome. If new experiments are not feasible, please explain what the existing results tell us about this contribution.

  3. Evaluation. Could you add uncertainty estimates for the main results in Table 4, for example by bootstrapping over the 2,903 molecular identities? Please clarify any known differences in test sets, filtering, denominators, or metrics across baselines. Also, please state the known-formula setting in the abstract and explain how the fingerprint threshold, 256-active-bit cap, and fusion weights were chosen, including whether they were fixed before testing.

  4. Pretraining similarity. Could you estimate how similar the pretraining molecules are to the test molecules, given that the recommended MCES < 2 exclusion was not applied? A sampled or approximate analysis would be useful; please describe the sampling, similarity measure, and limitations.

Reviewer_H6GiOpenReview ↗
Rating
1
Confidence
3
Informativeness
2
Presentation
2
Soundness
1
Read review
Paper summary

This paper introduces Scientific Compilation and Mass-ASM, combining deterministic chemical and physical constraint enforcement with neural search and physics-based reranking for molecular structure identification from mass spectra.

Critical strengths

The framework separates constraint enforcement from learned search, and the interpreter is carefully audited.

Critical weaknesses
  1. The novelty over existing grammar-based and constrained decoding methods is unclear. At the decoding level, Mass-ASM uses deterministic state transitions and masks actions that are inadmissible under encoded guards.
  2. Pretraining leakage is not fully excluded. Exact test identities are removed from the 110M pretraining set, but the recommended MCES-based near-neighbor exclusion was not performed.
  3. The contribution of Mass-ASM is not isolated. The main comparison uses external systems rather than a matched representation-level ablation, so the performance difference cannot be attributed specifically to Mass-ASM.
Questions for authors
  1. How does Scientific Compilation differ technically from existing constrained decoding?
  2. How many test molecules have close MCES neighbors in the pretraining set?
  3. How does Mass-ASM compare with SMILES or SELFIES under matched settings?

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.