CoChat

Leveraging large language models for predictive chemistry

Open access
Jablonka, Kevin Maik, Schwaller, Philippe, Ortega-Guerrero, Andres, Smit, Berend · 2024 · Nature Machine Intelligence

Published version of a preprint

The DOI matches its Crossref record; 83 of the 83 references it cites were found in a registry or an index.

Abstract

Machine learning has transformed many fields and has recently found applications in chemistry and materials science. The small datasets commonly found in chemistry sparked the development of sophisticated machine learning approaches that incorporate chemical knowledge for each application and, therefore, require specialized expertise to develop. Here we show that GPT-3, a large language model trained on vast amounts of text extracted from the Internet, can easily be adapted to solve various tasks in chemistry and materials science by fine-tuning it to answer chemical questions in natural language with the correct answer. We compared this approach with dedicated machine learning models for many applications spanning the properties of molecules and materials to the yield of chemical reactions. Surprisingly, our fine-tuned version of GPT-3 can perform comparably to or even outperform conventional machine learning techniques, in particular in the low-data limit. In addition, we can perform inverse design by simply inverting the questions. The ease of use and high performance, especially for small datasets, can impact the fundamental approach to using machine learning in the chemical and material sciences. In addition to a literature search, querying a pre-trained large language model might become a routine way to bootstrap a project by leveraging the collective knowledge encoded in these foundation models, or to provide a baseline for predictive tasks.

Overview

The claims and statistics of this paper haven’t been checked yet.

Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.

A few free checks a day · papers already verified open instantly · results are public

Integrity signals

Registry

Crossref · 10.1038/s42256-023-00788-1

Cites

83 of 83 references verified0 citation errors · 0 not checkable

Statistics

Figures

Fig. 1 Overview illustration of the datasets and tasks addressed in this work. In this work, we benchmark GPT-3 on datasets spanning the chemical space from molecules over materials to reactions (Supplementary Note 1). On these datasets, we investigate different tasks ranging from classification, that is, predicting
Fig. 1 Overview illustration of the datasets and tasks addressed in this work. In this work, we benchmark GPT-3 on datasets spanning the chemical space from molecules over materials to reactions (Supplementary Note 1). On these datasets, we investigate different tasks ranging from classification, that is, predictingCC-BY · From the PDF
Fig. 2 Accuracy of our GPT-3 model for predicting solid-solution
Fig. 2 Accuracy of our GPT-3 model for predicting solid-solutionCC-BY · From the PDF
Fig. 3 Photoswitch inverse design metrics as a function of temperature. The fraction of valid SMILES indicates the fraction of generated SMILES that can successfully be parsed using RDKit (note that it does not plateau at 0, but approximately 0.1) 63 . We then determine the fraction of those that are already part of the training set and find that at low temperature GPT-3 tends to restate molecules from the training set. To quantitatively capture the similarity of the distribution of the generated molecules to the ones from the training set, we compute the Fréchet ChemNet distance 64 , which quantifies both diversity and distribution match 51 and goes through a minimum at intermediate temperatures. For quantifying how well the generated molecules match the desired transition wavelengths, we use the GPR models reported by ref. 43 to predict the transition wavelengths. The dashed horizontal lines indicate those models' mean absolute error (MAE). Across all temperatures, we found high average synthesizability (synthetic accessibility, SA, score 44 smaller than 3). Error bands indicate s.e.m.
Fig. 3 Photoswitch inverse design metrics as a function of temperature. The fraction of valid SMILES indicates the fraction of generated SMILES that can successfully be parsed using RDKit (note that it does not plateau at 0, but approximately 0.1) 63 . We then determine the fraction of those that are already part of the training set and find that at low temperature GPT-3 tends to restate molecules from the training set. To quantitatively capture the similarity of the distribution of the generated molecules to the ones from the training set, we compute the Fréchet ChemNet distance 64 , which quantifies both diversity and distribution match 51 and goes through a minimum at intermediate temperatures. For quantifying how well the generated molecules match the desired transition wavelengths, we use the GPR models reported by ref. 43 to predict the transition wavelengths. The dashed horizontal lines indicate those models' mean absolute error (MAE). Across all temperatures, we found high average synthesizability (synthetic accessibility, SA, score 44 smaller than 3). Error bands indicate s.e.m.CC-BY · From the PDF
Fig. 4 TMAP visualization of the generated photoswitches and the training set. The tree map (TMAP) algorithm builds a nearest-neighbour graph, which is then embedded in two dimensions. Therefore, similar molecules are connected with an edge. We colour the points depending on whether they are part of the original dataset of ref. 43 but not generated (green) or part of the dataset and generated by our model (orange). Our models can also generate molecules that have not been part of the photoswitch dataset (note that the model was only
Fig. 4 TMAP visualization of the generated photoswitches and the training set. The tree map (TMAP) algorithm builds a nearest-neighbour graph, which is then embedded in two dimensions. Therefore, similar molecules are connected with an edge. We colour the points depending on whether they are part of the original dataset of ref. 43 but not generated (green) or part of the dataset and generated by our model (orange). Our models can also generate molecules that have not been part of the photoswitch dataset (note that the model was onlyCC-BY · From the PDF
Fig. 5 Iteratively biased generation of molecules towards large HOMOLUMO gaps using GPT-3 fine-tuned on the QMugs dataset of draws. We start
Fig. 5 Iteratively biased generation of molecules towards large HOMOLUMO gaps using GPT-3 fine-tuned on the QMugs dataset of draws. We startCC-BY · From the PDF
Extended Data Fig. 1 | Molecule Cloud for randomly generated photoswitch molecules. Molecule Cloud generated using the tool reported by Ertl and Rohde 67 . Aquamarine background indicates samples from molecules in the database reported by Griffiths et al. 43 that our model did not generate, coral indicates the molecules our model generated and that are part of
Extended Data Fig. 1 | Molecule Cloud for randomly generated photoswitch molecules. Molecule Cloud generated using the tool reported by Ertl and Rohde 67 . Aquamarine background indicates samples from molecules in the database reported by Griffiths et al. 43 that our model did not generate, coral indicates the molecules our model generated and that are part ofCC-BY · From the PDF

Verification

Claims the paper makes

The claims and statistics of this paper haven’t been checked yet.

Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.

A few free checks a day · papers already verified open instantly · results are public

Claims other papers make about this one

Each is checked against this paper’s own text: does it say what the citing paper says it does?

Self-check

Percentages, sums and reported differences re-computed from the paper’s own numbers.

The self-check needs the paper’s full text.

Citations

Cites

Show all 83 references

Research works printed but not linked: 7

  1. Goldblum, M., Finzi, M., Rowan, K. & Wilson, A. The no free lunch theorem, Kolmogorov complexity, and the role of inductive biases in machine learning. ICLR 2024 Conference, OpenReview https://openreview.net/forum?id=X7nz6ljg9Y (2023).
  2. Dettmers, T., Lewis, M., Belkada, Y. & Zettlemoyer, L. GPT3.int8(): 8-bit matrix multiplication for transformers at scale. Adv. Neural Inf. Process. Syst. 35, 30318-30332 (2022).
  3. Dettmers, T., Lewis, M., Shleifer, S. & Zettlemoyer, L. 8-bit optimizers via block-wise quantization. in The Tenth International Conference on Learning Representations (2022).
  4. Hu, E. J. et al. LoRA: low-rank adaptation of large language models. in International Conference On Learning Representations (2021).
  5. Griffiths, R.-R. et al. Gauche: a library for Gaussian processes in chemistry. in ICML 2022 2nd AI for Science Workshop https:// openreview.net/forum?id=i9MKI7zrWal (2022)
  6. Radford, A. et al. Language models are unsupervised multitask learners. OpenAI blog 1, 9 (2019).
  7. Kawazoe, Y., Yu, J.-Z., Tsai, A.-P. & Masumoto, T. (eds) Nonequilibrium Phase Diagrams of Ternary Amorphous Alloys Landolt-Börnstein: Numerical Data and Functional Relationships in Science and Technology-New Series (Springer, 2006).

Cited by

See all 382

Metadata

Authors
Jablonka, K. M., Schwaller, P., Ortega-Guerrero, A., & Smit, B.
Affiliations
  • Helmholtz Institute Jena (DE)
  • École Polytechnique Fédérale de Lausanne (CH)
Corresponding author
Smit, Berend
Venue
Nature Machine Intelligence
Published
2024-02-06
Volume
6
Issue
2
Pages
161-169
ISSN
2522-5839 (ISSN-L)
OpenAlex
W4391561379
Cited by
378
References
75
Citations by year
2026: 121 · 2025: 178 · 2024: 77
FWCI
36.62
Type
journal article
Language
en
Open access
Licence
Locations
  • Nature Machine Intelligence (publishedVersion, cc-by)
  • ChemRxiv (acceptedVersion, cc-by)
  • HZB Repository (Helmholtz-Zentrum Berlin für Materialien und Energie GmbH (HZB)) (submittedVersion, other-oa)
  • Infoscience (Ecole Polytechnique Fédérale de Lausanne) (submittedVersion, cc-by-nc-nd)
Funders
  • National Science Foundation
  • Carl-Zeiss-Stiftung
  • Grantham Foundation for the Protection of the Environment
  • École Polytechnique Fédérale de Lausanne
  • Schweizerischer Nationalfonds zur Förderung der Wissenschaftlichen Forschung (180544, 51NF40, 182892, (51NF40-182892).)
  • NCCR Catalysis
Topics
  • Physical Sciences › Materials Science › Materials Chemistry › Machine Learning in Materials Science
  • Life Sciences › Pharmacology, Toxicology and Pharmaceutics › Drug Discovery › Computational Drug Discovery Methods
  • Social Sciences › Arts and Humanities › History and Philosophy of Science › History and advancements in chemistry
Keywords
large language models, GPT-3, fine-tuning, inverse design, molecular property prediction, reaction yield prediction, foundation models, literature searching

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review

Data sources

Bibliographic data: Semantic Scholar, OpenAlex, Crossref.

Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).

Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.