Nature, Published online: 26 February 2025; doi:10.1038/d41586-025-00573-7For decades, chemists have tried to train computers to predict how different molecules can be synthesized, but existing approaches use shortcut algorithms that are unreliable when the target is complex. Adding quantum-mechanical and statistical modelling at weak points in the algorithms can provide feedback to reroute the predictions towards successful chemical syntheses.