Mechanistic Reaction Prediction via Discrete Flow Matching on Graph-Structured Electron Occupation
Organizations: École Polytechnique Fédérale de Lausanne (EPFL) · National Centre of Competence in Research (NCCR) Catalysis
Abstract
Chemical reactions are fundamentally transformations in electron space, yet most machine learning approaches model them either through de novo generation of product molecules or through heuristic graph edits that operate directly on molecular topology. We introduce MAELLE (MechAnistic Edit fLow-matching on eLectron rEarrangements), which instead models reactions as discrete flow matching over electron occupation vectors. Concretely, we formulate the reactant-to-product mapping as a Continuous-time Markov Chain (CTMC) over the graph-structured integer-valued electron occupation space defined on all bonding, non-bonding, and hydrogen sites. To construct the interpolants between the reactants and products, we generalize the discrete flow matching mixture path to an edit-based formulation, where the electron moves are interpolated using Optimal Transport, yielding a mechanism-like set of moves without elementary step annotations. MAELLE achieves competitive performance on the USPTO-480K benchmark compared with leading reaction prediction models. Beyond in-distribution learning, we evaluate robustness across two out-of-distribution settings - structural complexity and reaction type - and find that MAELLE maintains strong performance where existing methods degrade. Finally, because the learned flow operates over the full electron redistribution, MAELLE naturally recovers mechanistic trajectories that align with known chemistry and can predict side products of a reaction.
Figures & tables
| Method | Input | Output | Mech. step | Directional | Broad | Atom |
|---|---|---|---|---|---|---|
| label-free | elec. re-dist. | coverage | conservative | |||
| Molecular Transformer [ 9 ] | SMILES | SMILES | ✓ | ✗ | ✓ | ✗ |
| Graph2SMILES [ 11 ] | SMILES | SMILES | ✓ | ✗ | ✓ | ✗ |
| Chemformer [ 26 ] | SMILES | SMILES | ✓ | ✗ | ✓ | ✗ |
| MEGAN [ 12 ] | Graph | Graph edits | ✓ | ✗ | ✓ | ✗ |
| GTPN [ 13 ] | Graph | Graph edits | ✓ | ✗ | ✓ | ✓ |
| Method | Prediction | Top-1 | Top-3 | Top-5 | Top-10 |
|---|---|---|---|---|---|
| modality | |||||
| Molecular Transformer † [ 9 ] | SMILES | 0.886 | 0.935 | 0.942 | — |
| Graph2SMILES † [ 11 ] | SMILES | 0.903 | 0.940 | 0.948 | 0.953 |
| MEGAN † [ 12 ] | Graph edits | 0.863 | 0.924 | 0.940 | 0.954 |
| GTPN † [ 13 ] | Graph edits | 0.832 | 0.860 | 0.865 | — |
| NERF † [ 27 ] | Electron edits | 0.907 | 0.933 | 0.937 | — |
| Bond formation type | # ground-truth elementary steps | Recovered by MAELLE’s trajectories | ||
|---|---|---|---|---|
| Correct | Top 1 | All | ||
| Persistent | 17,925 | 13,137 (73.3%) | 14,236 (79.4%) | 17,847 (99.6%) |
| Transient | 19,658 | 3,042 (15.5%) | 747 (3.8%) | 5,814 (29.6%) |
| Total | 37,583 | 16,179 (43.0%) | 14,983 (39.9%) | 23,661 (63.0%) |
| Sampling mode | Elementary steps coverage | Directional agreement of elementary steps |
|---|---|---|
| Correct | 16,179/37,583 (43.0%) | 13,694/16,179 (84.6%) |
| Top-1 | 14,983/37,583 (39.9%) | 13,342/14,983 (89.0%) |
| All | 23,661/37,583 (63.0%) | 18,505/23,661 (78.2%) |
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
| Split | MW (mean std) [Da] | OOD criterion | |
|---|---|---|---|
| train | – | ||
| val | – | ||
| test_iid | none (IID) | ||
| test_ood_mass | product MW Da | ||
| test_ood_ester | non-methyl ester chemistry |