I NTERPRETING M OLECULE G ENERATIVE M ODELS FOR I NTERACTIVE M OLECULE D ISCOVERY
Anonymous authors
Paper under double-blind review
A BSTRACT
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 difﬁcult 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 ﬁrst identiﬁes 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.
I NTRODUCTION
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 difﬁcult 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).
Speciﬁcally, reinforcement learning-based algorithm (You et al., 2018a) equips the model with rewards designed to encourage the molecule generative models to generate molecules with speciﬁc 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 conﬁned 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 coefﬁcient), 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 signiﬁcantly 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.
Speciﬁcally,
MolSpace Explorer ﬁrst identiﬁes the property separation hyperplane which deﬁnes 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.
R ELATED W ORK
Molecule Generation.
Recent studies have explored a variety of deep generative models for molecule generation.
Speciﬁcally, 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 ﬂows, 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 speciﬁc, JT-VAE (Jin et al., 2018a) proposes a VAE-based architecture to encode both atomic graphs and structural graphs for efﬁcient 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)
ﬁrst introduces normalizing ﬂows for molecule generation, where the generation process is invertible.
Later work improve the ﬂow-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 ﬁne-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 ﬂexible 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 (G´omez-Bombarelli et al., 2018; Jin et al., 2018b; Winter et al., 2019; Grifﬁths & Hern´andez-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.
P RELIMINARIES
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 ∈ R l with l being the dimension of the latent space, and is capable of decoding any latent vector back to the molecular space.
Speciﬁcally, variational autoencoder (VAE) (Kingma & Welling, 2013) and ﬂow-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:
[Equation]
where x and x (cid:48) are the ground-truth and reconstructed/sampled data respectively, and z ∈ Z represents a latent vector in the latent space.
P ROBLEM F ORMULATION OF M OLECULE M ANIPULATION
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 speciﬁc, a deep generative model contains a generator g : Z → X , where Z ∈ R l 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 f P which deﬁne the property space P via P = f P ( X ) . [Figure]
Formulation.
The input to molecule manipulation is a list of n molecules X
= { x 1 , x 2 , · · · , x n } and a list of m molecular properties P = { p 1 , p 2 , · · · , p m } .
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 (cid:48)
= { 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 speciﬁc, 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:
[Equation]
where f p 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 ﬂexible deﬁnition of success, namely soft success, as follows:
[Equation]
where (cid:15) is a predeﬁned 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:
[Equation]
where x p represents manipulating property p of molecule x which results in a manipulation path x p
= { 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:
[Equation]
[Equation]
S t r u c t u r e S
i m i
l a r i t y 0.
[Figure] [Figure]
where δ measures the structure similarity between the two input molecules. Similarly, we provide a soft structure difference (SSD) with a predeﬁned tolerance threshold γ as follows:
[Equation]
Finally, we calculate the overall SSR as:
[Equation]
| X | , (8) ‘ M OLECULE M ANIPULATION THROUGH M OL S PAC E 5. L ATENT C LUSTER A SSUMPTION 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 x 1 and x 2 , represented by latent vectors z 1 and z 2 , can lead to a list of intermediate molecules whose structures gradually change from x 1 to x 2 .
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.
The left ﬁgure shows that molecules that are close in the latent space are similar in structures.
The right ﬁgure shows that interpolating two molecules in the latent space could lead to smooth structure changes.
5. I DENTIFYING L ATENT D IRECTIONS
Latent Separation Boundary.
With the veriﬁcations 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 deﬁnes 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 ﬁnd a hyperplane for each molecular property with a unit normal vector n ∈ R l , such that the distance from any sample z to the hyperplane as:
[Equation]
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 :
[Equation]
where f P 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:
[Equation]
where A =
Diag ( a 1 , · · · , a m ) is the diagonal matrix with linear coefﬁcients for each of the m molecular properties and N =
[ n 1 , · · · , n m ] represents normal vectors for the separation boundaries of m molecular properties.
We have the molecular properties P following a multivariate normal distribution via:
[Equation]
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 n Ti n j is used to denote the entanglement between the i -th and j -th molecular properties in P .
5. I MPLEMENTING THE M OLECULE M ANIPULATION
After we ﬁnd the separation boundary and identify the latent direction, to manipulate the generated molecules with desired properties, we ﬁrst move from latent vector z along the direction n with a degree scalar α , and the new latent vector is
[Equation]
To this end, the expected property of the new manipulated molecule is
[Equation]
where k is a scaling factor between molecular vector space and property.
Based on our assumption to ﬁnd a separation boundary for each molecular property, we utilize linear Support Vector Machine (SVM) (Cortes & Vapnik, 1995) to ﬁnd 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 f P to calculate the corresponding molecular properties.
Then, we ﬁnd the separation boundaries for each molecular property.
The normal vectors N of separation boundaries are ﬁnally utilized as identiﬁed latent directions that govern the molecular properties.
Additionally, our method is highly efﬁcient thanks to leveraging shallow models compared to optimization-based methods which require re-training of deep models for each of the speciﬁc molecular properties.
E XPERIMENTS 6. E XPERIMENT S ETUP
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 (G´omezBombarelli 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 deﬁnes 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-Learn 1 .
6. E VALUATION P ROTOCOLS
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.
Speciﬁcally,
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 ﬂow-based model which learns an invertible mapping between input molecules and latent vectors.
Molecular Properties.
We study molecular properties identiﬁed in the chemistry community through open-source cheminformatics software 2 .
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 coefﬁcient (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.
6. Q UANTITATIVE E VALUATION OF M OLECULE M ANIPULATION
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 ﬁrst 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 reﬂects 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-reﬂected.
(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 [Table] can observe that the gaps between SSR and SR are small, while the average gap is large, we ﬁnd that the gaps are large in categorical properties shown in Appendix D.3 Table 7 and 8.
The baseline (random manipulation) method sometimes “ﬁnds” 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.
6. Q UALITATIVE E VALUATION OF M OLECULE M ANIPULATION AND I NTERPRETATION
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 
 and-]placeand we attempt to manipulate the molecular property to the left (lower) and the right (higher).
From the ﬁgure, 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.
[Figure]
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.
The ﬁgures have shown that our method succeeds in learning interpretable and steerable directions.
For example, for HierVAE in Fig. 4, we can ﬁnd 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.
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 ﬁgure, 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.
C ONCLUSION
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.
Appendix for “Interpreting Molecule Generative Models for
Interactive
Molecule Discovery” A M OLECULE G ENERATIVE M ODELS
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
[Table]
[Table]
A. M OLECULE G ENERATIVE M ODEL F ORMULATION
VAE.
gets a lower bound (ELBO) for the data log probability by introducing a proposal distribution.
[Equation]
Flow.
The key of Flow model is to design a invertible function with the following nice property:
[Equation]
where f i is invertible function.
To be more concrete, we can take z 0 as some tractable noise distribution, like Gaussian distribution, and repeating this for K steps will lead to the data distribution, i.e. ,:
[Equation]
Thus, the log likelihood of the data is as follows:
[Equation]
B S TUDY OF M OLECULAR P ROPERTIES
List of Molecular Properties.
In total, study 154 molecular properties from the open chemistry library RDKit 3 .
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, Ndealkylation
, 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, imida
- zole
, 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, sulﬁde, 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, sulﬁde, sulfonamd, sulfone, acetylene, tetrazole, thiazole, thiocyan, thiophene, alkane, urea.
However, not all of the molecular properties are varied in the three datasets.
Speciﬁcally, QM9 contains 22 frozen molecular properties, NumRadicalElectrons, EState10, S, SH, azide, azo, barbitur, benzodiazepine, diazo, hdrzine, hdrzone, isocyan, isothiocyan, nitroso, acid, prisulfonamd, sulﬁde, 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.
From there, we can observe that the property distribution may vary a lot in terms 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.
[Figure]
[Table]
C L ATENT S PACE E VALUATION
To evaluate the quality of the learned latent space, we utilize three disentanglement evaluation metrics, disentanglement, completeness and informativeness (Eastwood & Williams, 2018).
To be speciﬁc, 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 ﬁnd 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.
D M OLECULE M ANIPULATION E XPERIMENTS D. M OLECULE G ENRATION E VALUATION
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 ﬁgure, 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. M OLECULE M ANIPULATION E VALUATION
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.
The manipulation visualization of CGVAE on QED, MolWt and LogP is provided in Fig.
D. M OLECULE M ANIPULATION E VALUATION (C ATEGORICAL )
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.
E M OL S PAC E D EMO
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/
[Table]
HierVAE-M (-1,1) 68.
HierVAE-M (-5,5) 64.
HierVAE-M (-10,10) 61.
HierVAE-M (-20,20) 60.
ZINC
CGVAE
N/A 100.
CGVAE-R (-1,1) 6.
CGVAE-L (-1,1) 2.
CGVAE-M (-1,1) 46.
CGVAE-M (-5,5) 44.
CGVAE-M (-10,10) 43.
CGVAE-M (-20,20) 44.
ZINC
MoFlow
N/A 100.
MoFlow-R (-1,1) 18.
MoFlow-L (-1,1) 0.
MoFlow-M (-1,1) 24.
MoFlow-M (-5,5) 40.
MoFlow-M (-10,10) 36.
MoFlow-M (-20,20) 27.
ZINC
HierVAE
N/A 100.
HierVAE-R (-1,1) 1.
HierVAE-L (-1,1) 0.
HierVAE-M (-1,1) 42.
HierVAE-M (-5,5) 55.
HierVAE-M (-10,10) 52.
HierVAE-M (-20,20) 46.
ChEMBL
HierVAE
N/A 100.
HierVAE-R (-1,1) 1.
HierVAE-L (-1,1) 1.
HierVAE-M (-1,1) 62.
HierVAE-M (-5,5) 56.
HierVAE-M (-10,10) 61.
HierVAE-M (-20,20) 59.
[Table]
0.80 CGVAE-M (-20,20) 44.
MoFlow-R 18.
0.60 MoFlow-L 0.
0.00 MoFlow-M (-1,1) 24.
19.20 MoFlow-M (
[Table] [Table]
24.30 MoFlow-M (-10,10) 36.
[Table]
14.30 MoFlow-M (
[Table]
[Table] [Table]
[Table] [Table]
HierVAE-R 1.
1.00 HierVAE-L 0.
0.70 HierVAE-M (-1,1) 42.
32.20 HierVAE-M (-5,5) 55.
9.60 HierVAE-M (-10,10) 52.
[Table] [Table]
-M (-10,10) 6.
[Table] [Table]
[Table] [Table]
[Table] [Table]
CGVAE-
[Table] [Table]
[Table] [Table]
[Table]
MoFlow-R
[Table]
[Table] [Table]
[Table] [Table]
[Table] [Table]
60 MoFlow-
[Table] [Table]
[Table]
00 MoFlow-
[Table]
[Table] [Table]
20 MoFlow
[Table] [Table]
[Table]
MoFlow
[Table] [Table]
HierVAE-
[Table] [Table]
[Table]
.00 HierVAE-L 0.
[Table]
[Table] [Table]
[Table] [Table]
[Table] [Table]
.70 HierVAE-M
[Table]
[Table] [Table]
[Table] [Table]
32.20 HierVAE-M
[Table]
[Table] [Table]
[Table] [Table]
[Table] [Table]
.60 HierVAE-M
[Table] [Table]
[Table] [Table]
HierVAE-M (-1,1) 68.
HierVAE-M (-5,5) 64.
HierVAE-M (-10,10) 61.
HierVAE-M (-20,20) 60.
ZINC
CGVAE-R 6.
CGVAE-L 2.
CGVAE-M (-1,1) 46.
CGVAE-M (-5,5) 44.
CGVAE-M (-10,10) 43.
CGVAE-M (-20,20) 44.
MoFlow-R 18.
MoFlow-L 0.
MoFlow-M (-1,1) 24.
MoFlow-M (-5,5) 40.
MoFlow-M (-10,10) 36.
MoFlow-M (-20,20) 27.
HierVAE-R 1.
HierVAE-L 0.
HierVAE-M (-1,1) 42.
HierVAE-M (-5,5) 55.
HierVAE-M (-10,10) 52.
HierVAE-M (-20,20) 46.
ChEMBL
HierVAE-R 0.
HierVAE-L 0.
HierVAE-M (-1,1) 62.
HierVAE-M (-5,5) 56.
HierVAE-M (-10,10) 61.
HierVAE-M (-20,20) 59.
[Table]
HierVAE-M (-1,1) 27.
HierVAE-M (-5,5) 24.
HierVAE-M (-10,10) 28.
HierVAE-M (-20,20) 30.
ZINC
CGVAE-R 0.
CGVAE-L 0.
CGVAE-M (-1,1) 3.
CGVAE-M (-5,5) 5.
CGVAE-M (-10,10) 6.
CGVAE-M (-20,20) 7.
MoFlow-R 2.
MoFlow-L 0.
MoFlow-M (-1,1) 9.
MoFlow-M (-5,5) 12.
MoFlow-M (-10,10) 9.
MoFlow-M (-20,20) 6.
HierVAE-R 0.
HierVAE-L 0.
HierVAE-M (-1,1) 19.
HierVAE-M (-5,5) 19.
HierVAE-M (-10,10) 14.
HierVAE-M (-20,20) 7.
ChEMBL
HierVAE-R 0.
HierVAE-L 0.
HierVAE-M (-1,1) 19.
HierVAE-M (-5,5) 24.
HierVAE-M (-10,10) 38.
HierVAE-M (-20,20) 39.