Abstract
Chemical reaction data is a pivotal asset, driving advances in competitive fields such as pharmaceuticals, materials science, and industrial chemistry. Its proprietary nature renders it sensitive, as it often includes confidential insights and competitive advantages organizations strive to protect. However, in contrast to this need for confidentiality, the current standard training paradigm for machine learning-based retrosynthesis gathers reaction data from multiple sources into one single edge to train prediction models. This paradigm poses considerable privacy risks as it necessitates broad data availability across organizational boundaries and frequent data transmission between entities, potentially exposing proprietary information to unauthorized access or interception during storage and transfer. In the present study, we introduce the chemical knowledge-informed framework (CKIF), a privacy-preserving approach for learning retrosynthesis models. CKIF enables distributed training across multiple chemical organizations without compromising the confidentiality of proprietary reaction data. Instead of gathering raw reaction data, CKIF learns retrosynthesis models through iterative, chemical knowledge-informed aggregation of model parameters. In particular, the chemical properties of predicted reactants are leveraged to quantitatively assess the observable behaviors of individual models, which in turn determines the adaptive weights used for model aggregation. On a variety of reaction datasets, CKIF outperforms several strong baselines by a clear margin.
Subject terms: Chemical synthesis, Automation
Data islands in chemical domain pose a barrier to leveraging AI for synthesis design. Here, authors present a chemical knowledge-informed AI method enabling organisations to collaboratively train retrosynthesis models without sharing raw data.
Introduction
Retrosynthesis is a fundamental technique in organic chemistry that involves designing synthetic routes for a target molecule by working backwards from the desired product to commercially available starting materials. It is of great importance as it allows chemists to discover novel reactions for scarce or even brand-new molecules, optimize existing synthesis pathways, and circumvent processes that are costly, risky, and time-consuming1,2.
There are three main types of methods for learning retrosynthesis models. Template-based methods rely on reaction templates that specify how a target molecule can be transformed into reactants by applying certain rules3. Reaction templates can be either manually encoded by experts4 or automatically extracted from large reaction databases5–9. Template-based methods use subgraph isomorphism to match a target molecule with a suitable template and then apply the template rules to generate reactants. This process can be repeated until feasible synthetic routes are found. Template-free methods, implemented in an end-to-end fashion, treat retrosynthesis as a sequence to sequence problem and use generative models to directly generate a sequence of reactants from a target molecule without using any templates or rules. The sequence can be represented by different formats, such as simplified molecular input line entry system (SMILES) tokens10–15 or graph edit actions16–18, depending on the representation of molecules. Semi-template methods combine template-based and template-free methods by dividing retrosynthesis into two steps: reaction center identification and synthon completion19. Reaction center identification aims to find the atoms or bonds that are involved in the reaction, while synthon completion is devised to add the necessary atoms or groups to complete the reactants. Semi-template methods use machine learning (ML) models to predict the reaction centers and then use templates or other methods to complete the synthons20–23. In a nutshell, all the existing methods follow the same paradigm — gathering raw reaction data and training prediction models on it.
This reliance on data, however, presents significant challenges to developing ML models for retrosynthesis. Chief among these is the necessity for extensive chemical reaction datasets24, the compilation of which entails considerable expense. This expense arises from the requirement for specialized equipment, skilled labor, and material resources, as well as the conversion of unstructured records into structured data. While a limited number of chemical reaction datasets are available open source25,26, the majority are proprietary, maintained by commercial entities27–29. Furthermore, companies may develop new chemical reactions crucial for advancing key fields (e.g., materials30,31, drugs32, and energy solutions33,34), but are often hesitant to share this data. This proprietary stance is primarily due to two reasons. On the one hand, reaction data is often sensitive and confidential, as it may reveal proprietary or classified information that belongs to a specific entity or organization35,36. For example, a pharmaceutical company may want to protect its findings that leads to the synthesis of a new drug, or a government agency may want to safeguard its reaction data that relates to their future development. On the other hand, reaction data is often valuable and competitive37,38, which may confer an advantage or disadvantage to a certain entity or organization. For instance, a rival company may want to gain insight into the developed reactions of its competitors to gain an edge in the market, or a hostile state may want to access the frequently used reactions of its adversary to prepare for competitions in advance.
As aforementioned, only a limited number of retrosynthesis datasets are available openly, and sharing chemical reaction data with external parties might expose sensitive information (products, processes, intellectual property, etc.), which may cause compromised interests and unfair competition. This often leads to the emergence of “data islands” where data collected in different organizations remains siloed and inaccessible to the broader research community. Such fragmentation impedes progress significantly, as the collective benefit of shared insights is lost, slowing the pace of scientific discovery and application. Therefore, there is a pressing need to develop frameworks for privacy-preserving retrosynthesis learning that enable the sharing of valuable knowledge without compromising proprietary information. Developing such frameworks would facilitate a collaborative environment conducive to the advancement of retrosynthesis while addressing both privacy and competitive concerns. Despite its clear benefits for the scientific community and societal good, this area remains surprisingly under-explored in the existing literature. From an ML perspective, the current standard training paradigm for data-driven retrosynthesis models is to use one global model trained on a large dataset, i.e., learning with centralized data6,8,14,19,21,39. Nonetheless, this straightforward training regime has two major flaws. Firstly, its performance is limited by the availability, amount, and diversity of annotated reaction data which might be sensitive or proprietary. Secondly, one single global model may not capture the specific characteristics or preferences of each chemical entity, leading to suboptimal prediction performance40,41.
To address these challenges, we propose CKIF (chemical knowledge-informed framework), a privacy-preserving learning framework that enables collaborative learning among chemical entities without sharing raw reaction data. During the learning process, CKIF maintains data anonymity and only the model parameters are communicated. In terms of data heterogeneity (e.g., different data distributions caused by research focuses and industrial interests), CKIF further investigates the distributed learning paradigm from a client-centric perspective41,42 and thus learns a personalized model for each client. This necessitates the assessment of a model’s effectiveness for different clients, as such evaluations can provide dependable guidance to obtain personalized models. In response, CKIF is equipped with a chemical knowledge-informed weighting (CKIW) strategy that harnesses symbolic knowledge representations — specifically, molecule fingerprints like extended-connectivity fingerprint (ECFP)43 and molecular access system (MACCS) keys44. This strategy adaptively adjusts weights during model aggregation to better align the model with the specific preferences of each chemical entity. Experiments on a variety of reaction datasets demonstrate that CKIF outperforms locally trained models, and even models trained on centralized data. In a nutshell, CKIF ensures data privacy and enhances efficiency by distributing computations across multiple clients. It also supports the training of personalized models for each client and leverages reaction data from diverse clients for scalable model training. These benefits make CKIF a feasible and cost-effective approach to advancing retrosynthesis research in a privacy-aware setting.
To summarize, this study underscores the critical need for privacy-aware frameworks in retrosynthesis learning by presenting the first systematic investigation of privacy-preserving methodologies in this domain. We introduce a holistic evaluation framework encompassing curated dataset assembly, rigorous experimental protocols, and benchmarking of mainstream algorithms. To foster transparency and community-driven advancements, the entire codebase is open-sourced. Methodologically, we devise a chemical knowledge-informed weighting strategy that dynamically assigns adaptive weights to evaluate the relevance of external client models, enhancing collaboration efficiency. By fusing domain-specific insights with federated learning principles, this work strengthens the technical groundwork for decentralized retrosynthesis research and promotes responsible data handling. Amidst a global climate of increasing scrutiny over international data sharing, exemplified by recent security directives in fields like healthcare, CKIF’s privacy-preserving approach is particularly timely.
Results
Privacy-aware retrosynthesis with CKIF
We prioritize the privacy of chemical reaction data by ensuring that sensitive information is not shared among participants. Instead of gathering raw reaction data into one single edge, CKIF supports distributed model training through the sharing of processed, non-sensitive chemical knowledge (i.e., model parameters) derived from reaction data. CKIF operates through iterative communication rounds, each comprising two stages: local learning and chemical knowledge-informed model aggregation. During local learning, clients independently train their models on proprietary reaction data, initializing from either random value in the first round or from their personalized aggregated model from the previous communication round. In the aggregation stage, clients exchange trained model parameters to leverage collective knowledge while maintaining data privacy. The core of CKIF is its CKIW strategy, which replaces conventional fixed-weight averaging methods. When a client receives models from other participants, it evaluates their relevance using local proxy reaction data and molecular fingerprint similarity metrics. Specifically, each client computes similarities between reactants predicted by other clients’ models and ground truth reactants using molecular fingerprints, generating adaptive weights that quantify the value of other clients’ models for its specific learning objectives. These chemistry-aware weights guide model aggregation, creating personalized models that reflect each client’s preference while benefiting from the collective knowledge of all participants.
Improvements with CKIF
We evaluate the performance of CKIF on a variety of reaction datasets. Top-K accuracy, which indicates the proportion of ground truth reactants that appear in (exactly matched) the top-K confident predicted reactants, is used for evaluation. Two additional metrics also reported to comprehensively evaluate models’ performance. The first is Maximal fragment (MaxFrag) accuracy11,15, a relaxed version of top-K accuracy, which focuses on main compound transformations. The second is RoundTrip accuracy9,14, which evaluates whether the predicted reactants can indeed synthesize the target product by utilizing a pre-trained forward synthesis model as an oracle. Tables 1, 2, and 3 report the aforementioned evaluation metrics of different methods, namely, Locally Trained (models trained on their single local dataset, see Fig. 1a), Centrally Trained (a single global model trained on all reaction datasets combined, see Fig. 1b), FedAvg45 (a strong, commonly-used federated baseline), and our proposed method, CKIF (which explicitly models the personalized target distribution for each client, and uses chemical knowledge-informed model aggregation to learn personalized models, see Fig. 1c, d). Retrosynthesis learning, as a seq2seq problem, poses unique challenges that limit the direct applicability of many state-of-the-art (SOTA) federated learning methods, which are often designed for classification or regression tasks46. We selected FedAvg as our primary baseline due to its proven efficacy in seq2seq contexts47, and its widespread adoption in both academic and industrial settings. In addition, adapting other SOTA methods to seq2seq tasks would require significant re-engineering, potentially introducing unfair comparisons. Note that Centrally Trained with full access to all reaction data may bring significant privacy concerns.
Table 1.
Top-K retrosynthesis accuracy (%) on the USPTO-50K dataset
| Client | Method | K = 1 | 3 | 5 | 10 | 1 (MF) | 3 | 5 | 10 | 1 (RT) |
|---|---|---|---|---|---|---|---|---|---|---|
| C1 | Locally Trained | 41.9 | 57.1 | 65.0 | 69.8 | 56.8 | 69.7 | 73.4 | 75.5 | 51.0 |
| Centrally Trained | 40.1 | 58.8 | 69.1 | 73.9 | 51.0 | 68.2 | 76.1 | 79.4 | 59.2 | |
| FedAvg45 | 15.0 | 30.9 | 37.2 | 40.8 | 19.2 | 38.3 | 45.0 | 48.7 | 30.3 | |
| CKIF (Ours) | 43.9 | 60.2 | 67.1 | 70.3 | 56.5 | 71.1 | 76.3 | 78.0 | 51.2 | |
| C2 | Locally Trained | 4.1 | 8.6 | 9.2 | 11.1 | 13.8 | 18.2 | 19.4 | 21.5 | 6.9 |
| Centrally Trained | 19.0 | 28.6 | 33.7 | 37.0 | 27.2 | 40.4 | 43.9 | 47.8 | 52.6 | |
| FedAvg45 | 0.0 | 0.4 | 0.9 | 1.2 | 0.2 | 1.1 | 2.1 | 2.8 | 16.4 | |
| CKIF (Ours) | 23.6 | 33.3 | 37.6 | 40.0 | 36.7 | 46.9 | 50.6 | 52.7 | 41.3 | |
| C3 | Locally Trained | 28.0 | 41.6 | 46.1 | 47.7 | 29.9 | 43.2 | 47.3 | 48.6 | 30.7 |
| Centrally Trained | 23.6 | 39.5 | 45.3 | 49.0 | 24.0 | 40.6 | 46.8 | 50.5 | 46.9 | |
| FedAvg45 | 12.7 | 23.2 | 27.2 | 28.7 | 12.8 | 23.7 | 27.5 | 29.1 | 27.8 | |
| CKIF (Ours) | 30.9 | 47.4 | 52.9 | 55.5 | 32.3 | 48.7 | 54.0 | 56.6 | 35.9 | |
| C4 | Locally Trained | 37.1 | 49.9 | 54.9 | 56.9 | 39.1 | 51.7 | 57.0 | 58.9 | 40.2 |
| Centrally Trained | 39.3 | 58.3 | 65.5 | 70.6 | 42.3 | 61.0 | 68.0 | 72.0 | 50.7 | |
| FedAvg45 | 12.3 | 29.0 | 35.3 | 37.9 | 13.2 | 30.8 | 37.2 | 40.5 | 27.2 | |
| CKIF (Ours) | 39.4 | 55.3 | 60.9 | 63.2 | 41.1 | 57.1 | 62.5 | 64.4 | 43.7 |
Note that Centrally Trained gathers all reaction data and the comparison is unfair. Bold values indicate the best results among Locally Trained, FedAvg45, and CKIF (chemical knowledge-informed framework). MF and RT denote MaxFrag accuracy and RoundTrip accuracy, respectively.
Table 2.
Top-K retrosynthesis accuracy (%) on the USPTO-50K and USPTO-MIT dataset
| Client | Method | K = 1 | 3 | 5 | 10 | 1 (MF) | 3 | 5 | 10 | 1 (RT) |
|---|---|---|---|---|---|---|---|---|---|---|
| C1 | Locally Trained | 41.9 | 57.1 | 65.0 | 69.8 | 56.8 | 69.7 | 73.4 | 75.5 | 51.0 |
| Centrally Trained | 30.8 | 47.5 | 56.1 | 65.1 | 39.5 | 57.3 | 66.0 | 74.0 | 57.1 | |
| FedAvg45 | 14.1 | 31.0 | 39.8 | 45.4 | 18.6 | 40.0 | 49.8 | 55.5 | 31.9 | |
| CKIF (Ours) | 44.2 | 64.5 | 72.4 | 77.0 | 58.7 | 76.1 | 80.7 | 82.8 | 57.1 | |
| C2 | Locally Trained | 4.1 | 8.6 | 9.2 | 11.1 | 13.8 | 18.2 | 19.4 | 21.5 | 6.9 |
| Centrally Trained | 18.0 | 33.5 | 39.0 | 45.5 | 30.2 | 48.1 | 54.5 | 60.0 | 54.9 | |
| FedAvg45 | 15.5 | 39.8 | 48.8 | 56.6 | 18.8 | 48.8 | 57.1 | 64.3 | 19.9 | |
| CKIF (Ours) | 30.7 | 43.6 | 48.9 | 52.6 | 42.2 | 57.0 | 61.6 | 64.0 | 51.1 | |
| C3 | Locally Trained | 28.0 | 41.6 | 46.1 | 47.7 | 29.9 | 43.2 | 47.3 | 48.6 | 30.7 |
| Centrally Trained | 18.0 | 36.0 | 43.3 | 48.4 | 18.6 | 36.6 | 44.4 | 49.4 | 52.3 | |
| FedAvg45 | 1.6 | 5.3 | 7.1 | 9.5 | 2.6 | 7.9 | 10.4 | 13.9 | 37.2 | |
| CKIF (Ours) | 36.9 | 56.5 | 62.4 | 64.8 | 38.4 | 57.6 | 63.3 | 65.8 | 40.2 | |
| C4 | Locally Trained | 37.1 | 49.9 | 54.9 | 56.9 | 39.1 | 51.7 | 57.0 | 58.9 | 30.7 |
| Centrally Trained | 20.4 | 33.0 | 40.3 | 46.6 | 23.7 | 37.4 | 45.0 | 49.5 | 52.3 | |
| FedAvg45 | 15.3 | 32.5 | 38.7 | 42.0 | 15.3 | 32.7 | 38.9 | 42.5 | 37.2 | |
| CKIF (Ours) | 40.9 | 58.7 | 63.4 | 67.1 | 42.2 | 60.7 | 64.8 | 68.3 | 47.7 | |
| C5 | Locally Trained | 36.5 | 51.8 | 59.0 | 63.9 | 50.1 | 63.9 | 68.7 | 71.4 | 55.5 |
| Centrally Trained | 23.2 | 36.0 | 42.8 | 48.7 | 30.9 | 45.5 | 52.8 | 59.3 | 53.4 | |
| FedAvg45 | 13.0 | 29.0 | 34.8 | 41.4 | 14.5 | 31.8 | 38.2 | 44.5 | 35.8 | |
| CKIF (Ours) | 34.6 | 53.2 | 62.6 | 67.5 | 48.5 | 65.3 | 72.0 | 74.7 | 56.9 | |
| C6 | Locally Trained | 11.7 | 17.8 | 20.5 | 22.5 | 19.3 | 27.2 | 29.6 | 31.6 | 0.0 |
| Centrally Trained | 18.7 | 31.9 | 36.7 | 42.0 | 26.6 | 40.2 | 45.1 | 50.1 | 0.6 | |
| FedAvg45 | 10.5 | 24.7 | 30.5 | 34.8 | 13.0 | 31.6 | 37.6 | 42.4 | 0.6 | |
| CKIF (Ours) | 21.7 | 33.3 | 38.2 | 42.1 | 28.9 | 40.3 | 45.2 | 48.8 | 0.6 | |
| C7 | Locally Trained | 20.6 | 29.0 | 32.6 | 34.5 | 27.5 | 36.2 | 39.4 | 40.9 | 22.9 |
| Centrally Trained | 21.8 | 34.4 | 39.8 | 43.7 | 27.2 | 41.6 | 46.7 | 50.6 | 45.6 | |
| FedAvg45 | 2.3 | 7.6 | 10.7 | 12.9 | 3.7 | 9.6 | 13.6 | 16.7 | 27.1 | |
| CKIF (Ours) | 35.8 | 49.4 | 54.2 | 57.7 | 44.5 | 56.4 | 60.9 | 63.5 | 40.6 | |
| C8 | Locally Trained | 18.3 | 25.7 | 29.9 | 31.5 | 25.8 | 34.1 | 37.0 | 38.5 | 30.4 |
| Centrally Trained | 27.7 | 41.6 | 47.7 | 51.8 | 33.2 | 49.2 | 55.1 | 58.7 | 69.6 | |
| FedAvg45 | 5.0 | 7.0 | 8.4 | 9.2 | 6.8 | 12.0 | 15.1 | 17.2 | 42.1 | |
| CKIF (Ours) | 25.9 | 38.0 | 43.2 | 46.4 | 32.0 | 45.8 | 50.1 | 52.5 | 56.2 |
Note that Centrally Trained gathers all reaction data and the comparison is unfair. Bold values indicate the best results among Locally Trained, FedAvg45, and CKIF (chemical knowledge-informed framework). Here MF and RT denote MaxFrag accuracy and RoundTrip accuracy, respectively. The low RoundTrip accuracy for C6 can be attributed to the used pre-trained forward synthesis model not having encountered C6’s reactions during training.
Table 3.
Top-K retrosynthesis accuracy (%) on the USPTO 1k TPL dataset
| Client | Method | K = 1 | 3 | 5 | 10 | 1 (MF) | 3 | 5 | 10 | 1 (RT) |
|---|---|---|---|---|---|---|---|---|---|---|
| C9 | Locally Trained | 53.8 | 67.4 | 73.3 | 76.6 | 63.1 | 74.3 | 78.5 | 80.0 | 53.1 |
| Centrally Trained | 50.8 | 71.0 | 80.1 | 86.3 | 58.2 | 77.6 | 84.7 | 88.9 | 69.5 | |
| FedAvg45 | 44.5 | 64.6 | 72.3 | 77.1 | 49.7 | 70.1 | 76.7 | 81.0 | 61.7 | |
| CKIF (Ours) | 63.5 | 77.6 | 85.2 | 88.7 | 70.3 | 83.7 | 88.7 | 90.6 | 63.5 | |
| C10 | Locally Trained | 60.4 | 72.2 | 76.9 | 79.4 | 66.4 | 76.9 | 80.1 | 81.7 | 53.3 |
| Centrally Trained | 31.9 | 54.1 | 64.3 | 70.8 | 44.2 | 65.7 | 74.9 | 80.1 | 67.0 | |
| FedAvg45 | 38.0 | 57.5 | 66.4 | 72.0 | 45.7 | 65.5 | 74.5 | 80.5 | 59.2 | |
| CKIF (Ours) | 66.6 | 80.2 | 86.3 | 90.3 | 71.4 | 85.0 | 89.0 | 91.4 | 63.5 | |
| C11 | Locally Trained | 55.5 | 65.9 | 70.7 | 73.5 | 61.7 | 71.4 | 74.5 | 75.7 | 48.2 |
| Centrally Trained | 40.7 | 61.0 | 70.3 | 76.2 | 50.3 | 69.3 | 75.9 | 79.9 | 66.3 | |
| FedAvg45 | 42.2 | 59.7 | 67.8 | 74.6 | 48.8 | 65.7 | 71.9 | 77.5 | 60.2 | |
| CKIF (Ours) | 62.0 | 76.1 | 84.5 | 87.9 | 69.8 | 82.4 | 87.5 | 89.2 | 63.3 | |
| C12 | Locally Trained | 55.8 | 69.2 | 73.5 | 76.0 | 62.4 | 73.8 | 77.5 | 79.3 | 51.1 |
| Centrally Trained | 33.9 | 54.6 | 65.6 | 72.7 | 43.7 | 64.2 | 72.7 | 77.4 | 63.0 | |
| FedAvg45 | 37.4 | 55.2 | 62.6 | 68.3 | 45.8 | 63.8 | 69.8 | 73.9 | 58.8 | |
| CKIF (Ours) | 58.7 | 75.3 | 83.9 | 87.7 | 66.1 | 81.4 | 87.4 | 89.3 | 61.0 | |
| C13 | Locally Trained | 56.4 | 69.7 | 75.9 | 79.0 | 63.5 | 75.3 | 78.9 | 81.0 | 51.9 |
| Centrally Trained | 40.7 | 62.1 | 72.2 | 77.8 | 49.1 | 68.8 | 76.7 | 80.7 | 66.5 | |
| FedAvg45 | 39.7 | 60.0 | 68.5 | 73.6 | 45.2 | 64.4 | 71.8 | 76.0 | 61.2 | |
| CKIF (Ours) | 64.2 | 78.6 | 86.1 | 89.3 | 71.5 | 83.9 | 88.7 | 90.6 | 62.1 | |
| C14 | Locally Trained | 53.6 | 66.1 | 71.2 | 74.8 | 62.1 | 71.6 | 75.6 | 77.6 | 45.4 |
| Centrally Trained | 54.1 | 73.1 | 83.5 | 89.3 | 63.2 | 81.0 | 87.8 | 91.5 | 61.5 | |
| FedAvg45 | 35.3 | 54.8 | 63.5 | 69.3 | 43.4 | 62.8 | 70.7 | 75.3 | 53.0 | |
| CKIF (Ours) | 61.5 | 76.7 | 83.1 | 87.5 | 69.5 | 82.1 | 87.1 | 89.1 | 55.0 | |
| C15 | Locally Trained | 55.8 | 69.2 | 73.9 | 76.5 | 63.4 | 74.6 | 78.1 | 79.5 | 52.2 |
| Centrally Trained | 59.0 | 77.4 | 89.9 | 96.0 | 68.2 | 87.0 | 94.5 | 96.4 | 72.3 | |
| FedAvg45 | 40.9 | 59.8 | 69.1 | 74.5 | 48.1 | 66.7 | 75.1 | 78.8 | 61.8 | |
| CKIF (Ours) | 61.2 | 77.1 | 87.3 | 91.1 | 70.7 | 84.2 | 90.2 | 92.2 | 64.3 | |
| C16 | Locally Trained | 54.0 | 67.3 | 74.8 | 78.5 | 63.8 | 75.8 | 80.0 | 82.3 | 49.9 |
| Centrally Trained | 56.5 | 75.9 | 86.0 | 91.8 | 66.2 | 83.7 | 90.3 | 93.1 | 67.4 | |
| FedAvg45 | 39.0 | 58.8 | 67.8 | 73.3 | 47.3 | 66.0 | 73.5 | 78.4 | 56.4 | |
| CKIF (Ours) | 62.6 | 76.9 | 86.2 | 89.8 | 70.2 | 84.0 | 89.8 | 91.4 | 61.0 |
Note that Centrally Trained gathers all reaction data and the comparison is unfair. Bold values indicate the best results among Locally Trained, FedAvg45, and CKIF (chemical knowledge-informed framework). Here MF and RT denote MaxFrag accuracy and RoundTrip accuracy, respectively.
Fig. 1. Overview of the existing training paradigms and the proposed CKIF (chemical knowledge-informed framework).
a Local learning involves individual clients training a model independently on their own reaction data, without interaction or data exchange with other clients. b Central learning trains a global model with access to reaction data from all clients. It is the current standard learning paradigm for retrosynthesis. Our privacy-preserving learning process operates through iterative communication rounds, each comprising two stages: local learning (c) and chemical knowledge-informed model aggregation (d). c In the first round, the model parameters are initialized randomly, while in subsequent communication rounds, they are initialized from the personalized aggregated model obtained in the previous round. d CKIF incorporates chemical knowledge, i.e., molecule fingerprints, to calculate adaptive weights based on the similarity of molecular fingerprints. These weights are used to guide the model aggregation process.
The experimental results in Table 1 evidence that CKIF consistently outperforms Locally Trained across four clients sampled from USPTO-50K dataset48. Taking client C2 as an example, Locally Trained performs poorly with an accuracy of 4.1% at K = 1, whereas CKIF shows a significant improvement, achieving an accuracy of 23.6%. This substantial enhancement suggests that the proposed CKIF effectively leverages the chemical knowledge-guided model aggregation to enhance the performance over the Locally Trained baseline. In addition, CKIF exhibits comparable or even superior performance compared to the centrally trained model in several cases. For example, CKIF outperforms Centrally Trained on client C3 by up to 8.8%. This highlights the potential of CKIF in leveraging the personalized target distribution and CKIW-based model aggregation compared to training a single global model on all reaction datasets combined. FedAvg, a strong baseline used in federated learning, treats all clients equally and aggregates updates from them to create a global model, ignoring personalized target distributions of each client. In contrast, CKIF explicitly models the non-independent and identically distributed nature for each client. As a result, CKIF demonstrates considerable performance advantages over FedAvg.
Scalability to number of clients
To investigate the effect of increasing the number of clients, we conduct experiments using eight clients sampled from USPTO-50K48 and USPTO-MIT49. The experimental results in Table 2 demonstrate that as the number of clients increases, the performance of all clients further improves, highlighting the scalability of CKIF. For example, CKIF achieves a top-1 accuracy of 30.9% with four participants and an improved one of 36.9% with eight participants in terms of C3. This finding suggests that the collaborative nature of CKIF enables the extraction of beneficial guidance from a larger pool of clients, leading to enhanced performance for all participating clients.
In addition, the experimental results reveal a counterintuitive decline in performance for Centrally Trained as data volume increases, challenging the common assumption that more data invariably improves performance50,51. We attribute this to three factors: lack of specialization, distribution mismatch, and bias towards majority reaction data. The centrally trained model, while capturing overall trends, may overlook client-specific characteristics. It also faces potential distribution mismatches between diverse training reaction data and distributions of individual chemical entities. In addition, reaction data from certain clients may dominate the training process, potentially biasing the model. In contrast, our CKIF maintains individual models for each client, explicitly modeling both global consistency and personalized preferences. Such a framework enables better alignment with client-specific data distributions, yielding improved performance.
Analysis of accuracy for different reaction types
In the realm of chemistry, reaction classes serve as invaluable tools for chemists to navigate vast databases of reactions and extract similar members within the same class for analysis and determination of optimal reaction conditions. Moreover, reaction classes offer a concise and efficient means of communication, enabling chemists to describe the functionality and underlying mechanisms of chemical reactions in terms of atomic rearrangements. USPTO-50K dataset provides high-quality annotations which assigns one of ten reaction classes to each reaction, facilitating further investigation into the performance gains associated with specific reaction classes. From the results shown in Fig. 2, we can observe that CKIF outperforms the Locally Trained and FedAvg baselines by a considerable margin among all reaction classes and achieves excellent results. Also, we find that C-C bond formation is the easiest to improve among the ten reaction classes, while heteroatom alkylation and arylation is the most challenging one. The reasons are two folds: 1) C-C bond formation has more diverse possibilities for choosing reactants and reactions than other reaction classes11, while the reaction data utilized by Locally Trained is insufficient to learn such transformations. 2) There are sufficient reaction data of heteroatom alkylation and arylation for Locally Trained to learn. Note that reaction classes are usually unknown in the real world, we do not utilize such information in all experiments as15.
Fig. 2. Comparative analysis of prediction performance for different reaction classes.
The figure shows the Top-10 accuracy of three methods (Locally Trained, FedAvg45, and CKIF) across 10 major classes of chemical transformations in the USPTO-50K dataset. The results demonstrate that CKIF (chemical knowledge-informed framework) outperforms the strong baseline by a considerable margin on all reaction types. Source data are provided as a Source Data file.
Scalability to number of training samples
Tables 1 and 2 demonstrate the effectiveness and scalability of the CKIF compared to several strong baselines. We can observe that some clients suffer from limited data volume, e.g., top-1 accuracy of 4.1% on C2. Such data scarcity problem can be mitigated with more reaction data in the same distribution. Although collecting data is expensive and time-consuming, one may wonder whether doing so can lead to better prediction performance. To gain insights into the performance gains of CKIF when clients have sufficient data volume and further validate scalability of CKIF, we conduct experiments on USPTO 1k TPL dataset52, where the clients have larger data volume.
From the experimental results in Table 3, we have the following findings: 1) With a sufficient volume of client data, all the methods, including Locally Trained, Centrally Trained, FedAvg, and CKIF, show impressive performance compared to previous experiments. This indicates that the availability of a larger volume of data allows models to learn sufficient underlying patterns so as to enhance their retrosynthesis prediction accuracy. 2) Despite considerable performance of Locally Trained models with sufficient client data, the experimental results show that CKIF can still further improve retrosynthesis accuracy. For instance, CKIF achieves an average performance improvement of + 6.9% and + 16.6% on top-1 accuracy compared to locally and centrally trained models, respectively. In a nutshell, the experimental results with larger data volume show that CKIF can further improve the performance even when clients have sufficient data volume to train their own personalized models. CKIF consistently outperforms the Locally Trained baseline and brings performance benefits to clients with both low and high data volumes. This reaffirms the scalability and effectiveness of CKIF in leveraging chemical knowledge and personalized target distribution for enhanced retrosynthesis accuracy.
Qualitative analysis
To compare the qualitative results of these strong baselines and CKIF, we showcase three reactions with their characteristics (reaction types), as depicted in Fig. 3. Experimental results indicate that CKIF consistently outperforms the other baselines and provides plausible synthesis routes. Taking the ring formation reaction (Fig. 3b) as an example, the ability of CKIF to comprehend the structural requirements for forming rings leads to correct predictions, while the other baselines struggle to predict the ring formation, resulting in incorrect reactants. The superior performance of CKIF highlights the efficacy of leveraging both local (personalized model for each client) and global (client-centric weighting strategy) information to achieve accurate retrosynthetic predictions in a privacy-aware setting.
Fig. 3. Qualitative comparison of retrosynthesis predictions by CKIF (chemical knowledge-informed framework), FedAvg45, Centrally Trained, and Locally Trained.
Representative examples are shown for retrosynthesis predictions on three distinct input products (a–c). For each case, the target product is displayed at the top, followed by the ground truth reactants and the predictions from four different methods. The examples are drawn from diverse datasets corresponding to different clients: (a) an acylation-related reaction from the USPTO-50K dataset (client C1), (b) a ring formation reaction from the USPTO-MIT dataset (client C7), and (c) a reaction from a mixed subset of the USPTO 1k TPL dataset (client C9). These results qualitatively demonstrate CKIF's superior accuracy and its ability to generalize across complex and varied reaction types. Different reactive sites are highlighted with different colors.
Analysis of the chemical knowledge-informed weighting strategy
To ascertain the effectiveness of our proposed CKIW strategy, we conducted a comparative analysis against a robust baseline: Average Aggregation, which uses average model aggregation instead of using the proposed chemical knowledge-informed model aggregation. The results shown in Fig. 4a demonstrate a significant enhancement; CKIF improved predictive accuracy by +0.93% in terms of average top-K accuracy. Given that this improvement is averaged over 16 metrics for 4 clients in USPTO-50K, it illustrates the considerable benefit of CKIF. This analysis highlights the substantial benefits of incorporating chemical knowledge into model aggregation, suggesting a powerful alternative to heuristic methods such as count-based model averaging.
Fig. 4. Ablative experiments on the USPTO-50K dataset.
a Performance comparison between the chemical knowledge-informed weighting (CKIW) strategy and the count-based averaging baseline (w/o CKIW). The y-axis represents the accuracy averaged across four clients (C1 - C4) and for K=1, 3, 5, and 10. b Trend in accuracy with increasing communication rounds. The y-axis represents the accuracy averaged across four clients (C1 - C4) and for K = 1, 3, 5, and 10. c Trend in accuracy for a single client (C2) as the number of clients participating in the federated learning process increases. For this panel, the y-axis represents the accuracy for Client 2, averaged for K=1, 3, 5, and 10. For all panels, the values of the individual top-K predictions are available in the Source Data file. Source data are provided as a Source Data file.
Sensitivity analysis
After verifying the effectiveness of CKIW, we conduct ablative experiments to assess the robustness of CKIF under varying learning settings. In particular, we explore the impact of two critical hyperparameters: the number of communication rounds and the number of clients. The resilience of CKIF to the number of communication rounds is tested with values set at 30, 35, 40, 45, and 50. The results, as illustrated in Fig. 4b, show a gradual improvement in model accuracy from 47.73% to 48.84% as the number of communication rounds increased. Similarly, we investigate the effect of varying the number of clients participating in the learning process. The configurations tested include 2, 3, and 4 clients, with corresponding accuracies of 13.85%, 24.65%, and 33.63% (Fig. 4c). This progression demonstrates a robust scaling behavior of CKIF as the network grows, highlighting its capability to harness chemical knowledge across more clients. These findings underscore the resilience and scalability of CKIF, affirming its effectiveness across diverse experimental settings.
Robustness analysis
The robustness of CKIF against contaminated client data is evaluated by investigating the scenario with contamination across all participating clients. Following Toniato et al.53, we simulate contamination (i.e., chemically wrong entries) by randomly exchanging reactants and products while shuffling SMILES tokens. To ensure fair comparison, the test split of all clients remains unchanged. Results (Fig. 5) demonstrate that CKIF maintains a significant performance advantage over Locally Trained models across varying contamination levels. Even with 5 ~ 10% contaminated data, CKIF might achieve comparable performance to that of Locally Trained models trained on clean data. The core reason is that CKIW dynamically adjusts each client’s contribution during model aggregation so as to mitigate the impact of contaminated data. These findings highlight CKIF’s inherent robustness to data contamination. Note that CKIF is not immune to malicious attacks such as data poisoning. While the comprehensive handling of contaminated client data and defense mechanisms against malicious attacks warrant thorough investigation, they extend beyond the scope of this work and are addressed in the Discussion section.
Fig. 5. Robustness of CKIF (chemical knowledge-informed framework) to data contamination across heterogeneous clients.
The figure shows a robustness analysis comparing the CKIF framework (dark blue) with the Locally Trained baseline (grey). The four panels show the performance of clients C1 (a), C2 (b), C3 (c), and C4 (d), respectively. The y-axis in each panel represents the accuracy averaged for K = 1, 3, 5, and 10 from a single run, while the values of the individual top-K predictions are available in the Source Data file. These results demonstrate that CKIF consistently outperforms Locally Trained for all clients and at every level of data contamination. Source data are provided as a Source Data file.
Discussion
As an essential skill for organic chemists, retrosynthesis requires expert knowledge, creativity, and intuition. In the modern era, chemical reaction data become a valuable asset across various scientific domains such as materials science, pharmaceuticals, and energy. However, sharing such data can expose trade secrets, violate patents, and lead to unfair competition or security compromises. To address these challenges, this paper introduces CKIF, a distributed machine learning framework that enables collaborative training without the need to exchange raw reaction data, thereby ensuring data privacy — a major concern in sensitive scientific domains. By leveraging the distributed and heterogeneous nature of reaction data sources, CKIF not only improves efficiency but also reduces communication overhead, latency, and bandwidth consumption. CKIF allows for the distribution of computation across multiple clients closer to data sources, enhancing parallelism and fault tolerance.
CKIF incorporates chemical symbolic knowledge in the form of molecule fingerprints to guide model aggregation, resulting in personalized models that enhance the accuracy and relevance of retrosynthesis predictions. This knowledge-based approach allows each participating chemical entity to benefit from the collective insights. In addition, empirical results suggest that CKIF’s performance improves with an increasing number of clients and training samples, showcasing CKIF’s scalability. By applying CKIF to retrosynthesis, one can expect the collaborative discovery and optimization of new chemical transformations from various and confidential data sources. Experiments on various experimental settings show that CKIF outperforms locally trained models (Locally Trained) and even those trained on centralized data (Centrally Trained). We hope that CKIF opens up new possibilities for advancing privacy-aware retrosynthesis and related fields. In addition, we aim to inspire more research on privacy-preserving ML methods for other scientific domains and applications.
Despite these strengths, our work has limitations that necessitate further exploration. First, CKIF’performance relies on the quality of local data from each chemical entity, which might vary significantly in practice. Second, the model aggregation based on chemical knowledge uses the same molecule fingerprints and measurements for all clients, which might not accurately capture the personalized target distribution of each client and might contain unintentional bias. Future work will explore customized molecule fingerprints or measurements that meet the unique needs of each client. Third, our evaluation metrics are focused on the validity and uniqueness of the generated synthetic routes, overlooking the practicality and feasibility of the synthesis in terms of cost, yield, and environmental impact.
During the privacy-aware learning process, each chemical entity trains their personalized models locally and only model parameters are communicated. However, this process is not immune to privacy threats, as malicious attackers can infer sensitive information from the model updates exchanged between the clients54,55, i.e., data representation leakage from gradients or models. Several methods have been proposed to address this essential issue of privacy leakage, such as encrypting the model updates or adding noise to them using differential privacy56,57. While addressing privacy leakage and other security concerns (such as data poisoning) remains an active research area58–62, our contribution is orthogonal to those defense developments. Defense methods, in principle, can be seamlessly incorporated into our framework.
Methods
Problem formulation
In the present study, we focus in particular on the challenge of learning retrosynthesis models in a privacy-aware setting where reaction data are proprietary and cannot be shared among chemical entities (clients) or with an external central server. To address this, CKIF is specifically designed to allow for the collaborative improvement of retrosynthesis models without sharing sensitive reaction data between participants. The collaboration occurs through multiple rounds of communication where only implicit and explicit chemical knowledge — rather than raw reaction data — is exchanged. Note that the term “privacy-aware” specifically refers to the prevention of raw data sharing — a fundamental requirement in collaborative retrosynthesis learning where reaction data cannot be directly exchanged between entities. This aligns with the minimal privacy definition widely adopted in applied FL studies63–65. For the retrosynthesis prediction task itself, we define it as the process of training a machine learning model (or hypothesis) that maps a target molecule to its corresponding precursors (i.e., reactants).
Privacy-aware model training
Transformer66 is adopted to learn a probabilistic mapping P(y∣x) from a given target molecule x to reactants y. Suppose there are a total of K clients, each possessing a local reaction dataset , where Ni denotes the number of reactions stored on the i-th client Ci. Our objective is to collaboratively learn a retrosynthesis model with parameters θ, without centralizing or sharing training reaction data. In the remaining content, we first formally define the steps of each communication round of CKIF, and introduce the learning objective of retrosynthesis model. We then elaborate on the CKIW strategy which learns a personalized model for each client.
At each communication round of CKIF, three procedures are performed sequentially for all clients. Firstly, model parameters generated by the previous round are used for parameter initialization (random initialization for the first round). Secondly, the initialized models of each client are trained locally on their own reaction data for a fixed number of epochs (or iterations) to minimize the following objective function:
| 1 |
Once trained, each client Ci sends their parameters θi to the central server. Thirdly, after collection, these parameters are aggregated (i.e., weighted sum) to a new global model by the central server: , where wk is the weighting factor for client Ck. As one of the most widely used methods in federated learning, FedAvg45 defines the weighting factor for Ci as the proportion of training samples: .
Despite being prevalent, mainstream federated learning methods like FedAvg struggle to handle data heterogeneity41,42 — one common characteristic of chemical entities, where reaction data often reflects specialized research focuses or industrial interests. To address this, CKIF advances privacy-preserving retrosynthesis learning by prioritizing client-specific requirements. Our method equips each client with a personalized model, tuned to their local data distribution and objectives, while still leveraging insights from other participants through the privacy-preserving exchange of model parameters alone. Critically, CKIF replaces the standard aggregation process, which yields a single global model (θG), with a tailored aggregation mechanism that constructs a unique, personalized model for each client in every communication round (see Box 1). For instance, the personalized model for client Ci is obtained by:
| 2 |
where denotes the adaptive weighting factor power by the proposed CKIW strategy (Box 2). quantifies the importance of models from other clients Ck relative to the given client Ci, and is normalized as:
| 3 |
where μ and τ are hyperparameters that control the influence of self’s model θi and neighboring clients’ models θk. si,k represents the similarity score between the reactants predicted by θk and the annotated ones stored in Ci. Note that the process of measuring similarity involves using proxy reaction data, which are stored securely and processed locally on each client. During the collaborative training process, only the model parameters are communicated. In our experiment, all reaction data in the validation set are chosen as the proxy reaction data. Clients can optionally provide additional proxy reaction data for improved measurement.
In the above distributed training procedure, the strategy used to assign weights to individual models during aggregation is of great importance40 for the performance, convergence, etc. Generic weighting strategies, such as count-based averaging, rely on handcrafted metrics. Such heuristic methods have significant limitations: they ignore the potential heterogeneity in data distributions across different chemical entities. This raises a fundamental question: how to compute meaningful weights si,k that quantify how valuable one client’s model is for another client’s learning objectives? To address this, CKIF is equipped with the CKIW strategy that harnesses the explicit, symbolic chemical knowledge — specifically, molecule fingerprints like ECFP43 and MACCS keys44. This is inspired by Asahara and Miyao67, who demonstrated fingerprints’ utility as chemical reaction representations for reaction prediction tasks. By calculating the molecule similarity between predicted and actual reactants, CKIW assesses the model’s effectiveness (i.e., si,k) across reaction data of different clients. The computation procedure of si,k is detailed as follows. For each reaction pair (x, y) stored on the validation set of Ci, we first get the predicted reactants through the personalized model θk. Then, molecule fingerprints43,44 of y and are extracted by RDKit68. Thereby, we can measure the similarity of the molecules by analyzing the molecule fingerprints with established measurement methods69. The selection of measurement methods and molecule fingerprints is flexible, allowing CKIW to take advantage of advancements in these areas. Finally, we can obtain si,k by averaging molecule similarities over all pairs in the proxy reaction data. In summary, si,k represents the overall performance of θk on Ci’s proxy data, with higher values indicating greater similarity between the clients’ data distributions. Note that throughout the aggregation process, each client Ci only uses their own proxy data locally to evaluate other clients’ models. The only information shared between clients are the model parameters θk, ensuring that private reaction data remains protected.
Box 1 Algorithm of chemical knowledge-informed framework.
Require: Number of chemical entities K, number of communication rounds RT, local epochs RL, number of fine-tuning rounds RF
Ensure: Personalized models {θ1, θ2, …, θK}
1: Initialize models
2: fort = 1 to RT-RFdo
3: Fork = 1 to Kdo
4:
5: end for
6: Compute with chemical knowledge guidance (Box 2)
7: fori = 1 to Kdo
8:
9: end for
10: end for
11: fork = 1 to Kdo
12:
13: end for
14: return {θ1, θ2, …, θK}
Box 2 Algorithm of chemical knowledge-informed weighting strategy.
Require Client models {θ1, θ2, …, θK}, proxy reaction data {D1, D2, …, DK}, hyperparameters μ, τ
Ensure Adaptive weighting factors
1: fori = 1 to Kdo
2: fork = 1 to Kdo ⊳ Client Ci evaluates model θk locally on its own proxy data without sharing
3: ifi = kthen
4:
5: else
6: si,k ← 0
7: for (x, y) ∈ Dido
8:
9: fy ← ExtractFingerprint(y)
10:
11:
12: end for
13: si,k ← si,k/∣Di∣
14: end if
15: end for
16: fork = 1 to K, k ≠ ido
17:
18: end for
19: end for
20: return
Theoretical analysis
We present the theoretical analysis of the proposed CKIF framework, which covers both the optimization error and the generalization error. The optimization error measures the convergence rate of the CKIF on the seen data during training. The generalization error measures the performance of the personalized model on the unseen data, which is more fundamental in the machine learning community. Although Adam is adopted in the experiments, the theoretical analysis of CKIF is conducted using Local SGD70. This preserves CKIF’s fundamental properties while facilitating a more tractable analysis. Considering that the weighting matrix of CKIF is not necessarily symmetric and doubly stochastic, we provide the theoretical analysis in the setting of decentralized stochastic learning with time-varying and row-stochastic weighting matrices. The theoretical results are established in the non-convex and stochastic settings. Compared with previous analyses of decentralized stochastic optimization that assume doubly stochastic mixing matrices71, establishing convergence rates for CKIF is more challenging because its weighting matrices are only row-stochastic and sample-dependent. Moreover, the derived generalization error bounds for the personalized model of CKIF capture the influence of the size of the local dataset and the time-varying weighting matrix, which are comparable to those of its doubly stochastic counterpart in previous work72.
Implementation details and hyperparameters
We formulate retrosynthesis as a sequence-to-sequence73 problem where each element in the sequence is a SMILES token. We use a standardization protocol9,14,74 using RDKit’s canonical SMILES representation (rdkit.Chem.MolToSmiles with canonical=True). This standardization step is applied before fingerprint calculation and model training, ensuring consistent molecular representation across all clients. A standard Transformer66 composed of an encoder-decoder architecture is adopted as the retrosynthesis model. All the baseline models use the same transformer architecture. Specifically, the adopted transformer consists of a 6-layer encoder and a 6-layer decoder, and the number of attention heads is set to 8. We train the Personalized and centrally trained models for 250 epochs with a batch size of 64. The experiments involving 4 and 8 clients were conducted using three RTX 3090 GPUs and four RTX 4090 GPUs, respectively. We employ an Adam optimizer75 with a learning rate of 0.0002, β1 = 0.9, and β2 = 0.998. Dropout76 is applied to the whole model to avoid overfitting. For CKIF, we trained the models for RT rounds, each with RL local epochs with a batch size of 64. Inspired by42,77, in the last RF rounds, we perform local fine-tuning instead of model aggregation. For all experiments, RT, RL, and RF are set to 50, 5, and 10, respectively. The hyperparameters μ and τ are set to be 1/K and 1.5, respectively. MACCS keys44 and Tanimoto similarity69 are employed to measure the similarity of molecules. OpenNMT-py78, an open-source neural machine translation framework in PyTorch79, is adopted to build our models.
Dataset collection
Our CKIF is evaluated on a variety of federated datasets sampled from U.S. patent database curated by25,26 for retrosynthesis prediction and reaction classification: USPTO-50K48, USPTO-MIT49, and USPTO 1k TPL52.
USPTO-50K is a high-quality reaction dataset comprising approximately 50, 000 reactions, each with manually annotated reaction type. We used the same split introduced in7,80, in which 80% of the data were used for training, 10% for validation, and 10% for testing. Five clients are obtained according to the reaction classes. In addition, the reactions with chirality (a property of asymmetry) compose another client.
USPTO-MIT is a larger dataset which contains approximately 480, 000 reactions. ~410, 000 reactions were used for training, ~30, 000 for validation, and ~40, 000 for testing, consistent with the split used in49. Two clients are obtained according to the reaction characteristics, i.e., ring opening and ring formation.
USPTO 1k TPL is a reaction dataset containing the 1,000 most common reaction templates as classes, which is built by52 for reaction classification. Eight clients are obtained according to the reaction classes (templates).
An overview of the datasets used for training and evaluation, including data split and statistics, is shown in Supplementary Table 1.
Pre- and post-processing
For all chemical reactions from datasets, reactants and products are extracted to form paired reaction data. Following previous works5,7,14, reagents and edge products are ignored in all experiments. We focus on single-step retrosynthesis20–23, where reactions containing multiple products are split into individual reactions to ensure that each reaction exclusively featured a single product. Canonical SMILES81 is used to represent molecules in all experiments. For post-processing, we use beam search82 to systematically explore potential reactant combinations. The ranking of reactant candidates was performed based on the models’ confidence scores, which reflected the likelihood of a given reactant combination leading to the desired product.
Evaluation metrics
We use top-K (K = {1, 3, 5, 10}) retrosynthesis accuracy, the most widely metric used among current literatures13,15,18,23,80,83,84, which indicates the proportion of ground truth reactants that appear (exactly matched) among the top-K confident predicted reactants, to evaluate the performance on each client. For comprehensive evaluation, we additionally report MaxFrag accuracy11 which focuses on main compound transformations, and RoundTrip accuracy9,14 which evaluates whether the predicted reactants can indeed synthesize the target product.
Supplementary information
Source data
Acknowledgements
This work was supported by the National Science and Technology Major Project (2023ZD0120801 to Y.Y. and W.W.), the National Natural Science Foundation of China (No. 62372405 to W.W. and No. 62476277 to Y.L.), the Fundamental Research Funds for the Central Universities (No. 226-2024-00058 to W.W.), and the Zhejiang Provincial Natural Science Foundation of China (No. LD25F020001 to W.W.).
Author contributions
W.W. conceived the study and provided the key idea. W.W. and G.C. developed the methodology, and designed the experiments. G.C. writed the code and performed the experiments. W.W., G.C., X.Z., and Y.Y. interpreted the results. X.H. and Y.L. provided the theoretical analysis. W.W. supervised the research. W.W., G.C., X.Z., and Y.Y. wrote the first draft of the manuscript. All authors contributed to manuscript revision and approved the final submission.
Peer review
Peer review information
Nature Communications thanks the anonymous reviewer(s) for their contribution to the peer review of this work. A peer review file is available.
Data availability
All chemical reaction data used in this work are publicly available. The USPTO-50K dataset is available in the Zenodo repository under accession code 10.5281/zenodo.15679564 (https://zenodo.org/records/15679564)85. The USPTO-MIT dataset is available at (https://github.com/wengong-jin/nips17-rexgen/blob/master/USPTO/data.zip). The USPTO 1k TPL dataset is available at (https://ibm.ent.box.com/v/MappingChemicalReactions). The processed dataset is available at86. No new primary datasets were generated in this study. Source data are provided with this paper.
Code availability
The source code and implementation details that support the findings of this study are publicly available under the MIT License at https://github.com/guikunchen/CKIF85.
Competing interests
The authors declare no competing interests.
Footnotes
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Supplementary information
The online version contains supplementary material available at 10.1038/s41467-025-63036-7.
References
- 1.Subbaraman, N. Flawed arithmetic on drug development costs. Nat. Biotechnol.29, 381–382 (2011). [DOI] [PubMed] [Google Scholar]
- 2.Struble, T. J. et al. Current and future roles of artificial intelligence in medicinal chemistry synthesis. J. Med. Chem.63, 8667–8682 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 3.Wang, W., Yang, Y. & Wu, F. Towards data-and knowledge-driven ai: A survey on neuro-symbolic computing. IEEE Trans. Pattern Anal. Mach. Intell.47, 878–899 (2025). [DOI] [PubMed] [Google Scholar]
- 4.Corey, E. J., Long, A. K. & Rubenstein, S. D. Computer-assisted analysis in organic synthesis. Science228, 408–418 (1985). [DOI] [PubMed] [Google Scholar]
- 5.Segler, M. H. & Waller, M. P. Neural-symbolic machine learning for retrosynthesis and reaction prediction. Chem. Eur. J.23, 5966–5971 (2017). [DOI] [PubMed] [Google Scholar]
- 6.Coley, C. W., Rogers, L., Green, W. H. & Jensen, K. F. Computer-assisted retrosynthesis based on molecular similarity. ACS Cent. Sci.3, 1237–1245 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 7.Dai, H., Li, C., Coley, C., Dai, B. & Song, L. Retrosynthesis prediction with conditional graph logic network. Proc. Adv. Neural Inf. Process. Syst. 32, 8872–8882 (2019).
- 8.Baylon, J. L., Cilfone, N. A., Gulcher, J. R. & Chittenden, T. W. Enhancing retrosynthetic reaction prediction with deep learning using multiscale reaction classification. J. Chem. Inf. Model.59, 673–688 (2019). [DOI] [PubMed] [Google Scholar]
- 9.Chen, S. & Jung, Y. Deep retrosynthetic reaction prediction using local reactivity and global attention. JACS Au1, 1612–1620 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 10.Weininger, D. Smiles, a chemical language and information system. 1. introduction to methodology and encoding rules. J. Chem. Inf. Comput. Sci.28, 31–36 (1988). [Google Scholar]
- 11.Tetko, I. V., Karpov, P., Van Deursen, R. & Godin, G. State-of-the-art augmented nlp transformer models for direct and single-step retrosynthesis. Nat. Commun.11, 5575 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 12.Lin, K., Xu, Y., Pei, J. & Lai, L. Automatic retrosynthetic route planning using template-free models. Chem. Sci.11, 3355–3364 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 13.Kim, E., Lee, D., Kwon, Y., Park, M. S. & Choi, Y.-S. Valid, plausible, and diverse retrosynthesis using tied two-way transformers with latent variables. J. Chem. Inf. Model.61, 123–133 (2021). [DOI] [PubMed] [Google Scholar]
- 14.Wan, Y., Hsieh, C.-Y., Liao, B. & Zhang, S. Retroformer: Pushing the limits of end-to-end retrosynthesis transformer. In Proc. ACM Int. Conf. Mach. Learn., 22475–22490 (2022).
- 15.Zhong, Z. et al. Root-aligned smiles: a tight representation for chemical reaction prediction. Chem. Sci.13, 9023–9034 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 16.Seo, S.-W. et al. Gta: Graph truncated attention for retrosynthesis. In AAAI Conf. Artif. Intell., 1, 531–539 (2021).
- 17.Tu, Z. & Coley, C. W. Permutation invariant graph-to-sequence model for template-free retrosynthesis and reaction prediction. J. Chem. Inf. Model.62, 3503–3513 (2022). [DOI] [PubMed] [Google Scholar]
- 18.Zhong, W., Yang, Z. & Chen, C. Y.-C. Retrosynthesis prediction using an end-to-end graph generative architecture for molecular graph editing. Nat. Commun.14, 3009 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 19.Sun, R., Dai, H., Li, L., Kearnes, S. & Dai, B. Towards understanding retrosynthesis by energy-based models. In Proc. Adv. Neural Inf. Process. Syst., 10186–10194 (2021).
- 20.Shi, C., Xu, M., Guo, H., Zhang, M. & Tang, J. A graph to graphs framework for retrosynthesis prediction. In Proc. ACM Int. Conf. Mach. Learn., 8818–8827 (2020).
- 21.Yan, C. et al. Retroxpert: Decompose retrosynthesis prediction like a chemist. In Proc. Adv. Neural Inf. Process. Syst., 11248–11258 (2020).
- 22.Somnath, V. R., Bunne, C., Coley, C., Krause, A. & Barzilay, R. Learning graph models for retrosynthesis prediction. In Proc. Adv. Neural Inf. Process. Syst., 9405–9415 (2021).
- 23.Wang, X. et al. Retroprime: A diverse, plausible and transformer-based method for single-step retrosynthesis predictions. Chem. Eng. J.420, 129845 (2021). [Google Scholar]
- 24.Zhang, X., Mo, Y., Wang, W. & Yang, Y. Retrosynthesis prediction enhanced by in-silico reaction data augmentation. arXiv preprint arXiv:2402.00086 (2024).
- 25.Lowe, D. M.Extraction of chemical structures and reactions from the literature. Ph.D. thesis, University of Cambridge (2012).
- 26.Lowe, D. Chemical reactions from US patents (1976-Sep2016). 10.6084/m9.figshare.5104873.v1 (2017).
- 27.Goodman, J. Computer software review: Reaxys (2009).
- 28.Lawson, A. J., Swienty-Busch, J., Géoui, T. & Evans, D. The making of reaxys-towards unobstructed access to relevant chemistry information. In Future Hist. Chem. Inf., 127–148 (ACS Publications, 2014).
- 29.Mayfield, J., Lowe, D. & Sayle, R. Pistachio: Search and faceting of large reaction databases. In Abstr. Pap. Am. Chem. Soc. (2017).
- 30.Bozbag, S., Sanli, D. & Erkey, C. Synthesis of nanostructured materials using supercritical co 2: Part ii. chemical transformations. J. Mater. Sci.47, 3469–3492 (2012). [Google Scholar]
- 31.Fayette, M. & Robinson, R. D. Chemical transformations of nanomaterials for energy applications. J. Mater. Chem. A2, 5965–5978 (2014). [Google Scholar]
- 32.Blakemore, D. C. et al. Organic synthesis provides opportunities to transform drug discovery. Nat. Chem.10, 383–394 (2018). [DOI] [PubMed] [Google Scholar]
- 33.Binder, J. B. & Raines, R. T. Simple chemical transformation of lignocellulosic biomass into furans for fuels and chemicals. J. Am. Chem. Soc.131, 1979–1985 (2009). [DOI] [PubMed] [Google Scholar]
- 34.Poizot, P. & Dolhem, F. Clean energy new deal for a sustainable world: from non-co 2 generating energy sources to greener electrochemical storage devices. Energy Environ. Sci.4, 2003–2019 (2011). [Google Scholar]
- 35.Shimizu, K. et al. Privacy-preserving search for chemical compound databases. BMC Bioinform.16, 1–14 (2015). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 36.Simm, J. et al. Splitting chemical structure data sets for federated privacy-preserving machine learning. J. Cheminform.13, 1–14 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 37.Muetterties, E. Molecular metal clusters: Cluster chemistry may provide valuable insights to chemisorption and catalysis on surfaces. Science196, 839–848 (1977). [DOI] [PubMed] [Google Scholar]
- 38.Schooler, J. Unpublished results hide the decline effect. Nature470, 437–437 (2011). [DOI] [PubMed] [Google Scholar]
- 39.Fang, L., Li, J., Zhao, M., Tan, L. & Lou, J.-G. Single-step retrosynthesis prediction by leveraging commonly preserved substructures. Nat. Commun.14, 2446 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 40.Zhang, M., Sapra, K., Fidler, S., Yeung, S. & Alvarez, J. M. Personalized federated learning with first order model optimization. In Proc. Int. Conf. Learn. Represent. (2021).
- 41.Huang, Y. et al. Personalized cross-silo federated learning on non-iid data. In AAAI Conf. Artif. Intell. 9, 7865–7873 (2021).
- 42.Wang, K. et al. Federated evaluation of on-device personalization. arXiv preprint arXiv:1910.10252 (2019).
- 43.Rogers, D. & Hahn, M. Extended-connectivity fingerprints. J. Chem. Inf. Model.50, 742–754 (2010). [DOI] [PubMed] [Google Scholar]
- 44.Durant, J. L., Leland, B. A., Henry, D. R. & Nourse, J. G. Reoptimization of mdl keys for use in drug discovery. J. Chem. Inf. Comput. Sci.42, 1273–1280 (2002). [DOI] [PubMed] [Google Scholar]
- 45.McMahan, B., Moore, E., Ramage, D., Hampson, S. & y Arcas, B. A. Communication-efficient learning of deep networks from decentralized data. In Artif. Intell. Stat. 1273–1282 (2017).
- 46.Tan, A. Z., Yu, H., Cui, L. & Yang, Q. Towards personalized federated learning. IEEE Trans. Neural Netw. Learn. Syst.34, 9587–9603 (2022). [DOI] [PubMed] [Google Scholar]
- 47.Lin, B. Y. et al. Fednlp: Benchmarking federated learning methods for natural language processing tasks. In Find. Annu. Conf. Assoc. Comput. Linguist. 157–175 (2022).
- 48.Schneider, N., Stiefl, N. & Landrum, G. A. What’s what: The (nearly) definitive guide to reaction role assignment. J. Chem. Inf. Model.56, 2336–2346 (2016). [DOI] [PubMed] [Google Scholar]
- 49.Jin, W., Coley, C., Barzilay, R. & Jaakkola, T. Predicting organic reaction outcomes with weisfeiler-lehman network. In Proc. Adv. Neural Inf. Process. Syst. (2017).
- 50.Edunov, S., Ott, M., Auli, M. & Grangier, D. Understanding back-translation at scale. In Conf. Empir. Methods Nat. Lang. Process. 489 (2018).
- 51.Sugiyama, A. & Yoshinaga, N. Data augmentation using back-translation for context-aware neural machine translation. In Proc. Fourth Workshop Discourse Mach. Transl., 35–44 (2019).
- 52.Schwaller, P. et al. Mapping the space of chemical reactions using attention-based neural networks. Nat. Mach. Intell.3, 144–152 (2021). [Google Scholar]
- 53.Toniato, A., Schwaller, P., Cardinale, A., Geluykens, J. & Laino, T. Unassisted noise reduction of chemical reaction datasets. Nat. Mach. Intell.3, 485–494 (2021). [Google Scholar]
- 54.Xie, C., Huang, K., Chen, P.-Y. & Li, B. Dba: Distributed backdoor attacks against federated learning. In Proc. Int. Conf. Learn. Represent. (2019).
- 55.Lyu, L. et al. Privacy and robustness in federated learning: Attacks and defenses. IEEE Trans. Neural Netw. Learn. Syst. (2022). [DOI] [PubMed]
- 56.Abadi, M. et al. Deep learning with differential privacy. In ACM SIGSAC Conf. Comput. Commun. Secur., 308–318 (2016).
- 57.Sun, J. et al. Provable defense against privacy leakage in federated learning from representation perspective. In Proc. IEEE Conf. Comput. Vis. Pattern Recognit. (2021).
- 58.Tolpegin, V., Truex, S., Gursoy, M. E. & Liu, L. Data poisoning attacks against federated learning systems. In Proc. Eur. Symp. Res. Comput. Secur., 480–501 (2020).
- 59.Sun, G. et al. Data poisoning attacks on federated machine learning. IEEE Internet Things J.9, 11365–11375 (2021). [Google Scholar]
- 60.Chen, J. et al. When federated learning meets privacy-preserving computation. ACM Comput. Surv.56, 1–36 (2024). [Google Scholar]
- 61.Sharma, A. & Marchang, N. A review on client-server attacks and defenses in federated learning. Comput. Secur. 140, 103801 (2024).
- 62.Nowroozi, E., Haider, I., Taheri, R. & Conti, M. Federated learning under attack: Exposing vulnerabilities through data poisoning attacks in computer networks. IEEE Trans. Netw. Serv. Manag. (2025).
- 63.Ogier du Terrail, J. et al. Federated learning for predicting histological response to neoadjuvant chemotherapy in triple-negative breast cancer. Nat. Med.29, 135–146 (2023). [DOI] [PubMed] [Google Scholar]
- 64.Karargyris, A. et al. Federated benchmarking of medical artificial intelligence with medperf. Nat. Mach. Intell.5, 799–810 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 65.Feng, B. et al. Robustly federated learning model for identifying high-risk patients with postoperative gastric cancer recurrence. Nat. Commun.15, 742 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 66.Vaswani, A. et al. Attention is all you need. In Proc. Adv. Neural Inf. Process. Syst. (2017).
- 67.Asahara, R. & Miyao, T. Extended connectivity fingerprints as a chemical reaction representation for enantioselective organophosphorus-catalyzed asymmetric reaction prediction. ACS omega7, 26952–26964 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 68.Landrum, G. et al. Rdkit: A software suite for cheminformatics, computational chemistry, and predictive modeling. Greg Landrum8 (2013).
- 69.Bajusz, D., Rácz, A. & Héberger, K. Why is tanimoto index an appropriate choice for fingerprint-based similarity calculations? J. Cheminform.7, 1–13 (2015). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 70.Stich, S. U. Local SGD converges fast and communicates little. In Proc. Int. Conf. Learn. Represent. (2019).
- 71.Koloskova, A., Loizou, N., Boreiri, S., Jaggi, M. & Stich, S. A unified theory of decentralized sgd with changing topology and local updates. In Proc. ACM Int. Conf. Mach. Learn., 5381–5393 (2020).
- 72.Hu, X. et al. Stability and generalization of zeroth-order decentralized stochastic gradient descent with changing topology. In AAAI Conf. Artif. Intell., 17342–17350 (2025).
- 73.Sutskever, I., Vinyals, O. & Le, Q. V. Sequence to sequence learning with neural networks. In Proc. Adv. Neural Inf. Process. Syst. (2014).
- 74.Schwaller, P. et al. Molecular transformer: a model for uncertainty-calibrated chemical reaction prediction. ACS Cent. Sci.5, 1572–1583 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 75.Kingma, D. P. & Ba, J. Adam: A method for stochastic optimization. In Proc. ACM Int. Conf. Mach. Learn. (2017).
- 76.Srivastava, N., Hinton, G., Krizhevsky, A., Sutskever, I. & Salakhutdinov, R. Dropout: a simple way to prevent neural networks from overfitting. J. Mach. Learn. Res.15, 1929–1958 (2014). [Google Scholar]
- 77.Yu, T., Bagdasaryan, E. & Shmatikov, V. Salvaging federated learning by local adaptation. arXiv preprint arXiv:2002.04758 (2020).
- 78.Klein, G., Kim, Y., Deng, Y., Senellart, J. & Rush, A. M. Opennmt: Open-source toolkit for neural machine translation. In Assoc. Comput. Linguist., 67–72 (2017).
- 79.Paszke, A. et al. Pytorch: An imperative style, high-performance deep learning library. In Proc. Adv. Neural Inf. Process. Syst. (2019).
- 80.Liu, B. et al. Retrosynthetic reaction prediction using neural sequence-to-sequence models. ACS Cent. Sci.3, 1103–1113 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 81.Weininger, D., Weininger, A. & Weininger, J. L. Smiles. 2. algorithm for generation of unique smiles notation. J. Chem. Inf. Comput. Sci.29, 97–101 (1989). [Google Scholar]
- 82.Freitag, M. & Al-Onaizan, Y. Beam search strategies for neural machine translation. In Proc. First Workshop Neural Mach. Transl. (2017).
- 83.Karpov, P., Godin, G. & Tetko, I. V. A transformer model for retrosynthesis. In Int. Conf. Artif. Neural Netw., 817–830 (2019).
- 84.Sacha, M. et al. Molecule edit graph attention network: modeling chemical reactions as sequences of graph edits. J. Chem. Inf. Model.61, 3273–3284 (2021). [DOI] [PubMed] [Google Scholar]
- 85.Chen, G. et al. Chemical knowledge-informed framework for privacy-aware retrosynthesis learning (2025). Repository: CKIF. [DOI] [PMC free article] [PubMed]
- 86.Chen, G. et al. Data for: Chemical knowledge-informed framework for privacy-aware retrosynthesis learning (2025). [DOI] [PMC free article] [PubMed]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Supplementary Materials
Data Availability Statement
All chemical reaction data used in this work are publicly available. The USPTO-50K dataset is available in the Zenodo repository under accession code 10.5281/zenodo.15679564 (https://zenodo.org/records/15679564)85. The USPTO-MIT dataset is available at (https://github.com/wengong-jin/nips17-rexgen/blob/master/USPTO/data.zip). The USPTO 1k TPL dataset is available at (https://ibm.ent.box.com/v/MappingChemicalReactions). The processed dataset is available at86. No new primary datasets were generated in this study. Source data are provided with this paper.
The source code and implementation details that support the findings of this study are publicly available under the MIT License at https://github.com/guikunchen/CKIF85.





