For each compound designated as a product, the bipartite reaction graph is queried to obtain the neighboring connected nodes, from which we can extract a multi-label dataset for the subsequent training of neural networks. This approach allows us to train a multi-label multi-class classification neural network for the prediction of retrosynthetic steps, as opposed to the single-label multi-class classification network previously described (Figure ). In doing so, the number of samples is limited to that of the number of products recorded in the dataset, rather than the number of individual reaction entries. This speeds up training of the network by reducing the number of samples, resulting in a more efficient way of scaling to the ever-growing chemical literature. Additionally, the label vectors better represent the nature of the problem and are closer to the ground truth as their sparsity is reduced. The ground truth defined as containing all possible retrosynthetic disconnections, and as such reaction templates that can be applied to any given product. In this work, we limited the reaction templates to those describing ring formations by using the crude measure of the difference in the number of rings between the products and reactants. We retain only reactions in which the difference is greater than one, thereby allowing multiple ring formations in one synthetic step. The bipartite reaction graph is then built, describing the retrosynthetic space corresponding to ring formations and queried to build a domain specific multi-label dataset (Figure ).