# Neural Graph Matching Improves Retrieval Augmented Generation in Molecular Machine Learning

arXiv: https://arxiv.org/abs/2502.17874 · HTML: https://mlsanity.com/paper/2502.17874/

## Key facts

- Cited by 2 papers in the map (data through 14 Oct 2026).
- Placed in Medical and biomedical RAG, one of 15 directions in Retrieval-augmented generation.
- Builds on 14 of its 51 references that are in the map.
- First posted on arXiv 25 Feb 2025.

## Placed in

- Retrieval-augmented generation / [Medical and biomedical RAG](https://mlsanity.com/rag/medical-and-biomedical-rag/)

## Builds on (most cited first, 14 of 14)

- [Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks](https://mlsanity.com/paper/2005.11401/) (2020)
- [SuperGlue: Learning Feature Matching with Graph Neural Networks](https://mlsanity.com/paper/1911.11763/) (2019)
- [ChemCrow: Augmenting large-language models with chemistry tools](https://mlsanity.com/paper/2304.05376/) (2023)
- [Graph Matching Networks for Learning the Similarity of Graph Structured Objects](https://mlsanity.com/paper/1904.12787/) (2019)
- [Nested Graph Neural Networks](https://mlsanity.com/paper/2110.13197/) (2021)
- [Neural Graph Matching Network: Learning Lawler's Quadratic Assignment Problem with Extension to Hypergraph and Multiple-graph Matching](https://mlsanity.com/paper/1911.11308/) (2019)
- [Deep Graph Matching via Blackbox Differentiation of Combinatorial Solvers](https://mlsanity.com/paper/2003.11657/) (2020)
- [MassSpecGym: A benchmark for the discovery and identification of molecules](https://mlsanity.com/paper/2410.23326/) (2024)
- [Rapid Prediction of Electron-Ionization Mass Spectrometry using Neural Networks](https://mlsanity.com/paper/1811.08545/) (2018)
- [Prefix-Tree Decoding for Predicting Mass Spectra from Molecules](https://mlsanity.com/paper/2303.06470/) (2023)
- [Efficiently predicting high resolution mass spectra with graph neural networks](https://mlsanity.com/paper/2301.11419/) (2023)
- [Using Graph Neural Networks for Mass Spectrometry Prediction](https://mlsanity.com/paper/2010.04661/) (2020)
- [Competitive Fragmentation Modeling of ESI-MS/MS spectra for putative metabolite identification](https://mlsanity.com/paper/1312.0264/) (2013)
- [FraGNNet: A Deep Probabilistic Model for Tandem Mass Spectrum Prediction](https://mlsanity.com/paper/2404.02360/) (2024)

## Built on by (most cited first, 2 of 2)

- [Refold: Refining Protein Inverse Folding with Efficient Structural Matching and Fusion](https://mlsanity.com/paper/2603.14350/) (2026)
- [Towards Metric-Faithful Neural Graph Matching](https://mlsanity.com/paper/2605.06588/) (2026)

## Abstract (arXiv)

Molecular machine learning has gained popularity with the advancements of geometric deep learning. In parallel, retrieval-augmented generation has become a principled approach commonly used with language models. However, the optimal integration of retrieval augmentation into molecular machine learning remains unclear. Graph neural networks stand to benefit from clever matching to understand the structural alignment of retrieved molecules to a query molecule. Neural graph matching offers a compelling solution by explicitly modeling node and edge affinities between two structural graphs while employing a noise-robust, end-to-end neural network to learn affinity metrics. We apply this approach to mass spectrum simulation and introduce MARASON, a novel model that incorporates neural graph matching to enhance a fragmentation-based neural network. Experimental results highlight the effectiveness of our design, with MARASON achieving 28% top-1 accuracy, a substantial improvement over the non-retrieval state-of-the-art accuracy of 19%. Moreover, MARASON outperforms both naive retrieval-augmented generation methods and traditional graph matching approaches. Code is publicly available at https://github.com/coleygroup/ms-pred
