Reaction classification and yield prediction using the differential reaction fingerprint DRFP

Daniel Probst, Philippe Schwaller, Jean‐Louis Reymond

Abstract

Predicting the nature and outcome of reactions using computational methods is a crucial tool to accelerate chemical research. The recent application of deep learning-based learned fingerprints to reaction classification and reaction yield prediction has shown an impressive increase in performance compared to previous methods such as DFT- and structure-based fingerprints. However, learned fingerprints require large training data sets, are inherently biased, and are based on complex deep learning architectures. Here we present the differential reaction fingerprint DRFP. The DRFP algorithm takes a reaction SMILES as an input and creates a binary fingerprint based on the symmetric difference of two sets containing the circular molecular n-grams generated from the molecules listed left and right from the reaction arrow, respectively, without the need for distinguishing between reactants and reagents. We show that DRFP performs better than DFT-based fingerprints in reaction yield prediction and other structure-based fingerprints in reaction classification, reaching the performance of state-of-the-art learned fingerprints in both tasks while being data-independent.

Introduction

In the field of computational chemistry, predicting reaction types and yields is a fundamental challenge. Recently, deep-learning models like Transformers have set new benchmarks in this space. However, these "learned fingerprints" come with significant overhead: they require massive datasets, high-performance GPUs, and often rely on "atom-mapping"—a computationally expensive process of tracking every atom's path from reactant to product.

Daniel Probst and the Reymond group at the University of Bern have introduced the Differential Reaction Fingerprint (DRFP) to address these limitations. DRFP is a purely algorithmic, data-independent approach that achieves state-of-the-art performance without the complexity of deep learning or the need for atom-mapping.

Conceptual illustration of reaction data processing as featured in Digital Discovery.

Methodology: The DRFP Algorithm

The DRFP algorithm is designed to be simple and robust, following a four-step process to encode chemical transformations:

  1. Extraction: The algorithm takes a reaction SMILES string and extracts "circular $n$-grams" (molecular fragments with radii from 0 to 3).
  2. Set Formation: It generates two sets of fragments: one for the left side of the reaction (reactants and reagents) and one for the right side (products). By treating all non-product molecules as a single set, it avoids errors stemming from inconsistent labeling of "reactants" vs. "reagents."
  3. Symmetric Difference: This is the core innovation. By calculating the symmetric difference ($R \Delta P$) between the two sets, the algorithm isolates fragments that appear or disappear during the reaction. This mathematically captures the essence of the chemical change.
  4. Hashing and Folding: These fragments are hashed into integers and folded into a fixed-length binary vector (typically 2048 bits), compatible with standard machine learning models like Random Forests, XGBoost, or Multi-Layer Perceptrons (MLP).

Experimental Setup and Datasets

The authors validated DRFP against several industry-standard benchmarks:

  • Reaction Classification: Tested on the USPTO 1k TPL (1,000 template classes) and the Schneider 50k (50 reaction classes) datasets.
  • Yield Prediction: Evaluated using the Buchwald–Hartwig dataset (4,608 palladium-catalyzed reactions) and a Suzuki–Miyaura dataset.
  • Scalability: Benchmarked on USPTO yield data across different reaction scales (gram vs. sub-gram) to test handling of varying reaction conditions.

Key Results

DRFP demonstrated performance comparable to or exceeding much more complex models:

  • High Accuracy in Classification: On the USPTO 1k TPL set, DRFP paired with an MLP achieved 97.7% accuracy, nearly matching the state-of-the-art RXNFP (98.9%) and significantly outperforming traditional structural fingerprints (80.9%).
  • Superior Yield Prediction: In the Buchwald–Hartwig challenge, DRFP (using XGBoost) achieved an average $R^2$ of 0.786, outperforming physics-based DFT descriptors (0.75) and matching Yield-BERT.
  • Efficiency in Low-Data Regimes: DRFP maintained higher accuracy than learned models when training data was scarce (e.g., at 1% or 10% of the full dataset), highlighting its robustness for niche chemical domains.

Discussion and Insights

The success of DRFP suggests that the complexity required for chemical prediction may lie in the classification/regression step rather than the fingerprinting step. By focusing on the mathematical "bag of changes," DRFP bypasses the need for expensive atom-mapping and massive pre-training.

Its data-independent nature makes it an ideal tool for researchers working with small or specialized datasets where deep learning models might fail due to bias or lack of training data. Furthermore, as a "green" alternative, it requires far less computational power than training large-scale Transformer models.

Limitations and Future Outlook

A notable limitation is directionality: the symmetric difference operation is commutative, meaning $A + B \rightarrow C$ and $C \rightarrow A + B$ produce the same fingerprint. While reaction context often clarifies the direction, future iterations might incorporate directional encoding for equilibrium studies. Additionally, while DRFP captures stereochemistry via SMILES, it may not fully capture the 3D spatial nuances targeted by geometric deep learning models.

In conclusion, DRFP provides a high-performance, accessible, and interpretable alternative to "black box" AI models, proving that elegant mathematical tools can often match the power of massive neural networks in chemical informatics.

Paper Details: Digital Discovery, 2022, 1, 91-97. DOI: 10.1039/d1dd00006c. Code Availability: Available as a Python package (drfp) on GitHub.

Summary updated

BibTeX
@inproceedings{probst2022reaction,
  author = {Daniel Probst and Philippe Schwaller and Jean‐Louis Reymond},
  title = {{Reaction classification and yield prediction using the differential reaction fingerprint DRFP}},
  booktitle = {Digital},
  year = {2022},
  doi = {10.1039/d1dd00006c},
}
Figure