The model is trained through back-propagation, using the Adam 37 optimizer with a learning rate of 9.5x10 -4 and default parameters using PyTorch . The training was done in multiple cycles of optimizing the same model while tuning the learning rate. This process is explained while discussing the results. The model is trained through RL using the classic REINFORCE 39 algorithm. Following the standard protocol, a small negative reward of -0.01 is given for each step, and a positive reward of +1 is given if the final molecule (once it reaches the target size) is synthesizable and -1 if not. A heavy penalty of -7.5 is levied if the model fails to reach the target size, which usually happens if all valences are filled before the required size is reached.