We tackle the problem of structural elucidation as an automated machine translation problem based on language modeling, where a model is trained to "translate" the MS/MS spectrum into the corresponding molecule as a SMILES representation (Figure ), similar to other works in the field. Our model is a transformer language model trained on 40M MS/MS spectra (10M molecules), most of which simulated via CFM-ID and FragGenie. By design, our model requires a sum formula as input, since it is either already known, or being easily accessible through several tools that can accurately predict it from MS/MS spectra. We evaluated our model on the Critical Assessment for Small Molecule Identification (CASMI) challenges, as well as the newly released MassSpecGym benchmark (Figure ). Our model achieved top-128 accuracies of 76.4%, 43.8% and 33.3% respectively for CASMI 2016, 2017 and 2022 (top-k performance for different values of k in Supplementary Information S1). All CASMI molecules and their spectra were removed from the model's training and validation sets to ensure an unbiased evaluation. As the MassSpecGym benchmark was published after our model was trained, we only used for the evaluation molecules that were not in the model's training set. This resulted in 992 MS/MS spectra on which our model reached an accuracy of 36.5%. On this benchmark, we did not find a difference in performance between different instrument types, and a slight decrease for [M+Na]+ adducts (Supplementary Information S2).