INTERPRETING MOLECULE GENERATIVE MODELS
Year: 2021

Abstract:
Discovering novel molecules with desired properties is crucial for advancing drug discovery and chemical science. Recently deep generative models can propose new molecules by sampling random vectors from latent space and then decoding them to a molecule structure. However, through the feedforward generation pipeline, it is difficult to reveal the underlying connections between latent space and molecular properties as well as customize the output molecule with desired properties. In this work, we develop a simple yet effective method to interpret the latent space of the learned generative models with various molecular properties for more interactive molecule generation and discovery. This method, called Molecular Space Explorer (MolSpacE), is model-agnostic and can work with any pre-trained molecule generative models in an off-the-shelf manner. It first identifies latent directions that govern certain molecular properties via the property separation hyperplane, and then moves molecules along the directions for smooth change of molecular structures and properties. This method achieves interactive molecule discovery through identifying interpretable and steerable concepts that emerge in the representations of generative models. Experiments show that MolSpacE can manipulate the output molecule toward desired properties with high success. We further quantify and compare the interpretability of multiple state-of-the-art molecule generative models. An interface and a demo video are developed to illustrate the promising application of interactive molecule discovery.

heading: 1 INTRODUCTION
text: Designing molecules with desired properties is a fundamental problem in chemistry, which has a variety of applications in drug discovery and material science (Chen et al., 2018). Traditional pipelines require exhaustive human efforts and domain knowledge, which are difficult to scale up. Recent studies exploit deep generative models to solve this problem by encoding molecules into a latent space, from which random samples are drawn and decoded to novel molecules (Walters & Barzilay, 2020). It has been widely observed that such deep molecule generative models are able to facilitate the design and development of drugs and materials from many perspectives (Lopez et al., 2020; Sanchez-Lengeling & Aspuru-Guzik, 2018).
Despite the promising results of deep generative models for molecule generation, much less effort has been made to interpret the learned representations. Most of the existing models are based on deep neural networks, which are known to be short on interpretability (Samek et al., 2019). Outside of molecule generation domain, many attempts have been made to improve the interpretability of deep learning models from various aspects, e.g., representation space (Zhou et al., 2016), model space (Guo et al., 2021), and latent space (Shen et al., 2020; Shen & Zhou, 2021). In molecule generation domain, interpretability can be studied in two ways: (1) the interpretation of learned latent space where steering the value of latent vectors could lead to smooth and continuous molecular property change and (2) the interpretation of molecular space that adjusting the molecular property could observe smooth structure change of molecules.
In addition, it remains challenging to generate molecules with desired properties. Previous works mostly rely on optimization-based, reinforcement learning-based, and searching-based methods to achieve property control of the generated molecules (Shi et al., 2020; Jin et al., 2018a). Specifically, reinforcement learning-based algorithm (You et al., 2018a) equips the model with rewards designed
to encourage the molecule generative models to generate molecules with specific molecular properties. Optimization-based algorithm takes advantage of the learnt latent space by molecule generative models and optimize the molecular properties via Bayesian Optimization (Liu et al., 2018). Searching-based algorithm instead searches directly from the chemical space for molecules with optimal properties (Kwon et al., 2021). However, these lines of work are designed for molecule generation with optimized property and thus unable to change the property monotonically and smoothly. Besides, current methods are confined to a limited number of molecular properties, which hinders real-world applications in drug discovery and material science. For example, existing work only discover a limited set of molecular properties, such as penalized logP (octanol-water partition coefficient), QED (Drug-likeness), DRD2 activity, etc (Jin et al., 2018a; Shi et al., 2020; Liu et al., 2018; Fu et al., 2020). Consequently, when molecules with new properties are needed, the models must be re-trained with a different optimization goal, which is significantly time-consuming.
To tackle the above challenges, we formulate a new task, molecule manipulation, which aims to improve the interpretability and steerability of a given molecule generative model via continuously manipulating molecular properties. Based on the observation that molecules sharing similar structures/properties tend to cluster in the latent space, we develop MolSpace Explorer, a model-agnostic method to manipulate molecules with continuous changes of molecular properties. Specifically, MolSpace Explorer first identifies the property separation hyperplane which defines the boundary for molecular properties (e.g., drug-like or drug-unlike) in the latent molecular space learned by a given generative model. Based on the property separation hyperplane, we estimate the latent directions that govern molecular properties, which are in turn used to enable continuous change of the molecular structures and properties without re-training the given molecular generative model. To the best our knowledge, this work is one of the earliest attempts to achieve interactive molecule discovery through the steering of pretrained generative models.
The experiments demonstrate that our method can effectively quantify the interpretability and steerability of state-of-the-art molecule generative models. To measure the ability of generative models in interpreting molecular properties and generating molecules with continuous property control, we design a new evaluation metric named success rate, which evaluates the percentage of successful manipulations with continuous property-changing molecules over manipulations of a group of molecules. To visualize our method and facilitate interactive molecule discovery for scientists, we develop an interactive system with visualization of real-time molecule manipulations and smooth molecular structure/property changes. Our main contributions are summarized as follows:
• We formulate molecule manipulation, a new task which measures the interpretability and steerability of molecule generative models via the ability to manipulate the molecular properties of molecules in the latent space.
• We develop a simple yet effective model-agnostic method named MolSpace Explorer for molecule manipulation, which further analyzes current molecule generative models in terms of their interpretability and steerability.terpretation.
• Comprehensive experiments demonstrate the effectiveness of our method in quantifying the interpretability and steerability of various molecule generative models. An interactive system is developed for real-time molecule manipulation.

heading: 2 RELATED WORK
text: Molecule Generation. Recent studies have explored a variety of deep generative models for molecule generation. Specifically, GrammarVAE (Kusner et al., 2017) designs a variational autoencoder-based model that represents molecules as SMILE strings. With the advancement of graph neural networks (GNN), a surge of GNN-based generative models have been proposed to tackle the problem, by combining GNN with variational autoencoders (VAEs), generative adversarial networks (GANs), normalizing flows, energy-based models (EBMs), and reinforcement learning (Olivecrona et al., 2017; De Cao & Kipf, 2018; Jin et al., 2018a; Zhou et al., 2019; Madhawa et al., 2019; Shi et al., 2020; Luo et al., 2021; Liu et al., 2021; Yang et al., 2021). To be specific, JT-VAE (Jin et al., 2018a) proposes a VAE-based architecture to encode both atomic graphs and structural graphs for efficient molecule generation. MolGAN (De Cao & Kipf, 2018) exploits GANs for molecule generation, where discriminators are used to encourage the model to generate realistic and chemically-valid molecules. MRNN (Popova et al., 2019) extends the idea of GraphRNN (You
et al., 2018b) to formulate molecule generation as an auto-regressive process. GCPN (You et al., 2018a) formulates the molecule generation process as a reinforcement learning problem where it obtains a molecule step by step by connecting atoms and reward is used for controllable generation. GraphNVP (Madhawa et al., 2019) first introduces normalizing flows for molecule generation, where the generation process is invertible. Later work improve the flow-based models via autoregressive generation (Shi et al., 2020), valency correction (Zang & Wang, 2020), and discrete latent representation (Luo et al., 2021). GraphEBM (Liu et al., 2021) introduces energy-based models which models the density of molecule data.
Controllable Molecule Generation. Another key point for molecule generation is controllable generation where the generated molecules are expected to possess certain properties. Early work (Segler et al., 2018) bias on the distribution of the data and fine-tune the generative models with known desired properties to generate molecules with desired properties. The recent work mainly leverage optimization-based (Shi et al., 2020; You et al., 2018a; Hoffman et al., 2020; Winter et al., 2019;?), reinforcement learning-based (Zang & Wang, 2020; Jin et al., 2018a; Blaschke et al., 2020), and searching-based (Brown et al., 2019; Yang et al., 2020; Kwon et al., 2021) approaches to generate molecules with desired properties. Optimization-based methods are quite flexible and can both directly work on the molecules (Renz et al., 2019; Fu et al., 2020; Xie et al., 2021; Maziarz et al., 2021) and work on the learnt latent vectors of the molecules (Gómez-Bombarelli et al., 2018; Jin et al., 2018b; Winter et al., 2019; Griffiths & Hernández-Lobato, 2020; Notin et al., 2021). Reinforcement learning-based methods usually formulates controllable generation as a sequential decision-making problem and requires a score-function to provide rewards to the agent. Searching-based approaches (Brown et al., 2019; Yang et al., 2020; Kwon et al., 2021) are also capable of searching molecules with optimized properties. Besides, few work (Chenthamarakshan et al., 2020; Das et al., 2021) leverage the learnt latent space and achieve controllable generation by accepting/rejecting sampled molecules based on a molecular property predictor. Despite the ability to generate molecules with optimized properties, it is challenging for existing methods to interpret the generation process and cannot generate molecules with monotonically and smoothly changing molecular properties.

heading: 3 PRELIMINARIES
text: Molecule Graph. Molecules can be presented as graphs X = (V, E , E, F ), where V denotes a set of N vertices (i.e., atoms), E ⊆ V × V denotes a set of edges (i.e., bonds), F ∈ {0, 1}N×D denotes the node features (i.e., atom types) and E ∈ {0, 1}N×N×K denotes the edge features (i.e., bond types). The number of atom types and bond types are denoted by D and K, respectively.
Deep Molecule Generative Models. In molecule generation, a generative model M encodes the molecular graph X as a latent vector Z ∈ Rl with l being the dimension of the latent space, and is capable of decoding any latent vector back to the molecular space. Specifically, variational autoencoder (VAE) (Kingma & Welling, 2013) and flow-based model (Flow) (Rezende & Mohamed, 2015) are the two most commonly used models for molecule generation tasks. Both of them encode the data from molecular space to latent space, which is usually modeled as a Gaussian distribution; then they decode the latent code back to molecular space. They can be formulated as:
z = f(x), x′ = g(z), (1)
where x and x′ are the ground-truth and reconstructed/sampled data respectively, and z ∈ Z represents a latent vector in the latent space.

heading: 4 PROBLEM FORMULATION OF MOLECULE MANIPULATION
text: To improve the steerability and interpretability of molecule generative models, we propose a new research task, molecule manipulation, which interprets the generative model and steers the properties of the output molecules. To be specific, a deep generative model contains a generator g : Z → X , whereZ ∈ Rl stands for the l-dimensional latent space, which is commonly assumed to be Gaussian distribution (Kingma & Welling, 2013; Rezende & Mohamed, 2015). There exist property functions fP which define the property space P via P = fP (X).
drug-dislike mols
Formulation. The input to molecule manipulation is a list of n molecules X = {x1, x2, · · · , xn} and a list of m molecular properties P = {p1, p2, · · · , pm}. We aim to manipulate one or more molecular properties p of a given molecule in a k consecutive steps and output the manipulated molecules with properties p′ = {p(1), p(2), · · · , p(k)}. By manipulating the given molecule, we can observe the alignment of Z → X → P , where the relationship between Z and X explains the latent space of molecule generative models. The relationship between X and P reveals the correlations between molecular structures and properties. By traversing latent space, we can generate molecules with continuous structure/property changes.
Evaluation. For the molecule manipulation task, we design two new evaluation metrics named success rate (SR) and soft success rate (SSR) that measure the performance in discovering latent molecular property directions. To be specific, we consider a manipulation to be successful only if we generate molecules with monotonically-changing properties in a consecutive k steps of manipulation, as follows:
φsuccess(x, k) = 1[∀ i ∈ [k], s.t., fp(x(i))− fp(x(i+1)) ≤ 0], (2)
where fp is a property function which calculates certain molecular property and x(i), x(i+1) represents molecules generated in two adjacent steps. As monotonicity is rather strict, we propose a more flexible definition of success, namely soft success, as follows:
φsoft success(x, k) = 1[∀ i ∈ [k], s.t., fp(x(i))− fp(x(i+1)) ≤ ], (3)
where is a predefined tolerance threshold that weakens the monotonicity requirement. To extend the evaluation metric for |P | molecular properties and |X| candidate molecules to manipulate, we calculate the overall SR as:
SR(P,X, k) =
∑ p∈P,x∈X 1[φsuccess(xp, k) ∧ φSD(xp, k) ∧ φDIV (xp, k)]
|P | × |X| , (4)
where xp represents manipulating property p of molecule x which results in a manipulation path xp = {x(i)p |i ∈ [k]}. Since the molecular space is essentially discrete, we allow the model to generate duplicate molecules during manipulation, but the model has to generate at least one distinct molecule from the base molecule (diversity or DIV) and the structure difference (SD) enforces monotonically-decreasing structure similarity along the manipulation sequence, as follows:
φDIV (x, k) = 1[∃ i ∈ [k], s.t., x(i) 6= x(1)], (5)
φSD(x, k) = 1[∀ i ∈ [k], s.t., δ(x(i), x(1))− δ(x(i+1), x(1)) ≥ 0], (6)
where δ measures the structure similarity between the two input molecules. Similarly, we provide a soft structure difference (SSD) with a predefined tolerance threshold γ as follows:
φSSD(x, k) = 1[∀ i ∈ [k], s.t., δ(x(i), x(1))− δ(x(i+1), x(1)) ≥ γ], (7)
Finally, we calculate the overall SSR as:
SSR(P,X, k) =
∑ p∈P,x∈X 1[φsoft success(xp, k) ∧ φSSD(xp, k) ∧ φDIV (xp, k)]
|P | × |X| , (8)
‘

heading: 5 MOLECULE MANIPULATION THROUGH MOLSPACE

heading: 5.1 LATENT CLUSTER ASSUMPTION
text: We examine the property of latent space learned by the generative models and have the following observations, (1) molecules with similar structures tend to cluster in the latent space, (2) interpolating two molecules x1 and x2, represented by latent vectors z1 and z2, can lead to a list of intermediate molecules whose structures gradually change from x1 to x2. As molecular structures determine molecular properties (Seybold et al., 1987), the observations imply that molecules with similar molecular properties cluster together and interpolating two molecules could lead to gradual changes in structure. As shown in Fig. 1, there may exist two groups of molecules, drug-like and drug-unlike, where each group cluster together and linear interpolating two latent vectors with one molecule from each group could lead to a direction that crosses the separation boundary. These observations also match the analysis from the prior work (Zang & Wang, 2020). To verify our assumption, we visualize the latent space of the pre-trained MoFlow model trained on QM9 dataset in Fig. 2. The left figure shows that molecules that are close in the latent space are similar in structures. The right figure shows that interpolating two molecules in the latent space could lead to smooth structure changes.

heading: 5.2 IDENTIFYING LATENT DIRECTIONS
text: Latent Separation Boundary. With the verifications above and the previous work of analyzing the latent space of generative models (Shen et al., 2020; Bau et al., 2017; Jahanian et al., 2019; Plumerault et al., 2020), we assume that there exists a separation boundary which separates groups of molecules (e.g., drug-like and drug-unlike) and the normal vector of the separation boundary defines a latent direction (in Fig. 1). When z moves toward and crossing the boundary, the molecular
properties change accordingly (e.g., from drug-unlike to drug-like). A perfect separation boundary would have molecules with different properties well separated on different sides. From that, we can find a hyperplane for each molecular property with a unit normal vector n ∈ Rl, such that the distance from any sample z to the hyperplane as:
d(z, n) = nT z (9)
Latent Direction. In the latent space, the molecular structure and property change continuously towards the new property class when z moves towards the hyperplane and vice versa, where we assume linear dependency between z and p:
fP (g(z)) = α · d(z, n), (10)
where fP is a property function and α is a degree scalar that scales the changes along that corresponding direction. Extending the method to multiple molecular properties manipulation, we have:
fP (g(z)) = AN T z, (11)
where A = Diag(a1, · · · , am) is the diagonal matrix with linear coefficients for each of the m molecular properties andN = [n1, · · · , nm] represents normal vectors for the separation boundaries of m molecular properties. We have the molecular properties P following a multivariate normal distribution via:
µP = E(AN T z) = ANTE(z) = 0, (12)
ΣP = E(AN T zzTNAT ) = ANTE(zzT )NAT = ANTNAT . (13)
We have all disentangled molecular properties in P if and only if ΣP is a diagonal matrix and all directions in N are orthogonal with each other. Nevertheless, not all molecular properties are purely disentangled with each other. In that case, molecular properties can correlate with each other and nTi nj is used to denote the entanglement between the i-th and j-th molecular properties in P .

heading: 5.3 IMPLEMENTING THE MOLECULE MANIPULATION
text: After we find the separation boundary and identify the latent direction, to manipulate the generated molecules with desired properties, we first move from latent vector z along the direction n with a degree scalar α, and the new latent vector is
z′ = z + αn (14)
To this end, the expected property of the new manipulated molecule is
fP (g(z + αn)) = fP (g(z)) + kα (15)
where k is a scaling factor between molecular vector space and property. Based on our assumption to find a separation boundary for each molecular property, we utilize linear Support Vector Machine (SVM) (Cortes & Vapnik, 1995) to find the separation boundaries which best separate the two classes of the data. For each molecular property, we train an individual linear SVM from a group of randomly sampled latent vectors and utilize a property function fP to calculate the corresponding molecular properties. Then, we find the separation boundaries for each molecular property. The normal vectors N of separation boundaries are finally utilized as identified latent directions that govern the molecular properties. Additionally, our method is highly efficient thanks to leveraging shallow models compared to optimization-based methods which require re-training of deep models for each of the specific molecular properties.

heading: 6 EXPERIMENTS

heading: 6.1 EXPERIMENT SETUP
text: Datasets. We use three molecule datasets, QM9 (Ramakrishnan et al., 2014), ZINC250K (Irwin & Shoichet, 2005), and ChEMBL (Mendez et al., 2019). QM9 contains 134k small organic molecules with up to 9 heavy atoms (C, O, N, F). ZINC is a free database of commercially-available compounds for drug discovery. On average, the molecules in ZINC are bigger (∼23 heavy atoms)
and structurally more complex than QM9. We take a sampled 250K molecules version (GómezBombarelli et al., 2018) from the larger database. ChEMBL is a manually curated database of bioactive molecules with drug-like properties and contains ∼1.8 million molecules. Baselines. We include two baseline methods of identifying latent direction that governs the molecular property for comparisons. Random manipulation randomly samples latent directions for molecular properties. Largest range manipulation draws latent vectors from the training set and defines the directions via calculating the direction between one molecule with the largest property score and another molecule with the smallest property score for each molecular property.
Implementation Details. We take the publicly available pre-trained models from the GitHub Repository of HierVAE, and MoFlow, respectively. For CGVAE, we take the code implementation from the public GitHub Repository and train using default hyper-parameters provided by the authors. We utilize the SVM implementation from Scikit-Learn1.

heading: 6.2 EVALUATION PROTOCOLS
text: Pre-trained Models. We apply MolSpacE, as well as baselines, on three state-of-the-art molecule generative models with publicly available pre-trained models or code implementations. Specifically, CGVAE (Liu et al., 2018) implements a VAE-based model and generate molecular graphs in a sequential manner; HierVAE (Jin et al., 2020) embeds molecular structure motifs into a hierarchical VAE-based generative model; MoFlow (Zang & Wang, 2020) designs a normalizing flow-based model which learns an invertible mapping between input molecules and latent vectors.
Molecular Properties. We study molecular properties identified in the chemistry community through open-source cheminformatics software2. In total, we analyze 154 molecular properties from multiple dimensions, including distributions, inter-correlations, etc. Details can be found in Appendix B. Due to the page limit, we mainly report results for 7 molecular properties, including 3 very common yet important ones, drug-likeness (QED), molecular weight (MolWt), partition coefficient (LogP), and 4 randomly selected ones, including topological indexes, BalabanJ, BertzCT, and BCUT2D descriptors (Bayada et al., 1999) CHGHI, CHGLO.
Quantitatively, we evaluate the ability of the model to manipulate the given molecular property of molecules with the proposed strict success rate and success rate metrics (see Sec. 4). Qualitatively, we visualize molecule manipulation including property distribution shift during manipulation, single and multiple property manipulations.

heading: 6.3 QUANTITATIVE EVALUATION OF MOLECULE MANIPULATION
text: In Table 1, we report the quantitative evaluation results for molecule manipulation with both strict success rate and success rate, which are evaluated on 154 molecular properties. According to the table, we can obtain the following insights.
(1) Our proposed method, MolSpacE, as the first attempt for molecule manipulation, achieves excellent performance to manipulate properties of molecules with three state-of-the-art molecule generative models. For some important molecular properties (e.g., QED), we (with HierVAE) achieve 68% manipulation success rate in QM9 dataset. We outperform the baseline methods 80% on average.
(2) Generally, HierVAE performs the best in all three datasets. We conjecture this is because HierVAE models not only atomic level but also structural level information, which is critical in determining molecular properties. MoFlow ranks second due to the invertible constraint which maps molecular space to a latent space that reflects the property space. CGVAE underperforms on three datasets. One possible explanation is its simple architecture which struggles to map molecular space to a semantically meaningful latent space, where the molecular property is not well-reflected.
(3) CGVAE has the largest gap between SSR and SR, which demonstrates that CGVAE tends to repeatedly sample molecules with the same properties during manipulation, and this is possible when the latent space does not well separate molecules via properties. The SSR and SR gaps in MoFlow and HierVAE are similar and ∼ 25% smaller than QM9. For individual molecular properties, we
1https://scikit-learn.org/ 2https://www.rdkit.org/docs/index.html
can observe that the gaps between SSR and SR are small, while the average gap is large, we find that the gaps are large in categorical properties shown in Appendix D.3 Table 7 and 8.
(4) The baseline (random manipulation) method sometimes “finds” directions that control molecular properties. As shown in Fig. 2, the molecules are well-clustered in the latent space with respect to structures that determine molecular properties (Seybold et al., 1987). However, the largest range manipulation works worse possibly due to its strong assumption in determining the direction via the two extreme (largest property and smallest property) molecules in the dataset.

heading: 6.4 QUALITATIVE EVALUATION OF MOLECULE MANIPULATION AND INTERPRETATION
text: In Fig. 11, we visualize the property distributions of QED, MolWt and LogP along a 7-step manipulation path. For each step, we draw a property distribution. The candidate molecules are at place 0 and we attempt to manipulate the molecular property to the left (lower) and the right (higher). From the figure, we can clearly observe that the property distribution shifts to the left and right accordingly when we manipulate the molecule to the left and right. For example, when we manipulate the molecules three steps to the left, the range of QED shifts from [0, 0.7] to [0, 0.5]; when the molecules are manipulated three steps to the right, there are much more molecules that have QED > 0.5 than the base distribution. Similar trends can also be seen for MolWt and LogP properties.
Single Property Manipulation. To qualitatively evaluate the performance of our method for molecule manipulation, we randomly select the successful manipulation paths from all three generative models in Fig. 4. The figures have shown that our method succeeds in learning interpretable and steerable directions. For example, for HierVAE in Fig. 4, we can find that gradually increasing LogP of a molecule may lead to the removal of the heavy atoms O and N from the structure. With respect to QED, the molecule drops double bonds, as well as heavy N and O atoms, when increasing QED for the HierVAE model. A similar trend can be observed in the MoFlow model that increasing QED drops double bonds and O atoms on the left of Fig. 4.
Multi-Property Manipulation. When it comes to multiproperty manipulation, the goal is to control multiple molecular properties of a given molecule at the same
time. In Fig. 5, we show how our method can manipulate multiple molecular properties. For simplicity, we remove the duplicate molecules and only leave the different molecules during the manipulation. From the figure, we can observe that there are some correlations between LogP and QED since when we increase QED, LogP also increases accordingly. However, it is not always the case as moving the molecules to the right in the second row does not increase the QED scores. One potential reason is that the chemical space is vast, discrete and complex, and it is nontrivial to manipulate multiple properties of a molecule at the same time.
7 CONCLUSION
In this paper, we formulate a new task, molecule manipulation which allows interacting with molecule generative models, interpreting molecular space and generating molecules with smooth and monotonic property control. We present MolSpacE, a simple yet effective model-agnostic molecule manipulation method that achieves a high success in controlling and interpreting a variety of molecular properties. The interface illustrates the promising application of interactive molecule discovery. In the future, we plan to study how molecule manipulation can be done with unsupervised discovery.
Reproducibility Statement. To increase the reproducibility of our paper, we provide detailed experiment setups in section 6.1 including datasets, baselines, implementation details. Additional experiments can be
found in Appendix C and D. We will put a link to our code in the comment when the discussion forum is open as suggested by the Author Guide. The designed interactive system along with a demo video to demonstrate how to use the system is shown in Appendix E.

heading: Appendix for “Interpreting Molecule Generative Models for Interactive Molecule Discovery”

heading: A MOLECULE GENERATIVE MODELS
text: In Table 2, we summarize a list of representative molecule generative models, which span various types of deep generative models, including the type of generative models, the type of generation process and whether latent space is learned. We also provide the formulation for two types of deep generative models (VAE and Flow) in Section A that are very popular for molecule generation task.
A.1 MOLECULE GENERATIVE MODEL FORMULATION
VAE. gets a lower bound (ELBO) for the data log probability by introducing a proposal distribution.
log p(x) = log ∫ z p(x|z)p(z)dz
≥ log[Eq(z|x)[p(x|z)] + KL(q(z|x)||p(z))] (16)
Flow. The key of Flow model is to design a invertible function with the following nice property: z0 ∼ p0(z0) zi = fi(zi−1)
zi−1 = f −1 i (zi) pi(zi) = pi−1(zi−1) ∣∣∣detdf−1i
dzi ∣∣∣ = pi−1(f−1i (zi))∣∣∣detdf−1idzi ∣∣∣,
(17)
where fi is invertible function. To be more concrete, we can take z0 as some tractable noise distribution, like Gaussian distribution, and repeating this for K steps will lead to the data distribution, i.e.,: x = zK = fK ◦ fK−1 ◦ ... ◦ f1(z0). Thus, the log likelihood of the data is as follows:
log p(x) = log pK(zK) = log pK−1(zK−1)− log ∣∣∣det dfK
dzK−1 ∣∣∣ = log pK−2(zK−2)− log ∣∣∣det dfK−1 dzK−2 ∣∣∣− log ∣∣∣det dfK dzK−1
∣∣∣ = ... = log p0(z0)− K∑ i=1 log ∣∣∣det dfi dzi−1 ∣∣∣ (18)

heading: B STUDY OF MOLECULAR PROPERTIES
text: List of Molecular Properties. In total, study 154 molecular properties from the open chemistry library RDKit3. They are MaxEStateIndex, MinEStateIndex, MaxAbsEStateIndex, MinAbsEStateIndex, qed, MolWt, HeavyAtomMolWt, ExactMolWt, MaxPartialCharge, MinPartialCharge, MaxAbsPartialCharge, MinAbsPartialCharge, FpDensityMorgan1, FpDensityMorgan2, FpDensityMorgan3, MWHI, MWLOW, CHGHI, CHGLO, LOGPHI, LOGPLOW, MRHI, MRLOW, BalabanJ, BertzCT, Chi0, Chi0n, Chi0v, Chi1, Chi1n, Chi1v, Chi2n, Chi2v, Chi3n, Chi3v, Chi4n, Chi4v, HallKierAlpha, Ipc, Kappa1, Kappa2, Kappa3, LabuteASA, VSA13, VSA14, TPSA, EState1, EState10, EState2, EState3, EState4, EState5, EState6, EState7, EState8, EState9, FractionCSP3, MolLogP, MolMR, NumValenceElectrons, NumRadicalElectrons, HeavyAtomCount, NHOHCount, NOCount, NumAliphaticCarbocycles, NumAliphaticHeterocycles, NumAliphaticRings, NumAromaticCarbocycles, NumAromaticHeterocycles, NumAromaticRings, NumHAcceptors, NumHDonors, NumHeteroatoms, NumRotatableBonds, NumSaturatedCarbocycles, NumSaturatedHeterocycles, NumSaturatedRings, RingCount, noTert, ArN, N, NH, COO2, noCOO, S, HOCCN, Imine, NH0, NH1, NH2, Ndealkylation1, Ndealkylation2, Nhpyrrole, SH, aldehyde, carbamate, halide, oxid, amide, amidine, aniline, methyl, azide, azo, barbitur, benzene, benzodiazepine, bicyclic, diazo, dihydropyridine, epoxide, ether, furan, guanido, halogen, hdrzine, hdrzone, imidazole, imide, isocyan, isothiocyan, ketone, Topliss, lactam, lactone, methoxy, morpholine, nitrile, nitro, arom, nonortho, nitroso, oxazole, oxime, hydroxylation, phenol, noOrthoHbond, acid, piperdine, piperzine, priamide, prisulfonamd, pyridine, quatN, sulfide, sulfonamd, sulfone, acetylene, tetrazole, thiazole, thiocyan, thiophene, alkane, urea.
Among the studied 154 molecular properties, 59 of them are continuous: MaxEStateIndex, MinEStateIndex, MaxAbsEStateIndex, MinAbsEStateIndex, qed, MolWt, HeavyAtomMolWt, ExactMolWt, MaxPartialCharge, MinPartialCharge, MaxAbsPartialCharge, MinAbsPartialCharge, FpDensityMorgan1, FpDensityMorgan2, FpDensityMorgan3, MWHI, MWLOW, CHGHI, CHGLO, LOGPHI, LOGPLOW, MRHI, MRLOW, BalabanJ, BertzCT, Chi0, Chi0n, Chi0v, Chi1, Chi1n, Chi1v, Chi2n, Chi2v, Chi3n, Chi3v, Chi4n, Chi4v, HallKierAlpha, Ipc, Kappa1, Kappa2, Kappa3, LabuteASA, VSA13, VSA14, TPSA, EState1, EState10, EState2, EState3, EState4, EState5, EState6, EState7, EState8, EState9, FractionCSP3, MolLogP, MolMR, 95 of them are categorical: NumValenceElectrons, NumRadicalElectrons, HeavyAtomCount, NHOHCount, NOCount, NumAliphaticCarbocycles, NumAliphaticHeterocycles, NumAliphaticRings, NumAromaticCarbocycles, NumAromaticHeterocycles, NumAromaticRings, NumHAcceptors, NumHDonors, NumHeteroatoms, NumRotatableBonds, NumSaturatedCarbocycles, NumSaturatedHeterocycles, NumSaturatedRings, RingCount, noTert, ArN, N, NH, COO2, noCOO, S, HOCCN, Imine, NH0, NH1, NH2, Ndealkylation1, Ndealkylation2, Nhpyrrole, SH, aldehyde, carbamate, halide, oxid, amide, amidine, aniline, methyl, azide, azo, barbitur, benzene, benzodiazepine, bicyclic, diazo, dihydropyridine, epoxide, ether, furan, guanido, halogen, hdrzine, hdrzone, imidazole, imide, isocyan, isothiocyan, ketone, Topliss, lactam, lactone, methoxy, morpholine, nitrile, nitro, arom, nonortho, nitroso, oxazole, oxime, hydroxylation, phenol, noOrthoHbond, acid, piperdine, piperzine, priamide, prisulfonamd, pyridine, quatN, sulfide, sulfonamd, sulfone, acetylene, tetrazole, thiazole, thiocyan, thiophene, alkane, urea.
However, not all of the molecular properties are varied in the three datasets. Specifically, QM9 contains 22 frozen molecular properties, NumRadicalElectrons, EState10, S, SH, azide, azo, barbitur, benzodiazepine, diazo, hdrzine, hdrzone, isocyan, isothiocyan, nitroso, acid, prisulfonamd, sulfide, sulfonamd, sulfone, thiazole, thiocyan, thiophene, ZINC contains 2 frozen molecular properties, NumRadicalElectrons and prisulfonamd and ChEMBL contains only 1 frozen molecular properties, prisulfonamd.
Inter-correlations of molecular properties. In Fig. 7, we visualize the linear correlations between each pair of molecular properties across three datasets. From the heatmaps, we can observe that there are no linear correlations between half of the molecular properties, and similar patterns are observed in ZINC and ChEMBL datasets.
Molecular Property Distributions. We visualize 7 molecular property distributions reported in section 6 in Fig. 8. From there, we can observe that the property distribution may vary a lot in terms
3https://www.rdkit.org/docs/index.html
of different datasets. Notably, the distributions of some properties, e.g., QED, are very similar in ZINC and ChEMBL datasets, while some are quite different, e.g., MolWt.

heading: C LATENT SPACE EVALUATION
text: To evaluate the quality of the learned latent space, we utilize three disentanglement evaluation metrics, disentanglement, completeness and informativeness (Eastwood & Williams, 2018). To be specific, disentanglement measures the degree to which each latent dimension controls at most one molecular property, completeness measures the degree to which each molecular property is governed by at most one latent dimension, and informativeness measures the prediction accuracy of molecular properties given the latent representation. From Table 3, we find MoFlow learns a better and more disentangled latent space than CGVAE and HierVAE. One possible reason is that MoFlow
(369) has a larger latent space than CGVAE (100) and HierVAE (32) since Flow restricts the latent size to be equal to the input size. Similarly, CGVAE ranks the second likely because its latent space size is larger than HierVAE.

heading: D MOLECULE MANIPULATION EXPERIMENTS
text: D.1 MOLECULE GENRATION EVALUATION
We evaluate the Validity, Novelty and Uniqueness of the generated molecules as proposed in Kusner et al. (2017) in Table 4. We can observe that MolSpacE not only improves the success rate from the baseline methods, but also in general improves the validity, novelty, and uniqueness.
Besides, in Fig. 9, we also report the SSR curves of molecule manipulations over three models on QM9 and ZINC datasets with multiple manipulation ranges (distance in the latent space), [−1, 1], [−5, 5], [−10, 10] and [−20, 20]. From the figure, we can observe that the trends in each of the curves remain still when the manipulation range changes. In general, either too large or too small range is not desired, we set it as a hyper-parameter and we observe that [−1, 1] is a reasonably good default value. More experiments on molecule manipulation can be found in Appendix D.
D.2 MOLECULE MANIPULATION EVALUATION
In this section, we report detailed results for all manipulation ranges [−1, 1], [−5, 5], [−10, 10], [−20, 20] in terms of success rate and strict success rate in Table 5 and 5. Additionally, we visualize the SSR curves of molecule manipulations over three models on QM9 and ZINC in Fig. 10 and SR/SSR curves of molecule manipulation with HierVAE on ChEMBL datasets in Fig. 12. The manipulation visualization of CGVAE on QED, MolWt and LogP is provided in Fig. 13.
D.3 MOLECULE MANIPULATION EVALUATION (CATEGORICAL)
To extensively demonstrate our results, we also randomly select four categorical molecular properties and show the results in terms of SR and SSR in Table 7 and 8, respectively. We can observe that the gaps between SR and SSR are much larger than the gaps in continuous molecular properties since it is easier for the method to generate molecules with same molecular property scores for the categorical data.

heading: E MOLSPACE DEMO
text: As shown in Fig. 6, we design an interactive real-time system for molecule manipulation, where the user can click random to randomly sample a molecule and freely select which model to interpret, which property to interpret, and tuning the slide bar manipulates the molecule accordingly. The demo video is anonymously provided at https://drive.google.com/drive/folders/ 1N036p_5OfvGZybgPJ3Vw1ONXHVepimSR?usp=sharing.

Review summaries:
This paper proposes to analyse latent space-based generative models of molecules by measuring how separable the latent space is with respect to several molecular properties. If a property is sufficiently separable, then it can be affected by moving along the normal vector of the separation plane. Experiments compare the streerability of several established generative models. 

This paper proposes Molecular Space Explorer (MolSpacE), a method to generate molecules with continuously varying properties using a pre-trained latent variable generative model. It essentially involves 3 steps (although these steps were not clearly spelled out in the paper):  1. Sample many points from the model and evaluate their properties 2. For each property, train a SVM to predict the property given the the latent vector 3. Use the normal to this hyperplane as a "property manipulation" direction in latent space, which can be added a latent vector to change the property value of the decoded molecule.

This paper presents a method named "MolSpaceExplorer" that explores the latent space of a molecule generative model to continuously optimize molecules toward despred properties.They identify latent directions by constructing a serapation boundary (hyperplane) on the latent space and use the directions to improve latent vectors, which are then fed into the generatove model to produce new molecules with desired properties. The authors also developed an interface for interactive molecular discovery. The authors mentioned that the main contributions of this study are 1) this method is model-agnostic thus applicable to any molecule generative model 2) it does not require any retraining of the molecule generative model.