Accelerating the inference of string generation-based chemical reaction models for industrial applications
Mikhail Andronov, Natalia Andronova, Michael Wand, Jürgen Schmidhuber, Djork-Arné Clevert
TL;DR
The paper tackles slow inference in template-free SMILES-to-SMILES transformers used for reaction product prediction and single-step retrosynthesis. It introduces speculative decoding, a draft-and-verify approach adapted from LLM inference, to SMILES generation by copying source subsequences into the output. Re-implementing the Molecular Transformer in PyTorch Lightning, the authors demonstrate more than threefold speedups on USPTO MIT and USPTO 50K while preserving top-k accuracy. The results show meaningful practical gains for industrial computer-aided synthesis planning, with limitations tied to batch size and beam width; the work includes code release and outlines directions for improved drafting strategies to further boost throughput.
Abstract
Template-free SMILES-to-SMILES translation models for reaction prediction and single-step retrosynthesis are of interest for industrial applications in computer-aided synthesis planning systems due to their state-of-the-art accuracy. However, they suffer from slow inference speed. We present a method to accelerate inference in autoregressive SMILES generators through speculative decoding by copying query string subsequences into target strings in the right places. We apply our method to the molecular transformer implemented in Pytorch Lightning and achieve over 3X faster inference in reaction prediction and single-step retrosynthesis, with no loss in accuracy.
