  Recent advancements in deep learning-based modeling of molecules promise to
accelerate in silico drug discovery. There is a plethora of generative models
available, which build molecules either atom-by-atom and bond-by-bond or
fragment-by-fragment. Many drug discovery projects also require a fixed
scaffold to be present in the generated molecule, and incorporating that
constraint has been recently explored. In this work, we propose a new
graph-based model that learns to extend a given partial molecule by flexibly
choosing between adding individual atoms and entire fragments. Extending a
scaffold is implemented by using it as the initial partial graph, which is
possible because our model does not depend on generation history. We show that
training using a randomized generation order is necessary for good performance
when extending scaffolds, and that the results are further improved by
increasing fragment vocabulary size. Our model pushes the state-of-the-art of
graph-based molecule generation, while being an order of magnitude faster to
train and sample from than existing approaches.
