Graph-based transformer The Graph-based transformer variant deals with the positional encodings differently from the more classical sequence-based transformer encodings. As with a graph representation the atom index cannot directly be used, the encoding is a combination of the atom index (current position) and the connected atom index (previous position). For more details on the graph representation of the molecules see section 2.1.2). The graph-based model consists of a transformer encoder and a GRU-based decoder. The Graph transformer has some considerable advantages compared to the sequence-based transformer as it only creates valid molecules and has a higher incorporation rate of fragments.