Skip to main content

Frontier retrosynthesis prediction model

Project description

RetroChimera

Backed by SyntheseusPaper

CI Python Version pypi code style License

RetroChimera is a frontier retrosynthesis model, built upon ensembling two novel components with complementary inductive biases. It outperforms existing models by a large margin, can learn from a very small number of examples per reaction class, and is preferred by industrial organic chemists over the reactions it was trained on in blind tests.

Using RetroChimera

To install retrochimera locally, run

conda env create -f environment.yml
conda activate retrochimera

pip install retrochimera

then you can run inference via

from retrochimera import RetroChimeraModel
from syntheseus import Molecule

model = RetroChimeraModel(model_dir="/model/checkpoint/dir/")
mol = Molecule("Oc1ccc(OCc2ccccc2)c(Br)c1")

predictions = model([mol], num_results=3)

for p in predictions[0]:
    print(p, f"({100. * p.metadata['probability']:.2f}%)")

For installation, there are two additional dependency groups: dev for running tests, and graphium for building the model architecture we used for USPTO-50K; if you care about running the USPTO-50K checkpoint, you need to install via pip install retrochimera[graphium].

If you want to train your own checkpoint, please follow the instructions in retrochimera/README.md.

Checkpoints for RetroChimera 1

The main (and most powerful) checkpoint we release is trained on Pistachio. For benchmarking, we also provide (weaker) checkpoints trained on USPTO-50K and USPTO-FULL.

If you care about reproducing the USPTO-* results from our paper exactly, make sure to use the inference hyperparameters listed in Extended Data Tables 3 and 4. By default, these parameters are set to values optimal for the Pistachio checkpoint.

[!WARNING] RetroChimera 1 is being released for research and experimentation - we hope you try to break it in any way possible and share the results back to us. As any ML model it is not free from errors and may hallucinate, in particular when used for inputs out of the training distribution. We look forward to collaborating with the community so we can improve the model for everyone!

Before using any of the predictions in a real-world setting, they must be risk-assessed and verified independently by chemistry experts. In particular, reactions ranked lower in the output list are increasingly likely to be hallucinations; we recommend requesting no more than 5-10 reactions per input unless paired with stringent filtering (see e.g. [1][2])

If you find that RetroChimera 1 doesn't work on your favourite drug-like molecule, please let us know at retrochimera@microsoft.com, so we can make sure we improve this in the next model version.

Citation

If you use RetroChimera in your work, please consider citing our arXiv preprint (bibtex below).

@article{maziarz2025chemist,
  title={Chemist-aligned retrosynthesis by ensembling diverse inductive bias models},
  author={Maziarz, Krzysztof and Liu, Guoqing and Misztela, Hubert and Tripp, Austin and Li, Junren and Kornev, Aleksei and Gai{\'n}ski, Piotr and Hoefling, Holger and Fortunato, Mike and Gupta, Rishi and Segler, Marwin},
  journal={arXiv preprint arXiv:2412.05269},
  year={2025}
}

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

retrochimera-1.2.0.tar.gz (190.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

retrochimera-1.2.0-py3-none-any.whl (166.3 kB view details)

Uploaded Python 3

File details

Details for the file retrochimera-1.2.0.tar.gz.

File metadata

  • Download URL: retrochimera-1.2.0.tar.gz
  • Upload date:
  • Size: 190.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for retrochimera-1.2.0.tar.gz
Algorithm Hash digest
SHA256 bf77de553bdb2f3ce58168f2e8bf014009875370176e01e334e52c2326b5559d
MD5 cf348ea5f34162ae0892dde415c7e640
BLAKE2b-256 4d1601cab04c958e8f27d0861654a7dfb4776e1e67c2b1bf9c5f4d0f260ca01e

See more details on using hashes here.

Provenance

The following attestation bundles were made for retrochimera-1.2.0.tar.gz:

Publisher: release.yml on microsoft/retrochimera

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file retrochimera-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: retrochimera-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 166.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for retrochimera-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dd07426c16d997856a60d5914681bb4e46c3a7dd7605c57e4f5bca9c965fe11a
MD5 75533055a440981b56ae2a00c5074b9d
BLAKE2b-256 b56f725870ba734c179499fba098292d92f5fdd38ca9fdfd4124398a059fcd8f

See more details on using hashes here.

Provenance

The following attestation bundles were made for retrochimera-1.2.0-py3-none-any.whl:

Publisher: release.yml on microsoft/retrochimera

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page