In our approach, we use the encoded junction tree and the molecular graph to obtain independent embeddings for the molecule and its underlying structure (Fig. ). Thus, each molecule has two embeddings -one for the junction tree and one for the molecular graph which are concatenated to create one embedded representation of the molecule -a stacked vector used to perform regression and guided search for the suitable molecule in the embedded space (Fig. ). The decoding procedure consists in creating a junction tree structure first and use the molecular graph hidden representation to guide the reconstruction of the junction tree into the final molecule (Fig. ).