  Retrosynthetic planning aims to devise a complete multi-step synthetic route
from starting materials to a target molecule. Current strategies use a
decoupled approach of single-step retrosynthesis models and search algorithms,
taking only the product as the input to predict the reactants for each planning
step and ignoring valuable context information along the synthetic route. In
this work, we propose a novel framework that utilizes context information for
improved retrosynthetic planning. We view synthetic routes as reaction graphs
and propose to incorporate context through three principled steps: encode
molecules into embeddings, aggregate information over routes, and readout to
predict reactants. Our approach is the first attempt to utilize in-context
learning for retrosynthesis prediction in retrosynthetic planning. The entire
framework can be efficiently optimized in an end-to-end fashion and produce
more practical and accurate predictions. Comprehensive experiments demonstrate
that by fusing in the context information over routes, our model significantly
improves the performance of retrosynthetic planning over baselines that are not
context-aware, especially for long synthetic routes. Code is available at
https://github.com/SongtaoLiu0823/FusionRetro.
