Template library. The database of reaction templates was obtained from the publicly available US Patent Office dataset as prepared by Thakkar et al. . The library consists of 911,869 reactions distributed across 46,695 unique templates. Training, validation, and test sets were constructed by randomly splitting the 911,695 reactions in USPTO database in a 90/5/5 split. The validation and training set each contains 45,594 reactions, while the training set contains 820,682 reactions. The 46,695 unique templates in the USPTO database were represented as binarized labels. The reactions are encoded as pairs of reaction SMARTS and product. The models are trained to assign the highest probability to the reaction SMARTS given the corresponding product.