We have proposed a novel HGAR model for molecular retrosynthesis. The model pretrained on PCQM4M-LSC utilizes the hierarchical graph formed by combining synthons with their corresponding junction trees as input and accomplishes cascaded synthon completion by making predictions about motifs and verifying the completeness of synthons in an autoregressive way. We conducted an analysis of the contributions of the pre-training framework and variational encoder to the model, as well as the importance of different modules. Our extensive experiments have shown that our method can achieve state-of-the-art performance in retrosynthesis. Visualized comparisons for various methods. Each row represents one example, and the columns represent the product, the predicted reactants by GraphRetro, MEGAN, HGAR, and the ground truth reactants, respectively. In each product, the true reaction center is labeled with a green circle, while the incorrect predictions of HGAR, GraphRetro, and MEGAN are labeled with yellow, red, and blue circles respectively. For the predicted reactants, the true motifs and their incorrect predictions are highlighted by blue and red boxes, respectively.