SlowGuess/NeurIPS_2023_OCR huggingface dataset:
We employed the MoFlow framework developed by Zang et al. [32] for our molecular structure generation tasks. The implementation we used is publicly accessible at https://github.com/calvin-zcx/moflow. We trained the model on  $80\%$  of the respective dataset, using a batch size of 256 for a maximum of 200 epochs. All model parameters were selected based on the example provided in the GitHub repository. Specifically, the B-Block of the model utilized 10 flows and had 512 hidden channels in both layers. In the A-Block, the model was configured with 38 flows and had 256 hidden graph neural network channels, along with hidden linear layers of sizes 512 and 64. Masking parameters were set with both a row size list and a row stride list of 1. A noise scale of 0.6 was employed to introduce a stochastic element into the behavior of the model. To optimize properties, we implemented a hill-climbing-based algorithm. In this approach, the model was randomly sampled, and the top 250 molecules were selected from a total of 500 oracle calls for subsequent training. This cycle was repeated for up to 10 iterations, depending on the benchmarking task.
S5.1.6 REINVENT
In REINVENT [30], similar to LSTM-HC, an LSTM that is pretrained on a reference dataset is used as a prior for generating new SMILES sequences. Reinforcement learning (RL) is used to optimize for a particular fitness value. The LSTM model acts as an agent, where the addition of a character is an action, and the output probability distribution is the action probability, or the policy. The action probability is augmented by a scoring function  $S(m) \in [-1, 1]$ , with larger scores corresponding to more desirable fitness values. SMILES that do not correspond to valid molecules are assigned a score of 0. The algorithm updates the policy to increase the expected fitness while still keeping the learned conditional sequence probabilities to produce valid SMILES that resemble the structural distribution of the reference dataset. The scoring function is a modified sigmoid function parameterized by the known fitness values from previous iterations. Let the set of known fitness values be  $F$ . The scoring function for a molecule  $m$  is defined as
$$
S (m) = \frac {2}{1 + e ^ {- b (f - a)}} - 1, \tag {2}
$$
where  $a$  is the average of  $F$ , and  $b$  is the slope of the sigmoid. This sigmoid is defined as
$$
b = - \frac {1}{m a x (F) - a} \ln \left(\frac {2}{c + 1} - 1\right), \tag {3}
$$
where  $c$  is a threshold value set to 0.8. This means for the current fitness values in  $F$  that the best known fitness will map to 0.8 in the scoring function. The smaller the threshold  $c$ , the stronger the reward for fitness values larger than the best one contained in  $F$ . Further details about the approach and model parameters are provided in the original paper [30].
S5.2 Benchmarks
S5.2.1 Design of Organic Photovoltaics
**Workflow** To set up the property prediction workflow, we first implemented the Scharber model [41]. To do that, we constructed a simplified model to predict the short-circuit current density  $(J_{SC})$ . The canonical way to do that is via definite integration of the spectrum of the light source over the energy range of the absorbed light of the simulated device [42]. To bypass having to perform the integration in the property simulation workflow and provide the Reference Air Mass 1.5 Spectra (AM1.5G) as part of TARTARUS, we created a regression model for the short-circuit current density as a function of the band gap energy  $E_{G}$ . We used the AM1.5G spectrum that accounts for both direct and circumsolar irradiation and performed the integration via the trapezoidal rule as implemented in the numpy package. We found that a simple Gaussian function of the form
$$
J _ {S C} = A \cdot e ^ {- \frac {E _ {G} ^ {2}}{B}}, \tag {4}
$$
where  $A$  and  $B$  are fitting parameters, provides an excellent fit to the actual integration as demonstrated in the comparison between the original relationship derived from integration of the AM1.5G reference data (denoted "Original") and the fitted function (denoted "Fit") in Figure S6. Importantly, the regression model assumes an external quantum efficiency of 0.65, which is typically used in the Scharber model [41]. Typically, the band gap energy is approximated by the gap between the HOMO of the donor and the LUMO of the acceptor, which then, in conjunction with the regression model just described, allows to estimate the short-circuit current density that is needed to compute the power conversion efficiency (PCE) under the assumptions of the Scharber model [41].
Figure S6: Short circuit current density as a function of the band gap energy of the light-absorbing material in an organic solar cell. The original dependency results from the integration of the Reference Air Mass 1.5 Spectra (AM1.5G). The fit depicts the result of regression with a Gaussian function with two fitting parameters.
Besides the computation of the short-circuit current density, the procedure described in the original paper was followed [41]. The open circuit voltage  $(V_{OC})$  is determined as energy difference between HOMO of the donor and the LUMO of the acceptor minus  $0.3\mathrm{eV}$  of overpotential that is typically assumed to be required for any charge separation to take place [42]. Should the open circuit voltage be formally estimated to be negative then it is assumed to be 0. In case the LUMO of the donor is less than  $0.3\mathrm{eV}$  higher in energy than the LUMO of the acceptor then the open circuit voltage is also assumed to be 0. The power conversion efficiency is estimated based on the equation
$$
P C E = 100 \% \cdot V _ {O C} \cdot F F \cdot \frac {J _ {S C}}{P _ {i n}}, \tag{5}
$$
where  $V_{OC}$  is the open circuit voltage,  $FF$  is the fill factor,  $J_{SC}$  is the short-circuit current density, and  $P_{in}$  is the incident light intensity obtained by integration over the entire AM1.5G reference spectrum and therefore is constant. In the Scharber model, the fill factor is typically assumed to be estimable to reach a value of 0.65 [156], which is thus inserted into this equation. For the first task of the organic photovoltaic design benchmarks, the goal is to design a small organic donor molecule used with [6,6]-phenyl-C61-butyric acid methyl ester (PCBM) as acceptor. The LUMO energy level of PCBM is -4.3 eV and all light is assumed to be absorbed by the donor molecule. Notably, this is a common design objective that has been pursued in the OPV literature [41, 42] and was also implemented in the Harvard Clean Energy Project (CEP) [37, 40]. For the second task, a small organic acceptor molecule is to be designed that is used with poly[N-90-heptadecanyl-2,7-carbazole-alt-5,5-(40,70-di-2-thienyl-20,10,30-benzothiadiazole)] (PCDTBT) as a donor. The HOMO energy level of PCDTBT is -5.5 eV and all light is assumed to be absorbed by the acceptor molecule. This benchmark task is based on a high-throughput virtual screening that was conducted in the literature to find new non-fullerene acceptors [43].
The computational property prediction workflow accepts a SMILES string as input and uses Open Babel [157] to generate initial guess Cartesian coordinates. Next, crest [158] is used for conformer search of the molecule via the iMTD-GC workflow at the GFN-FF level of theory [159] using the additional keywords -mquick, and -noref topo. Subsequently, the lowest energy conformer resulting from this search is used for a geometry optimization at the GFN2-xTB level of theory [54]. The properties of interest, i.e. HOMO energy, LUMO energy, HOMO-LUMO gap and molecular dipole moment, are obtained from the minimized structure at the same level of theory.
Importantly, to obtain better PCE estimates, we calibrated the HOMO and LUMO energies obtained from GFN2-xTB simulations against the corresponding density functional approximation (DFA) results taken from the Harvard Clean Energy Project Database (CEPDB) for the reference molecules of the CEPDB subset. In particular, the median HOMO and LUMO energies of all the DFA results contained in the CEPDB were used. Both the HOMO and the LUMO energies were calibrated against the respective medians of the DFA HOMO and LUMO energies using a Theil-Sen estimator [160, 161], as implemented in the python package scikit-learn [162], due to its robustness with respect to outliers. The maximum number of subpopulations set to 250,000. The linear regression functions derived are illustrated in Figure S7 and are provided in the following equations:
$$
E _ {H O M O, c a l i b r a t e d} = E _ {H O M O, G F N 2 - x T B} \cdot 0. 8 0 5 1 + 2. 5 3 7 7 e V \tag {6}
$$
$$
E _ {L U M O, c a l i b r a t e d} = E _ {L U M O, G F N 2 - x T B} \cdot 0. 8 7 8 8 + 3. 7 9 1 3 e V \tag {7}
$$
Figure S7: Two-dimensional histograms depicting the comparison of HOMO (left) and LUMO (right) energies obtained using DFA computations taken from the CEPDB against the corresponding energies at the GFN2-xTB level of theory obtained using the property simulation workflow developed for the design of organic photovoltaics benchmarks. The black lines were obtained via Theil-Sen estimators for linear regression.
As can be seen in Figure S7, the assumption of a linear relationship between the energies at the GFN2-xTB level of theory and at the DFA level of theory is reasonable.
Dataset The CEPDB subset used for training all the generative models was obtained from the following repository: http://github.com/HIPS/neural-fingerprint. For all molecules in this dataset, we simulated the corresponding properties of interest with the developed property simulation workflow (cf. Figure S8).
S5.2.2 Design of Organic Emitters
**Workflow** The computational property prediction workflow accepts a SMILES string as input and uses both Open Babel [157] and RDKit [163] to generate initial guess Cartesian coordinates. Whichever guess coordinates have a lower in energy at the GFN-FF level of theory are used as starting point for the subsequent conformer search of the molecule via the iMTD-GC workflow at the GFN-FF level of theory [159] using the additional keywords -mquick, and -noreftopo. Subsequently, the lowest energy conformer resulting from this search is used for a geometry optimization at the GFN0-xTB level of theory [53, 63, 64]. Afterwards, the optimized geometry is used to perform a TD-DFT single point calculation at the B3LYP/6-31G* level of theory [65-70] using the PySCF python package (version 1.7.6) [164-166]. Density fitting is utilized via the def2-universal-jkfit auxiliary basis set. For the excited state simulation, two excited states are generated for both the singlet and the triplet manifold. Notably, in case the molecule contains iodine, the LANL2DZ basis set [167] is used for that atom. From the corresponding results, the energies of the lowest excited singlet and triplet states, and the oscillator strength for the transition between the ground state and the lowest excited singlet state are obtained. The singlet-triplet gap is derived as energy difference between the first
PCE1 - SAS
PCE2 - SAS
PCE1
PCE2
Figure S8: Two-dimensional histograms depicting the property distributions of the provided reference dataset as obtained from the developed simulation workflow for the design of organic photovoltaics benchmark set. Top left: multiobjective target function  $PCE_{PCBM} - SAscore$  against power conversion efficiency with PCBM as acceptor  $PCE_{PCBM}$ ; top right: synthetic accessibility metric  $SAscore$  against power conversion efficiency with PCBM as acceptor  $PCE_{PCBM}$ ; bottom left: multiobjective target function  $PCE_{PCDTBT} - SAscore$  against power conversion efficiency with PCDTBT as donor  $PCE_{PCDTBT}$ ; bottom right: synthetic accessibility metric  $SAscore$  against power conversion efficiency with PCDTBT as donor  $PCE_{PCDTBT}$ .
Oscillator Strength
Figure S9: Two-dimensional histograms depicting the property distributions of the provided reference dataset as obtained from the developed simulation workflow for the design of organic emitters benchmark set. Left: multiobjective target function  $+f_{12} - \Delta E(S_1 - T_1) - |\Delta E(S_0 - S_1) - 3.2eV|$  against oscillator strength for the transition between  $S_{1}$  and  $S_{0}$ ,  $f_{12}$ ; middle: multiobjective target function  $+f_{12} - \Delta E(S_1 - T_1) - |\Delta E(S_0 - S_1) - 3.2eV|$  against singlet-triplet gap,  $\Delta E(S_1 - T_1)$ ; right: oscillator strength for the transition between  $S_{1}$  and  $S_{0}$ ,  $f_{12}$  against singlet-triplet gap,  $\Delta E(S_1 - T_1)$ .
Singlet Triplet
excited singlet and the first excited triplet state. Notably, only molecules with an SAscore below or equal to 4.5 are subjected to the property simulation workflow. All molecules above are assigned a very unfavorable fitness.
Dataset We developed a comprehensive set of filters to define a subset of GDB-13 [62], originally comprising more than 970 million organic molecules, with over 400,000 structures possessing cycles and a high degree of conjugation, that we herein refer to as  $\mathrm{GDB - 13}_{\mathrm{SUB}}$ . These filters ensure that the molecules encompass cyclic  $\pi$ -systems to increase representation of the relevant structural space for potential organic emitters. They were implemented via RDKit [163] and are summarized in Table S10. For the forbidden substructures, we utilized the following SMARTS patterns:
\[
\begin{aligned}
& \text{[Cl,Br,I]}, \quad * = * = *, \quad * \# *, \quad [0,o,S,s] \sim [0,o,S,s], \\
& \text{[N,n,0,o,S,s]} \sim [N,n,0,o,S,s] \sim [N,n,0,o,S,s], \\
& \text{[C,c]} \sim N =:, \quad [0,o,S,s];!R], \\
& \text{[N,n,0,o,S,s]} \sim [N,n,0,o,S,s] \sim [C,c] ==:, \quad [0,o,S,s,N,n;!R], \\
& * = [\text{NH}], \quad * = N-[*;!R], \quad * \sim [N,n,0,o,S,s] - [N,n,0,o,S,s;!R], \\
& * - [\text{CH1}] - *, \quad * - [\text{CH2}] - *, \quad * - [\text{CH3}]
\end{aligned}
\]
Table S10: List of filters employed to create the  $\pi$ -systems subset of GDB-13, GDB-13SUB. In each line,  $x$  denotes the value of the corresponding feature.
Number	Feature	Definition	Value
1	Charge	Charge of the molecule.	x=0
2	Radicals	Number of radical electrons.	x=0
3	Bridgehead Atoms	Number of bridgehead atoms.	x=0
4	Spiro Atoms	Number of spiro atoms.	x=0
5	Aromaticity Degree	Percentage of aromatic non-hydrogen atoms.	x≥0.5
6	Conjugation Degree	Percentage of conjugated bonds between non-hydrogen atoms.	x≥0.7
7	Maximum Ring Size	Size of the largest ring.	4≤x≤8
8	Minimum Ring Size	Size of the smallest ring.	4≤x≤8
9	Substructures	Presence of any forbidden substructures (see text).	FALSE
After filtering the GDB-13 dataset with these filters, and removing all molecules with an SAscore larger than 4.5, we subjected the resulting molecules to the property simulation workflow described above to obtain the reference dataset for the design of organic emitters benchmarks. The corresponding property distributions are visualized in Figure S9.
S5.2.3 Design of Protein Ligands
**Workflow** To set up the computational property prediction workflow with docking calculations, we downloaded crystal structures for the three proteins of interest from the Protein Data Bank (PDB). The corresponding PDB codes are 1SYH, 4LDE, and 6Y2F. The corresponding structures were all co-crystallized with a ligand bound to the protein. All these structures were processed using the protein preparation wizard [168] as implemented in the computer program Schrödinger (version 12.9). We created a box around the bound ligand for each of the protein structures based on re-docking accuracy. Subsequently, the native ligand was removed from the structure providing the starting setup for new ligands to be bound in the property simulation workflow. This workflow accepts a SMILES string as input, converts it into an initial 3D guess geometry using Open Babel [169] and exports it as a PDBQT file. Subsequently, the quality of the molecules is checked by running obenergy. During reading of the SMILES, the corresponding structure is inspected for the presence of the following SMARTS patterns:
\[
\begin{aligned}
& *1 = * * = * 1, *1 * = * = * 1, *1 \sim * = * 1, [F, C1, Br] C = [0, S, N], [Br] - C - C = [0, S, N], \\
& [N, n, S, s, 0, o] C[F, C1, Br], [I], [S & X3], [S & X5], [S & X6], \\
& [B, N, n, 0, S] \sim [F, C1, Br, I], * = * = * = *, *= [NH], [P, p] \sim [F, C1, Br], SS, C#C, C = C = C, \\
& * \sim [P, p] (= 0) \sim *, C = C = N, NNN, ["*;R1] 1 \sim [*] \sim [*] \sim [*] 1", 000,
\end{aligned}
\]
Figure S10: Two-dimensional histograms depicting the property distributions of the provided reference dataset as obtained from the developed simulation workflow for the design of protein ligands benchmark set. Top left: docking score to 4LDE  $\Delta E_{4LDE}$  against docking score to 1SYH  $\Delta E_{1SYH}$ ; top right: docking score to 6Y2F  $\Delta E_{6Y2F}$  against docking score to 1SYH  $\Delta E_{1SYH}$ ; bottom left: docking score to 6Y2F  $\Delta E_{6Y2F}$  against docking score to 4LDE  $\Delta E_{4LDE}$ ; bottom right: synthetic accessibility metric  $SAscore$  against quantitative estimate of drug-likeness  $QED$ .
[#8]1-[#6]2[#8][#6][#8][#6]12，N=C=0，C1CN1，[#6](=#8)[F,C1,Br,I]，[#6]（=[#8]）=[#6]（-[#8]）-[#6]（=[#8]）~[#8]，N（-[#6]）=[#7]-[#8].
These SMARTS patterns were developed from our experience with the use of docking in conjunction with inverse molecular design algorithms. They correspond to reactive structural moieties that can lead to very favorable docking scores and should therefore be explicitly avoided [7]. Additionally, it is also tested whether the structure is charged, possesses radical electrons, contains more than two bridgehead atoms, has at least one ring with more than 8 members and violates Lipinski's Rule of Five [128]. If at least one of these initial checks is true, the property simulation workflow is aborted and a very bad fitness of 10,000 is returned. If all of these checks are false, the workflow is continued. Subsequently, smina is used to add the ligand to the prepared protein structure of interest and perform a docking simulation with an exhaustiveness setting of 10. The docked ligand structure with the lowest docking score is selected and the corresponding docking score returned by the simulation workflow. Following recent literature,[84, 85] the quality of the generated docked structure was checked using obenergy and only values below 10,000 were accepted.
Dataset We obtained a list of approximately 250,000 canonical SMILES from PubChem [170] that are part of the DTP Open Compound Collection [79, 80]. Next, all the structures that do not pass any of the structural filters described in the previous section are removed. Thus, we obtained a set of 152,296 molecules that are provided as reference dataset for the protein ligand design benchmark set and used it for training the generative models. For all molecules in this dataset, we simulated the corresponding properties of interest with the developed property simulation workflow (cf. Figure S10).
S5.2.4 Design of Chemical Reaction Substrates
**Workflow** The double hydrogen transfer in syn-sesquinorbornenes (cf. Figure S11A) was chosen as a suitable benchmark reaction due to its robust behavior in simulations. Additionally, it is well-described by the SEAM method as shown previously by Jensen [89]. For the benchmark, we allow
substitutions at the positions indicated by  $\mathbf{X}$  or  $\mathbf{R}$  in Figure S11B.
B
Figure S11: Intramolecular concerted double hydrogen transfer reaction of syn-sesquinorbornenes (A) and positions in the syn-sesquinorbornene core structure allowed to be substituted (B).
The general procedure of the reactivity workflow we developed is outlined in the following steps:
1. Generation of initial conformation of the reactant.
(a) Try to generate coordinates with Open Babel [157].
(b) In case of failure, generate coordinates with RDKit [163].
2. MMFF [171] optimization of the reactant.
3. crest [158] conformer search for the reactant via the iMTD-GC workflow.
4. Constrained MMFF optimization going from the reactant to the product in conformation consistent with reactant.
5. Full MMFF optimization of the product.
6. crest conformer search for the product lowest conformation via the iMTD-GC workflow.
7. Crude reaction path interpolation with the geodesic interpolation method [172].
8. SEAM [89] optimization of the TS.
9. Constrained crest conformer search of the TS via the iMTD-GC workflow.
10. SEAM re-optimization of the lowest energy TS conformer.
11. Calculation of reaction and activation energy from the SEAM model.
Prior to performing any property simulations, the molecule is checked for the presence of the syn-sesquinorbornene core motif which is strictly required for the reaction of interest to occur:
[H][C@]1（\*）[C@;R2]（\*）2[C@]34[C@;R2]5（\*）[C;R1]  $(\ast) = [C;R1]$  （\*）[C@;R2]（\*）([\*;R2]5）[C@]3（[\*;R1]4）[C@](\*）([\*;R2]2）[C@;R1]1([\\*])[H]
Additionally, the input structure is inspected to ensure the absence of several reactive structural moieties as described by the following SMARTS patterns:
$$
\begin{array}{l} [ \mathrm {C} - ], \quad [ \mathrm {S} - ], \quad [ 0 - ], \quad [ \mathrm {N} - ], \quad \left[ * + \right], \quad \left[ * - \right] \quad \left[ \mathrm {P H} \right], \quad \left[ \mathrm {p H} \right], \quad [ \mathrm {N} \& \mathrm {X} 5 ], \\ * = [ S, s;! R ], \quad [ S \& X 3 ], \quad [ S \& X 4 ], \quad [ S \& X 5 ], \quad [ S \& X 6 ], \quad [ P, p ], \\ [ B, b, N, n, 0, o, S, s ] ^ {\sim} [ F, C l, B r, I ], \quad * = * = *, \quad * \# *, [ 0, o, S, s ] ^ {\sim} [ 0, o, S, s ], \\ [ N, n, 0, o, S, s ] ^ {\sim} [ N, n, 0, o, S, s ] ^ {\sim} [ N, n, 0, o, S, s ], \\ [ N, n, 0, o, S, s ] ^ {\sim} [ N, n, 0, o, S, s ] ^ {\sim} [ C, c ] =, \\ : [ 0, o, S, s, N, n;! R ], * = N - [ *;! R ], \quad * ^ {\sim} [ N, n, 0, o, S, s ] - [ N, n, 0, o, S, s;! R ] \\ \end{array}
$$
A detailed description of some of the steps in the property simulation workflow for the design of chemical reaction substrates is provided in the following bullet points:
1. SEAM optimization of the TS:
The SEAM model optimizes the transition state as the crossing point between reactant and product force fields. In this work, we used the GFN-FF force field [159], and shifted the product force field to reproduce the energy difference between the reactants and products at the GFN2-xTB level of theory [54]. For the product force field shift, we used the lowest
Figure S12: Illustration of the outlier detection cutoff for the elliptic envelope used for the property simulation workflow of the design of chemical reaction substrates benchmark set. Data points appearing outside the black line are regarded as outliers and assigned a very low fitness.
energy conformers of the reactant and product, respectively. The optimization was carried out on the upper SEAM surface by introducing a small coupling of  $0.001\mathrm{eV}$  between the states. The guess structure for the TS was taken from a geodesic interpolation between reactant and product geometries [172]. The TS itself was optimized with the geomeTRIC package [173] via an interface to pyscf [164-166]. The subsequent crest transition state conformer search used constrained C-H-C bond lengths with a force constant of 1.0 a.u. in strength. All calculations were carried out using the POLANYI package, which will be reported in detail elsewhere. The activation energy was taken as the difference of the GFN-FF energy of the optimized TS structure and the energy of the lowest energy conformer of the reactant. The reaction energy was taken as the energy difference between the lowest energy conformers of the product and reactant, including the energy shift of the product force field. These energies are electronic energies from the force field. While free energies would be preferable, it would increase the complexity of the workflow, and significant error cancellation is expected for this intramolecular reaction.
2. crest conformer searches:
We opted to perform the crest conformer searches with the keywords -mquick, -gfn2//gfnff, and -noreftopo. Although it would be more consistent to use -gfnff, we found that it produced a larger number of outliers in preliminary test calculations.
3. Outlier detection: