For the direct reaction prediction task, the model is given the reactants and asked to predict the products, with the reverse being true for the retrosynthesis prediction task. Fine-tuning for the molecular optimisation task is performed by prefixing the molecule to be optimised with optimisation tokens. For example, if we wish the solubility to be increased, the clearance to be decreased, and the LogD to be left unchanged, we encode this into an optimisation using tokens in the model's vocabulary. The model is then trained to predict the MMP output molecule given in the dataset.