Two different techniques can be used to sample target molecules with a molecular transformer: multinomial sampling (used e.g. by ) and beam search . Multinomial sampling allows fast generation of compounds distributed according to their NLL. Given a source compound s ∈ X , the length L of the tokens in the SMILES string associated with s, and V the vocabulary, i.e. the set of possible tokens, the computationally complexity of multinomial sampling is O(L • |V |). However, multinomial sampling suffers from mode collapse i.e. the same target compound might be sampled multiple times, and the method is not deterministic, i.e. different runs produce different target compounds. Beam search is, in contrast to multinomial sampling, deterministic but computationally more complex