f-RAG
A fragment retrieval-augmented molecule generator built on a frozen SAFE-GPT with a trained fragment injection module.
Molecules, proteins and genomics · 726 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Parameters
- 89.6M
- Operations
- 726
- Framework
- PyTorch
- Recurrent
- No
- Published
- NeurIPS 2024
- Cited by
- 4 (as of 28 October 2026)
- Authors
- Seul Lee, Karsten Kreis, Srimukh Prasad Veccham and others
- Source
- GitHub: NVlabs/f-RAG
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m21610
- Graph hash
- eb8ff4edbcbcbe76e538190e6432734dacc866f658a3ba6c9e1d9072abbbb502
- Skeleton hash
- 0ab2978e7324b37f47384dc4a1ea76f4c4d10e5e2880346a5357f20f7dc8491c
- Architecture hash
- b2ac5a99c87e016a2edf8c2142c5b51eca506cea5633b46363efc37273b067f4
- Diagram SHA-256
- e5fafb8317e0929c1b72724899cd2fcdf877829722fbf9dfef31c3ad111e13a3
- TorchLens version
- 2.36.0
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
What it is
f-RAG (Fragment Retrieval-Augmented Generation) generates molecules by assembling molecular fragments, built on the pre-trained SAFE-GPT molecular language model. The paper's motivation is that many fragment-based generation methods explore little beyond the fragments already in their database, because they only reassemble or slightly modify known ones.
From a fragment vocabulary, f-RAG retrieves two kinds of fragments. Hard fragments are given to the language model as input and are explicitly included in the generated molecule. Soft fragments are not part of the molecule; their embeddings are fused with the input embeddings through a lightweight fragment injection module placed in the middle of the SAFE-GPT layers. That module uses cross-attention, where the query, key and value are multi-layer perceptrons. The molecule is then decoded from the fused embedding by the later layers of the model.
During training only the fragment injection module is updated while SAFE-GPT is kept frozen, using a self-supervised objective that predicts the most similar fragment. To reach beyond the existing fragments, f-RAG updates the vocabulary with generated fragments through an iterative refinement process and a post-hoc genetic fragment modification step. The paper evaluates it on the practical molecular optimization (PMO) benchmark.
Key idea. f-RAG augments a frozen pre-trained molecular language model with retrieved hard and soft fragments through a trained fragment injection module, aiming to explore beyond a fixed fragment vocabulary.
- f-RAG
- fragment retrieval-augmented generation
- molecule generation
- fragment-based drug discovery
- retrieval-augmented generation
- SAFE-GPT
- fragment injection module
- molecular optimization
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{lee2024moleculegenerationfragmentretrieval,
title={Molecule Generation with Fragment Retrieval Augmentation},
author={Seul Lee and Karsten Kreis and Srimukh Prasad Veccham and Meng Liu and Danny Reidenbach and Saee Paliwal and Arash Vahdat and Weili Nie},
year={2024},
eprint={2411.12078},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2411.12078},
}