Model training, and hyperparameter optimization. Recurrent neural networks with long-short term memory (LSTM) were optimized using hyperparameter values in agreement with literature: [32, 64, 128]. Softmax activation and Adam optimizer were used. Each combination was trained for 500 epochs, and early stopping on the cross-entropy loss in validation was applied (patience = 10, minimum loss change = 0.0001). The model with the best validation loss was used to sample 1000 SMILES strings with a sampling temperature of T = 1.0 (multinomial sampling, Eq. 1), across four independent repeats. Transfer learning. Hyperparameters were chosen in agreement with literature . For pre-training, three LSTM layers with 512 hidden units each, a learning rate of 0.0005, and a batch size of 512 were chosen, in combination with softmax activation and Adam optimizer. The model was pre-trained for 500 epochs, and early stopping on the cross-entropy loss in validation was applied (patience = 10, minimum loss change = 0.0001). The trained model was used to sample 1000 SMILES strings across four repeats with multinomial sampling (T = 1.0, Eq. 1). During fine-tuning, a learning rate of 0.0000005 and a clipping norm of 1 were used. The model was fine-tuned for 500 epochs with early stopping and sampling as for the pre-training.