All SMILES Variational Autoencoder for Molecular Property Prediction and Optimization

1 INTRODUCTION . The design of new pharmaceuticals , OLED materials , and photovoltaics all require optimization within the space of molecules ( Pyzer-Knapp et al. , 2015 ) . While well-known algorithms ranging from gradient descent to the simplex method facilitate efficient optimization , they generally assume a continuous search space and a smooth objective function . In contrast , the space of molecules is discrete and sparse . Molecules correspond to graphs , with each node labeled by one of ninety-eight naturally occurring atoms , and each edge labeled as a single , double , or triple bond . Even within this discrete space , almost all possible combinations of atoms and bonds do not form chemically stable molecules , and so must be excluded from the optimization domain , yet there remain as many as 1060 small molecules to consider ( Bohacek et al. , 1996 ) . Moreover , properties of interest are often sensitive to even small changes to the molecule ( Stumpfe & Bajorath , 2012 ) , so their optimization is intrinsically difficult . Efficient , gradient-based optimization can be performed over the space of molecules given a map between a continuous space , such as Rn or the n-sphere , and the space of molecules and their properties ( Sanchez-Lengeling & Aspuru-Guzik , 2018 ) . Initial approaches of this form trained a variational autoencoder ( VAE ) ( Kingma & Welling , 2013 ; Rezende et al. , 2014 ) on SMILES string representations of molecules ( Weininger , 1988 ) to learn a decoder mapping from a Gaussian prior to the space of SMILES strings ( Gómez-Bombarelli et al. , 2018 ) . A sparse Gaussian process on molecular properties then facilitates Bayesian optimization of molecular properties within the latent space ( Dai et al. , 2018 ; Gómez-Bombarelli et al. , 2018 ; Kusner et al. , 2017 ; Samanta et al. , 2018 ) , or a neural network regressor from the latent space to molecular properties can be used to perform gradient descent on molecular properties with respect to the latent space ( Aumentado-Armstrong , 2018 ; Jin et al. , 2018 ; Liu et al. , 2018 ; Mueller et al. , 2017 ) . Alternatively , semi-supervised VAEs condition the decoder on the molecular properties ( Kang & Cho , 2018 ; Lim et al. , 2018 ) , so the desired properties can be specified directly . Recurrent neural networks have also been trained to model SMILES strings directly , and tuned with transfer learning , without an explicit latent space or encoder ( Gupta et al. , 2018 ; Segler et al. , 2017 ) . SMILES , the simplified molecular-input line-entry system , defines a character string representation of a molecule by performing a depth-first pre-order traversal of a spanning tree of the molecular graph , emitting characters for each atom , bond , tree-traversal decision , and broken cycle ( Weininger , 1988 ) . The resulting character string corresponds to a flattening of a spanning tree of the molecular graph , as shown in Figure 1 . The SMILES grammar is restrictive , and most strings over the appropriate character set do not correspond to well-defined molecules . Rather than require the VAE decoder to explicitly learn this grammar , context-free grammars ( Kusner et al. , 2017 ) , and attribute grammars ( Dai et al. , 2018 ) have been used to constrain the decoder , increasing the percentage of valid SMILES strings produced by the generative model . Invalid SMILES strings and violations of simple chemical rules can be avoided entirely by operating on the space of molecular graphs , either directly ( De Cao & Kipf , 2018 ; Ma et al. , 2018 ; Li et al. , 2018 ; Liu et al. , 2018 ; Simonovsky & Komodakis , 2018 ) or via junction trees ( Jin et al. , 2018 ) . Every molecule is represented by many well-formed SMILES strings , corresponding to all depth-first traversals of every spanning tree of the molecular graph . The distance between different SMILES strings of the same molecule can be much greater than that between SMILES strings from radically dissimilar molecules ( Jin et al. , 2018 ) , as shown in Figure 8 of Appendix A . A generative model of individual SMILES strings will tend to reflect this geometry , complicating the mapping from latent space to molecular properties and creating unnecessary local optima for property optimization ( Vinyals et al. , 2015 ) . To address this difficulty , sequence-to-sequence transcoders ( Sutskever et al. , 2014 ) have been trained to map between different SMILES strings of a single molecule ( Bjerrum , 2017 ; Bjerrum & Sattarov , 2018 ; Winter et al. , 2019b ; a ) . Reinforcement learning , often combined with adversarial methods , has been used to train progressive molecule growth strategies ( Guimaraes et al. , 2017 ; Jaques et al. , 2017 ; Olivecrona et al. , 2017 ; Putin et al. , 2018 ; You et al. , 2018 ; Zhou et al. , 2018 ) . While these approaches have achieved state-of-the-art optimization of simple molecular properties that can be evaluated quickly in silico , critic-free techniques generally depend upon property values of algorithm-generated molecules ( but see ( De Cao & Kipf , 2018 ; Popova et al. , 2018 ) ) , and so scale poorly to real-world properties requiring time-consuming wet-lab experiments . Molecular property optimization would benefit from a generative model that directly captures the geometry of the space of molecular graphs , rather than SMILES strings , but efficiently infers a latent representation sensitive to spatially distributed molecular features . To this end , we introduce the All SMILES VAE , which uses recurrent neural networks ( RNNs ) on multiple SMILES strings to implicitly perform efficient message passing along and amongst many flattened spanning trees of the molecular graph in parallel . A fixed-length latent representation is distilled from the variablelength RNN output using attentional mechanisms . From this latent representation , the decoder RNN reconstructs a set of SMILES strings disjoint from those input to the encoder , ensuring that the latent representation only captures features of the molecule , rather than its SMILES realization . Simple property regressors jointly trained on this latent representation surpass the state-of-the-art for molecular property prediction , and facilitate exceptional gradient-based molecular property optimization when constrained to the region of the prior containing almost all the probability around it . We further demonstrate that the latent representation forms a near-bijection with the space of molecules , and is smooth with respect to molecular properties , facilitating effective optimization . For a complete delineation of our novel contributions relative to past work , see Appendix B.4 . 2 EFFICIENT MOLECULAR ENCODING WITH MULTIPLE SMILES STRINGS . A variational autoencoder ( VAE ) defines a generative model over an observed space x in terms of a prior distribution over a latent space p ( z ) and a conditional likelihood of observed states given the latent configuration p ( x|z ) ( Kingma & Welling , 2013 ; Rezende et al. , 2014 ) . The true loglikelihood log [ p ( x ) ] = log [ ∫ z p ( z ) p ( x|z ) ] is intractable , so the evidence lower bound ( ELBO ) , based upon a variational approximation q ( z|x ) to the posterior distribution , is maximized instead : L = Eq ( z|x ) [ log p ( x|z ) ] −DKL [ q ( z|x ) ||p ( z ) ] . The ELBO implicitly defines a stochastic autoencoder , with encoder q ( z|x ) and decoder p ( x|z ) . Many effective molecule encoders rely upon graph convolutions : local message passing in the molecular graph , between either adjacent nodes or adjacent edges ( Duvenaud et al. , 2015 ; Kearnes et al. , 2016 ; Kipf & Welling , 2016a ; Li et al. , 2015 ; Lusci et al. , 2013 ) . To maintain permutation symmetry , the signal into each node is a sum of messages from the adjacent nodes , but may be a function of edge type , or attentional mechanisms dependent upon the source and destination nodes ( Ryu et al. , 2018 ) . This sum of messages is then subject to a linear transformation and a pointwise nonlinearity . Messages are sometimes subject to gating ( Li et al. , 2015 ) , like in long shortterm memories ( LSTM ) ( Hochreiter & Schmidhuber , 1997 ) and gated recurrent units ( GRU ) ( Cho et al. , 2014 ) , as detailed in Appendix B.1 . Message passing on molecular graphs is analogous to a traditional convolutional neural network applied to images ( Krizhevsky et al. , 2012 ; LeCun et al. , 1990 ) , with constant-resolution hidden layers ( He et al. , 2016 ) and two kernels : a 3× 3 average-pooling kernel that sums messages from adjacent pixels ( corresponding to adjacent nodes in a molecular graph ) , and a trainable 1× 1 kernel that transforms the message from each pixel ( node ) independently , before a pointwise nonlinearity . While such convolutional networks are now standard in the visual domain , they use hundreds of layers to pass information throughout the image and achieve effective receptive fields that span the entire input ( Szegedy et al. , 2016 ) . In contrast , molecule encoders generally use between three and seven rounds of message passing ( Duvenaud et al. , 2015 ; Gilmer et al. , 2017 ; Jin et al. , 2018 ; Kearnes et al. , 2016 ; Liu et al. , 2018 ; Samanta et al. , 2018 ; You et al. , 2018 ) . This limits the computational cost , since each iteration of message passing only propagates information a geodesic distance of one within the molecular graph.1 In the case of the commonly used dataset of 250,000 drug-like molecules ( Gómez-Bombarelli et al. , 2018 ) , information can not traverse these graphs effectively , as their average diameter is 11.1 , and their maximum diameter is 24 , as shown in Appendix A. Non-local molecular properties , requiring long-range information propagation along the molecular graph , are of practical interest in domains including pharmaceuticals , photovoltaics , and OLEDs . The pharmacological efficacy of a molecule generally depends upon high binding affinity for a particular receptor or other target , and low binding affinity for other possible targets . These binding affinities are determined by the maximum achievable alignment between the molecule ’ s electromagnetic fields and those of the receptor . Changes to the shape or charge distribution in one part of the molecule affect the position and orientation at which it fits best with the receptor , inducing shifts and rotations that alter the binding of other parts of the molecule , and changing the binding affinity ( Clayden et al. , 2001 ) . Similarly , efficient next-generation OLEDs depend on properties , such as the singlet-triplet energy gap , that are directly proportional to the strength of long-range electronic interactions across the molecule ( Im et al. , 2017 ) . The latent representation of a VAE can directly capture these non-local , nonlinear properties only if the encoder passes information efficiently across the entire molecular graph . Analogous to graph convolutions , gated RNNs defined directly on SMILES strings effectively pass messages , via the hidden state , through a flattened spanning tree of the molecular graph ( see Figure 1 ) . The message at each symbol in the string is a weighted sum of the previous message and the current input , followed by a pointwise nonlinearity and subject to gating , as reviewed in Appendix B.1 . This differs from explicit graph-based message passing in that the molecular graph is flattened into a chain corresponding to a depth-first pre-order traversal of a spanning tree , and the set of adjacent nodes that affect a message only includes the preceding node in this chain . Rather than updating all messages in parallel , RNNs on SMILES strings move sequentially down the chain , so earlier messages influence 1All-to-all connections allow fast information transfer , but computation is quadratic in graph size ( Gilmer et al. , 2017 ; Kearnes et al. , 2016 ) . Lusci et al . ( 2013 ) considered a set of DAGs rooted at every atom , with full message propagation in a single pass . all later messages , and information can propagate through all branches of a flattening of a spanning tree in a single pass . With a well-chosen spanning tree , information can pass the entire width of the molecular graph in a single RNN update . The relationship between RNNs on SMILES strings and graph-based architectures is further explored in Appendix B .

Summary: The authors describie a novel variational autoencoder like method for molecules. Instead of using graph neural networks, the authors hava an approach based on SMILES which encode molecules as strings. To avoid the problem that any given molecule may be represented by multiple SMILES strings, the authors consider an encoder that makes use of several random SMILES representations of the input molecule. These are preprocessed using recurrent neural networks generating an average representation by pooling the representations generated with each SMILES sequence for each atom in the input molecule. This reduces the number of operations needed to share information across all the atom in the