Skip to content
Back to the collection

Automatic chemical design using a data-driven continuous representation of molecules

Rafael Gómez-Bombarelli, Jennifer N. Wei, David Duvenaud

Show all 10 authors

José Miguel Hernández-Lobato, Benjamín Sánchez-Lengeling, Dennis Sheberla, Jorge Aguilera-Iparraguirre, Timothy D. Hirzel, Ryan P. Adams, Alán Aspuru-Guzik

2016 · arXiv

Read the paper
HN score
0
Mentions
6
Readers
5
Months
5
What’s in a score?

From the abstract

We report a method to convert discrete representations of molecules to and from a multidimensional continuous representation. This model allows us to generate new molecules for efficient exploration and optimization through open-ended spaces of chemical compounds. A deep neural network was trained on hundreds of thousands of existing chemical structures to construct three coupled functions: an encoder, a decoder and a predictor. The encoder converts the discrete representation of a molecule into a real-valued continuous vector, and the decoder converts these continuous vectors back to discrete molecular representations. The predictor estimates chemical properties from the latent continuous vector representation of the molecule. Continuous representations allow us to automatically generate novel chemical structures by performing simple operations in the latent space, such as decoding random vectors, perturbing known chemical structures, or interpolating between molecules. Continuous representations also allow the use of powerful gradient-based optimization to efficiently guide the search for optimized functional compounds. We demonstrate our method in the domain of drug-like molecules and also in the set of molecules with fewer that nine heavy atoms.

Metadata: arXiv. Abstracts retain their original authors’ rights.

In the conversation

Original HN comments, with labels from simple text rules. A label describes the whole comment and may miss context or irony. Read the discussion to make up your own mind. About the labels

6 selected excerpts · 6 total mentions

dekhn
Neutral mention · rule
Let me start with an example- some time ago I worked on a VAE that encoded and decoded SMILES strings. The idea is that you should be able to encode a SMILES into an embedding space, do all the normal things you would do in that space, and then convert the resulting embedding vector back to a valid molecule. The VAE is trained with a very large number of valid SMILES strings, typically tokenized at the character level (so "C" is a token, and "Br" is "B" then "r"). I and others have observed that VAEs trained like this produce large number of embedding vectors that do not decode to valid SMILES strings- they have syntax errors, or perform chemical alchemy (personally, I…
Read the full comment
saw the training set had Br (bromine) and Ca (Calcium), and the output molecules sometimes were Ba (barium) even though that's not in the original dataset at all. There are other reasons why the tokenizer produces bad results- only about 1-10% of vectors decode to valid molecules. Invalid SMILES are mostly useless- they don't correspond to actual structures. To respond to this, the SELFIES format makes a few changes so that it is effectively impossible to produce invalid SELFIES stringes when decoding a VAE. Among other things, tokenization matches the actual elements and so the model will only ever output valid elements. I believe this is the SMILES paper that my own experiments were based on: https://arxiv.org/pdf/1610.02415 (see https://github.com/maxhodak/keras-molecules for an open source attempt at implementation) And this is the paper introducing SELFIES: https://arxiv.org/abs/1905.13741 (open source packages for working with SELFIES, and some example training scripts https://github.com/aspuru-guzik-group/selfies see "Validity of Latent Space in VAE SMILES vs. SELFIES for more detail on the robustness). BTW, as a side note: even though we put a bunch of effort into duplicating the original SMILES VAE, it was extremely slow to train and not very useful. Now you can just ask Gemini to write a full SELFIES VAE and train it in less than a day on a conventional GPU (thanks pytorch transformers!) to get a decent basic set of embeddings useful for exploring chemical space.
gpcr1949
Neutral mention · rule
It's important to note that although chemical space is quite large, most of this space is not easy to synthesize and also is not chemically feasible, stable or desirable. Another interesting "small" subset of chemical space is ZINC [0] which is a database of about a billion commercially offered compounds, meaning that manufacturers at a minimum think they can easily make them (and effectively the fulfilment is quite high when random compounds are ordered, e.g. 95% in this paper where they did molecular docking simulations on the entirity of this database to find new melatonin receptor modulators [1]). Concerning exploration of chemical space, one area that might be of…
Read the full comment
interest here is the quite effective smooth(ish) movement through structure-property space using VAEs.[2] [0] https://zinc.docking.org/ [1] "Virtual discovery of melatonin receptor ligands to modulate circadian rhythms" https://www.nature.com/articles/s41586-020-2027-0.pdf [2] "Automatic Chemical Design Using a Data-DrivenContinuous Representation of Molecules", https://arxiv.org/pdf/1610.02415.pdf
41321121
Neutral mention · rule
It seems to me a fundamental problem with this paper is that they're training an autoencoder on a relatively small set of drugs that have been tested on cancer. They are then trying to approximately index a much larger dataset of chemicals and claiming these are novel possible cancer treatments because some of them have been previously considered as cancer drugs. It's not clear that this is doing much more than finding drugs similar to the training drugs in the new dataset. Given that a large part of pharmaceutical/chemical development is based on slightly modifying existing compounds, it is not obvious that this adds much to the discovery pipeline, or that it is robust…
Read the full comment
to false positives (drugs that have similar "fingerprints" to those seen in training set but are part of a large class of chemicals that mostly don't fight cancer and are therefore unlikely to appear in the small training set of possible cancer-fighting compounds). Fundamentally machine learning works better with large data. It is hard to believe that training on 6000 chemicals, given the overall diversity in chemical space (~72 million chemicals in the dataset they're indexing) is likely to lead to a real "understanding" of what constitutes a cancer-fighting drug as opposed to parroting existing drugs they're trained on. The effort from Ryan P. Adams' group (https://arxiv.org/pdf/1610.02415v2.pdf) is I think more reasonable because it trains on larger sets of chemicals, and is also truly generative in the sense of being able to create new chemicals as opposed to signatures "similar to" existing ones. Though I should note that they also had trouble generating plausible chemical structures despite a larger training set.
momeara
Neutral mention · rule
Several people have asked for background material for the workshop-- (Wallach, 2015, http://arxiv.org/pdf/1510.02855.pdf) AtomNet: A Deep Convolutional Neural Network for Bioactivity Prediction in Structure-based Drug Discovery (Duvenaud, 2015, http://papers.nips.cc/paper/5954-convolutional-networks-on-g...) Convolutional Networks on Graphs for Learning Molecular Fingerprints (Kearnes, 2016, http://arxiv.org/abs/1606.08793v1) Modeling Industrial ADMET Data with Multitask Networks (Gómez-Bombarelli, 2016, doi:10.1038/nmat4717) Design of efficient molecular organic light-emitting diodes by a high-throughput virtual screening and experimental approach and of course (Gómez-Bombarelli, 2016, https://arxiv.org/abs/1610.02415) Automatic chemical design using a data-driven continuous representation of molecules
duvenaud
Neutral mention · rule
One of the authors of the original paper https://arxiv.org/abs/1610.02415 here. From a machine learning point of view, we simply glued together two techniques: text autoencoders and Bayesian optimization. That is, we trained an autoencoder to transform a text representation of chemicals (SMILES) to and from continuous vectors. Then “chemical design” is just maximizing a function of a continuous variable, something that we already know a lot about. We also showed off some of the nice things that one can do with continuous latent representations, such as interpolation. This had already been done for images by many people, and for text in https://arxiv.org/abs/1511.06349 Of…
Read the full comment
course, our paper is just a proof of concept. For instance, instead of encoding to and from SMILES, it would be much better to encode to and from graphs directly. We know how to encode graphs into vectors, but I don’t know of a good way to decode a vector into a graph. Another open problem is that it’s hard to know what to optimize. Our initial experiments optimizing for specific chemical properties produced suggested molecules with crazy structures, such as giant rings. Human chemists have a great intuition for what is easily synthesizable or stable, and it’s hard to articulate all the properties we want the molecule to have programmatically. Alternatively, we could enforce the optimizer to only look at molecules similar to ones we’ve already seen, but this is unsatisfying too - after all, the best result of exploration is when you find something unlike what you’ve seen before.
dekhn
Neutral mention · rule
No, I mean the older paper with the VAE for SMILES https://arxiv.org/abs/1610.02415 which we ended up implementing here: https://github.com/maxhodak/keras-molecules SELFIES is just a pip install away; I think the team learned from their previous papers to be more open about the limits, as well as releasing code and weights for reproducibility. I don't follow this area closely enough to really have any comments about SELFIES other than "well, at least the problems we identified were addressed in later work". Specifically, my goal was to start with two SMILES strings, encode them to vectors, then sample points along the path between the two vectors, and decode them back to valid molecules. Presumably, SELFIES does this far better (see the examples in the repo).

Keep following the thread.

More in Machine learning

More from the same topics.