Nucleus sampling for molecule generation. CLMs generate new molecules by extending strings from a "start" character until the "stop" character is sampled or when reaching a preset maximum string length. String characters are iteratively added by weighted random sampling from the probability distribution learned by the CLM during training. The more likely a given character is at a given step according to the probabilities learned by the CLM, the more often it will be sampled, and vice versa. Narrowing the probabilities learned by the CLM with a parameter (the so-called temperature; Fig. ) generally improves the SMILES string sampling . This improvement occurs in terms of (i) the quality of the SMILES strings generated, as reflected by their validity (grammatically valid SMILES strings), uniqueness (nonrepetitive molecules), and novelty (molecules not present in the pretraining and fine-tuning data), and (ii) the similarity of the sampled virtual chemical libraries to the reference data in terms of their chemical structures and bioactivities, as measured by the Fréchet ChemNet Distance (FCD) . However, with this "temperature sampling" approach, SMILES characters are unlikely to be sampled, which could result in the construction of molecules that do not match the design objective. To prevent the CLM from picking unlikely SMILES characters by temperature sampling, we employed "nucleus sampling" here . This method reflects the confidence of the model in its predictions by allowing only the most probable character(s) to be sampled using a probability threshold based on the cumulative probabilities of the SMILES characters (Fig. ).