The perplexity metric was used as a scoring function to reflect the probability of sampling a SMILES string as a function of its characters (Eq. 1) . Perplexity is typically used to assess the performance of language models in natural language processing . For a SMILES string of length N, the perplexity score can be computed by considering the CLM probability of any i-th character (pi), as follows: