Abstract
Predicting chemical reaction yields is a cornerstone of computer-aided synthesis planning but is frequently hampered by the high cost of data acquisition and the vastness of chemical space. We present MetaRF, a differentiable Random Forest framework that leverages meta-learning for few-shot yield prediction. By integrating an attention mechanism to weight decision trees and employing Model Agnostic Meta-Learning (MAML), MetaRF adapts to new chemical reagents with as few as five experimental trials. Our approach significantly outperforms traditional machine learning baselines across multiple high-throughput experimentation datasets, offering a robust solution for out-of-distribution chemical yield prediction.
Introduction
In drug discovery and organic chemistry, knowing if a reaction will produce a high yield is as critical as knowing the synthetic pathway itself. However, predicting yields is notoriously difficult because experimental data is expensive to collect, and standard machine learning models typically require thousands of samples to achieve accuracy. When a chemist introduces a "new chemical space"—such as a reagent or condition never seen by the model—standard models often fail due to out-of-distribution (OOD) errors. MetaRF addresses this by utilizing few-shot learning, enabling a model to learn the behavior of a new reagent from just a handful of experimental samples.
Methodology
The MetaRF framework consists of three integrated components designed to maximize learning efficiency from minimal data:
- Reaction Encoding: Chemical components (aryl halides, catalysts, additives, etc.) are converted into numerical vectors using Density Functional Theory (DFT) descriptors. These descriptors capture essential molecular, atomic, and vibrational properties, providing the model with foundational chemical insight.
- Differentiable Random Forest (MetaRF): Traditional Random Forests are non-differentiable, making them incompatible with gradient-based meta-learning. MetaRF overcomes this by treating the ensemble as a collection of fixed decision trees and adding an attention mechanism to assign weights to these trees. Using Model Agnostic Meta-Learning (MAML), the model optimizes these weights to create a starting state that can be rapidly fine-tuned for specific new reagents.
- Dimension-Reduction Based Sampling: To optimize the utility of the limited "shots" available, the framework employs TSNE for dimensionality reduction followed by the Kennard-Stone (KS) algorithm. This ensures that the few samples selected for experimental testing are the most representative and diverse within the chemical space.
Experimental Setup and Datasets
The model was rigorously evaluated on three prominent chemical datasets to test its versatility:
- Buchwald–Hartwig HTE: A high-throughput dataset containing 3,955 palladium-catalyzed cross-coupling reactions.
- Buchwald–Hartwig ELN: A sparse, "real-world" dataset of 781 reactions derived from AstraZeneca’s electronic laboratory notebooks.
- Suzuki–Miyaura HTE: A dataset of 5,760 reactions used to demonstrate generalization across different reaction types.
Key Results
MetaRF demonstrates superior efficiency and accuracy compared to standard Random Forest baselines, particularly in data-scarce scenarios. On the Buchwald-Hartwig HTE dataset, MetaRF achieved an $R^2$ of 0.648 using only 2.5% of the available data. In contrast, a standard Random Forest required 20% of the data to reach a comparable accuracy level ($R^2 = 0.654$).
Furthermore, MetaRF excels at high-yield discovery. When identifying the top 10 reactions for a new reagent, MetaRF’s selections yielded an average of 93.7%, nearing the theoretical ideal of 95.5%, while the baseline model only reached 86.3%. The model also showed a consistent 20% improvement in Root Mean Square Error (RMSE) over the baseline when fine-tuning with 4 to 10 samples, proving that smart sampling combined with meta-learning is critical for OOD adaptation.
Conclusion and Future Work
MetaRF bridges the gap between the robustness of classical ensemble methods and the adaptability of modern meta-learning. By making ensemble weighting differentiable, the authors have created a tool that allows chemists to specialize a model for a new reagent in seconds. Future research may extend this methodology to other low-data chemical challenges, such as predicting enantioselectivity or optimizing conditions for entirely novel classes of molecules. While currently focused on cross-coupling, the framework's success suggests broad applicability across the chemical sciences.
Summary updated