Reaction optimization is fundamental to synthetic chemistry, from optimizing the yield of industrial processes to selecting conditions for the preparation of medicinal candidates1. Likewise, parameter optimization is omnipresent in artificial intelligence, from tuning virtual personal assistants to training social media and product recommendation systems2. Owing to the high cost associated with carrying out experiments, scientists in both areas set numerous (hyper)parameter values by evaluating only a small subset of the possible configurations. Bayesian optimization, an iterative response surface-based global optimization algorithm, has demonstrated exceptional performance in the tuning of machine learning models3. Bayesian optimization has also been recently applied in chemistry4,5,6,7,8,9; however, its application and assessment for reaction optimization in synthetic chemistry has not been investigated. Here we report the development of a framework for Bayesian reaction optimization and an open-source software tool that allows chemists to easily integrate state-of-the-art optimization algorithms into their everyday laboratory practices. We collect a large benchmark dataset for a palladium-catalysed direct arylation reaction, perform a systematic study of Bayesian optimization compared to human decision-making in reaction optimization, and apply Bayesian optimization to two real-world optimization efforts (Mitsunobu and deoxyfluorination reactions). Benchmarking is accomplished via an online game that links the decisions made by expert chemists and engineers to real experiments run in the laboratory. Our findings demonstrate that Bayesian optimization outperforms human decisionmaking in both average optimization efficiency (number of experiments) and consistency (variance of outcome against initially available data). Overall, our studies suggest that adopting Bayesian optimization methods into everyday laboratory practices could facilitate more efficient synthesis of functional chemicals by enabling better-informed, data-driven decisions about which experiments to run.
Subscribe to Journal
Get full journal access for 1 year
only $3.90 per issue
All prices are NET prices.
VAT will be added later in the checkout.
Tax calculation will be finalised during checkout.
Rent or Buy article
Get time limited or full article access on ReadCube.
All prices are NET prices.
Quantum mechanical computation data and Gaussian output files used to parameterize reactions 1–5 are available at https://github.com/b-shields/auto-QChem. Processed reaction outcome data for reactions 1–5 are available at https://github.com/b-shields/edbo and in our published Code Ocean capsule at https://doi.org/10.24433/CO.3864629.v1. Tabulated player data for the reaction optimization game are available at https://github.com/b-shields/EvML.
Two software packages and one web application were written to support this work. The first, auto-qchem, was written to facilitate high-throughput computational chemistry and reaction featurization. This package is freely available at https://github.com/b-shields/auto-QChem. The second, EDBO, was written as a user-friendly implementation of Bayesian optimization. This package is freely available at https://github.com/b-shields/edbo and in our published Code Ocean capsule at https://doi.org/10.24433/CO.3864629.v1. The web application, EvML, was written to collect user data for comparison of Bayesian optimization with human expert performance. This package is freely available at https://github.com/b-shields/EvML.
Carlson, R. Design and Optimization in Organic Synthesis (Elsevier, 1992).
Luo, G. A review of automatic selection methods for machine learning algorithms and hyper-parameter values. Netw. Model. Anal. Health Inform. Bioinform. 5, 18 (2016).
Snoek, J., Larochelle, H. & Adams, R. P. Practical Bayesian optimization of machine learning algorithms. In Advances in Neural Information Processing Systems Vol. 25 (eds Pereira, F. et al.) 2951–2959 (Curran Associates Inc., 2012).
Häse, F., Roch, L. M., Kreisbeck, C. & Aspuru-Guzik, A. Phoenics: a Bayesian Optimizer for Chemistry. ACS Cent. Sci. 4, 1134–1145 (2018).
Griffiths, R.-R. & Hernández-Lobato, J. M. Constrained Bayesian optimization for automatic chemical design using variational autoencoders. Chem. Sci. 11, 577–586 (2020).
Schweidtmann, A. M. et al. Machine learning meets continuous flow chemistry: automated optimization towards the Pareto front of multiple objectives. Chem. Eng. J. 352, 277–282 (2018).
Burger, B. et al. A mobile robotic chemist. Nature 583, 237–241 (2020).
Häse, F., Roch, L. M. & Aspuru-Guzik, A. Gryffin: an algorithm for Bayesian optimization for categorical variables informed by physical intuition with applications to chemistry. Preprint at https://arxiv.org/abs/2003.12127 (2020).
Negoescu, D. M., Frazier, P. I. & Powell, W. B. The knowledge-gradient algorithm for sequencing experiments in drug discovery. INFORMS J. Comput. 23, 346–363 (2011).
Santanilla, A. B. et al. Nanomole-scale high-throughput chemistry for the synthesis of complex molecules. Science 347, 49–53 (2014).
Clayton, A. D. et al. Algorithms for the self-optimisation of chemical reactions. React. Chem. Eng. 4, 1545–1554 (2019).
Häse, F., Roch, L. M. & Aspuru-Guzik, A. Next-generation experimentation with self-driving laboratories. Trends Chem. 1, 282–291 (2019).
Weissman, S. A. & Anderson, N. G. Design of experiments (DoE) and process optimization. A review of recent publications. Org. Process Res. Dev. 19, 1605–1633 (2015).
Lee, R. Statistical design of experiments for screening and optimization. Chem. Ing. Tech. 91, 191–200 (2019).
Murray, P. M. et al. The application of design of experiments (DoE) reaction optimisation and solvent selection in the development of new synthetic chemistry. Org. Biomol. Chem. 14, 2373–2384 (2016).
Hsieh, H.-W., Coley, C. W., Baumgartner, L. M., Jensen, K. F. & Robinson, R. I. Photoredox iridium–nickel dual-catalyzed decarboxylative arylation cross-coupling: from batch to continuous flow via self-optimizing segmented flow reactor. Org. Process Res. Dev. 22, 542–550 (2018).
Mateos, C., Nieves-Remacha, M. J. & Rincón, J. A. Automated platforms for reaction self-optimization in flow. React. Chem. Eng. 4, 1536–1544 (2019).
Feurer, M. & Hutter, F. in Automated Machine Learning: Methods, Systems, Challenges (eds Hutter, F. et al.) 3–33 (Springer, 2019).
Shahriari, B., Swersky, K., Wang, Z., Adams, R. P. & de Freitas, N. Taking the human out of the loop: a review of Bayesian optimization. Proc. IEEE 104, 148–175 (2016).
Maceiczyk, R. M. & deMello, A. J. Fast and reliable metamodeling of complex reaction spaces using Universal Kriging. J. Phys. Chem. C 118, 20026–20033 (2014).
Rogers, A. & Ierapetritou, M. Feasibility and flexibility analysis of black-box processes part 1: surrogate-based feasibility analysis. Chem. Eng. Sci. 137, 986–1004 (2015).
Boukouvala, F. & Ierapetritou, M. G. Feasibility analysis of black-box processes using an adaptive sampling Kriging-based method. Comput. Chem. Eng. 36, 358–368 (2012).
Olofsson, S., Hebing, L., Niedenführ, S., Deisenroth, M. P. & Misener, R. GPdoemd: a Python package for design of experiments for model discrimination. Comput. Chem. Eng. 125, 54–70 (2019).
Krivák, R., Hoksza, D. & Škoda, P. Improving quality of ligand-binding site prediction with Bayesian optimization. In 2017 IEEE International Conference on Bioinformatics and Biomedicine 2278–2279 (2017).
Reker, D., Hoyt, E. A., Bernardes, G. J. L. & Rodrigues, T. Adaptive optimization of chemical reactions with minimal experimental information. Cell Rep. Phys. Sci. 1, 100247 (2020).
Zhou, Z., Li, X. & Zare, R. N. Optimizing chemical reactions with deep reinforcement learning. ACS Cent. Sci. 3, 1337–1344 (2017).
Kondo, M. et al. Exploration of flow reaction conditions using machine-learning for enantioselective organocatalyzed Rauhut–Currier and [3+2] annulation sequence. Chem. Commun. 56, 1259–1262 (2020); correction 56, 12256–12256 (2020).
Ueno, T., Rhone, T. D., Hou, Z., Mizoguchi, T. & Tsuda, K. COMBO: an efficient Bayesian optimization library for materials science. Mater. Discov. 4, 18–21 (2016).
Gardner, J., Pleiss, G., Weinberger, K. Q., Bindel, D. & Wilson, A. G. GPyTorch: blackbox matrix–matrix Gaussian process inference with GPU acceleration. In Advances in Neural Information Processing Systems Vol. 31 (eds Bengio, S. et al.) 7576–7586 (Curran Associates Inc., 2018).
Mockus, J. On the Bayes methods for seeking the extremal point. IFAC Proc. 8, 428–431 (1975).
Perera, D. et al. A platform for automated nanomole-scale reaction screening and micromole-scale synthesis in flow. Science 359, 429–434 (2018).
Ahneman, D. T., Estrada, J. G., Lin, S., Dreher, S. D. & Doyle, A. G. Predicting reaction performance in C–N cross-coupling using machine learning. Science 360, 186–190 (2018).
Moriwaki, H., Tian, Y.-S., Kawashita, N. & Takagi, T. Mordred: a molecular descriptor calculator. J. Cheminform. 10, 4 (2018).
Biau, G. Analysis of a random forests model. J. Mach. Learn. Res. 13, 1063–1095 (2012).
Rasmussen, C. E. & Williams, C. K. I. Gaussian Processes for Machine Learning (MIT Press, 2006).
Pedregosa, F. et al. Scikit-learn: machine learning in Python. J. Mach. Learn. Res. 12, 2825–2830 (2011); https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.RandomForestRegressor.html
Reker, D. & Schneider, G. Active-learning strategies in computer-assisted drug discovery. Drug Discov. Today 20, 458–465 (2015).
Jones, D. R., Schonlau, M. & Welch, W. J. Efficient global optimization of expensive black-box functions. J. Glob. Optim. 13, 455–492 (1998).
Kandasamy, K., Krishnamurthy, A., Schneider, J. & Poczos, B. Parallelised Bayesian optimisation via Thompson sampling. In International Conference on Artificial Intelligence and Statistics 133–142 (2018).
Hernández-Lobato, J. M., Requeima, J., Pyzer-Knapp, E. O. & Aspuru-Guzik, A. Parallel and distributed Thompson sampling for large-scale accelerated exploration of chemical space. Preprint at https://arxiv.org/abs/1706.01825 (2017).
Ginsbourger, D., Le Riche, R. & Carraro, L. in Computational Intelligence in Expensive Optimization Problems (eds Tenne, Y. & Goh, C.-K.) 131–162 (Springer, 2010).
Wang, J., Clark, S. C., Liu, E. & Frazier, P. I. Parallel Bayesian global optimization of expensive functions. Oper. Res. 68, 1850–1865 (2020).
Surowiec, I. et al. Generalized subset designs in analytical chemistry. Anal. Chem. 89, 6491–6497 (2017).
Davies, H. M. L. & Morton, D. Recent advances in C–H functionalization. J. Org. Chem. 81, 343–350 (2016).
Lyons, T. W. & Sanford, M. S. Palladium-catalyzed ligand-directed C−H functionalization reactions. Chem. Rev. 110, 1147–1169 (2010).
Alberico, D., Scott, M. E. & Lautens, M. Aryl−aryl bond formation by transition-metal-catalyzed direct arylation. Chem. Rev. 107, 174–238 (2007).
Vitaku, E., Smith, D. T. & Njardarson, J. T. Analysis of the structural diversity, substitution patterns, and frequency of nitrogen heterocycles among U.S. FDA approved pharmaceuticals. J. Med. Chem. 57, 10257–10274 (2014).
Fox, R. J. et al. C–H Arylation in the formation of a complex pyrrolopyridine, the commercial synthesis of the potent JAK2 inhibitor, BMS-911543. J. Org. Chem. 84, 4661–4669 (2019).
Ji, Y. et al. Mono-oxidation of bidentate bis-phosphines in catalyst activation: kinetic and mechanistic studies of a Pd/xantphos-catalyzed C–H functionalization. J. Am. Chem. Soc. 137, 13272–13281 (2015).
Durand, D. J. & Fey, N. Computational ligand descriptors for catalyst design. Chem. Rev. 119, 6561–6594 (2019).
Duros, V. et al. Human versus robots in the discovery and crystallization of gigantic polyoxometalates. Angew. Chem. Int. Ed. 56, 10815–10820 (2017).
Swamy, K. C. K., Kumar, N. N. B., Balaraman, E. & Kumar, K. V. P. P. Mitsunobu and related reactions: advances and applications. Chem. Rev. 109, 2551–2651 (2009).
Mitsunobu, O. & Yamada, M. Preparation of esters of carboxylic and phosphoric acid via quaternary phosphonium salts. Bull. Chem. Soc. Jpn 40, 2380–2382 (1967).
Fletcher, S. The Mitsunobu reaction in the 21st century. Org. Chem. Front. 2, 739–752 (2015).
Gillis, E. P., Eastman, K. J., Hill, M. D., Donnelly, D. J. & Meanwell, N. A. Applications of fluorine in medicinal chemistry. J. Med. Chem. 58, 8315–8359 (2015).
Hagmann, W. K. The many roles for fluorine in medicinal chemistry. J. Med. Chem. 51, 4359–4369 (2008).
Hu, W.-L., Hu, X.-G. & Hunter, L. Recent developments in the deoxyfluorination of alcohols and phenols: new reagents, mechanistic insights, and applications. Synthesis 49, 4917–4930 (2017).
Nielsen, M. K., Ahneman, D. T., Riera, O. & Doyle, A. G. Deoxyfluorination with sulfonyl fluorides: navigating reaction space with machine learning. J. Am. Chem. Soc. 140, 5004–5008 (2018).
Nielsen, M. K., Ugaz, C. R., Li, W. & Doyle, A. G. PyFluor: a low-cost, stable, and selective deoxyfluorination reagent. J. Am. Chem. Soc. 137, 9571–9574 (2015).
O’Boyle, N. M. et al. Open Babel: an open chemical toolbox. J. Cheminform. 3, 33 (2011).
Frisch, M. J. et al. Gaussian 16 Revision A.03 (Gaussian, Inc., 2016).
Kingma, D. P. & Ba, J. Adam: a method for stochastic optimization. Preprint at https://arxiv.org/abs/1412.6980 (2017).
Paszke, A. et al. PyTorch: an imperative style, high-performance deep learning library. In Advances in Neural Information Processing Systems Vol. 32 (eds Wallach, H. et al.) 8026–8037 (Curran Associates Inc., 2019).
Financial support was provided by Bristol-Myers Squibb, the Princeton Catalysis Initiative, the NSF under the CCI Center for Computer Assisted Synthesis (CHE-1925607) and the DataX Program at Princeton University through support from the Schmidt Futures Foundation. We thank A. Żurański and J. Ash for discussions. We thank all the participants in the reaction optimization game for their time and effort in contributing to this study. We thank B. Hao for help with HTE protocols.
The authors declare no competing interests.
Peer review information Nature thanks Jason Hein and Tiago Rodrigues for their contribution to the peer review of this work. Peer reviewer reports are available.
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Extended data figures and tables
About this article
Cite this article
Shields, B.J., Stevens, J., Li, J. et al. Bayesian reaction optimization as a tool for chemical synthesis. Nature 590, 89–96 (2021). https://doi.org/10.1038/s41586-021-03213-y
Nature Computational Science (2021)
Nature Reviews Chemistry (2021)