Impurity prediction was done by developing an AI-based reaction predictor, that takes as input the main reactants but also reagents, solvents, and impurities in these materials. Further, the predictor can be run iteratively to track impurity propagation in multi-step reactions. For inverse structure elucidation, a chemistry-informed language model was developed to translate mass spectrometry data to potential molecular structures, which can then be checked for matches against the predicted chemical reaction products.