We explored the beam search algorithm to generate molecules from a CLM as a potential alternative to temperature sampling combined with an external ranking method. Given the probabilities learnt by a CLM, a vast number of SMILES strings could be sampled. As it is computationally not feasible to sample all outputs, a heuristic method such as beam search can be used to find the likely outputs. Here, the motivation to find the most likely SMILES strings was based on the hypothesis that the probability for generating a certain SMILES string correlates with the quality of the corresponding molecule with regard to the implicit design objective encoded in the fine-tuning set (e.g., desired bioactivity, physicochemical properties). During molecule generation by beam search sampling, the algorithm progressively adds characters ("tokens") to a SMILES string while keeping track of the k most likely SMILES string(s). When adding a new token, the algorithm computes the probability of each possible growing SMILES string to define the k most likely SMILES string(s) for the next step (Fig ). This process is repeated until the SMILES sequence is completed (i.e., the 'end-of-sequence' character is added) or a predefined maximal string length is reached. Thus, beam search can be used to approximately find the most probable molecules, as predicted by (i) the underlying model and (ii) the scoring function, which is computed as the product of the probabilities of each character (Fig. ). This scoring function ("beam search score") allows to rank the de novo designs according to the probability of their SMILES tokens.