A scaffold S with multiple attachment points A can be represented in a SMILES string by adding branched dummy atoms (i.e., ( * )), for example, a meta-substituted benzene can be represented as "c1c(*)cc(*)cc1". This can be decorated as described in Algorithm 1. First, an attachment can be selected either in order of appearance in the string (canonical) or it can be randomly selected such that a batch of molecules contains a mixture of selected attachment points (shuffle). Then, the the SMILES string can be generated to be rooted at this index using RDKit and then reversed such that it is now the last atom. Alternatively, several rooted randomized variations of SMILES representations can be generated , reversed, and the CLM likelihood of the full SMILES string calculated to select the variation most likely generated by the CLM (optimise). Note that because the SMILES string is only modified from the prompt onwards, it is trivial to remove and re-insert attachment points in the prompt for later iterations (as attachment points will not be modelled by a typical CLM). Then, the CLM samples new tokens at each timestep x t provided that a prompt token s * t at that timestep t does not exist. Once SMILES generation has terminated due to the sampling of a stop token any remaining attachment points are inserted back into the string. This is process is then repeated until all attachment points have been sampled.