MolGPT
Transformer decoder that generates druglike molecules as SMILES strings, with scaffold and property conditioning.
Molecules, proteins and genomics · 269 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
- 6.3M
- Operations
- 269
- Framework
- PyTorch
- Recurrent
- No
- Published
- 2021, Journal of Chemical Information and Modeling
- Cited by
- 551 (as of 28 October 2026)
- Authors
- Viraj Bagal, Rishal Aggarwal, P. K. Vinod, U. Deva Priyakumar
- Source
- GitHub: devalab/molgpt
- License
- MIT
- 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
- m18507
- Graph hash
- d144ec85998e0e54ef84e988d75328f1bfbc499933aea25b0a99b73f532b20c1
- Skeleton hash
- 796544e2c3e2fd3a1d32528a7220a958f325e897852c87928541cdccf5085d2f
- Architecture hash
- cc741722fcf91999286c42ffff2162a749096a35e815e3d0919bb88168ac95c4
- Diagram SHA-256
- da285756dcbfcfbb345502ba4d6f7d9e3ab2e5d52f056866cf8f7c14033f67e2
- 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
MolGPT is a transformer-decoder that generates druglike molecules as SMILES strings, a notation that writes a molecule as a string of characters. Inspired by generative pre-training (GPT) models, the authors train it on the next token prediction task using masked self-attention. The code repository describes it as a small custom GPT trained on the Moses and Guacamol datasets.
The abstract reports that MolGPT performs on par with other machine learning frameworks for molecular generation in terms of generating valid, unique and novel molecules. The model can also be trained conditionally to control multiple properties of the generated molecules. Conditioning on scaffold SMILES strings and property values lets it generate molecules with desired scaffolds as well as desired properties. The authors use saliency maps to examine the interpretability of the generative process.
Key idea. MolGPT trains a GPT-style transformer-decoder on next token prediction over SMILES strings and conditions generation on scaffolds and property values to control the molecules it produces.
- MolGPT
- LigGPT
- molecular generation
- SMILES
- inverse molecular design
- drug design
- transformer decoder
- conditional molecule generation
- scaffold-conditioned generation
AI-written summary, based on the paper's abstract and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@article{Bagal_2021, title={MolGPT: Molecular Generation Using a Transformer-Decoder Model}, volume={62}, ISSN={1549-960X}, url={http://dx.doi.org/10.1021/acs.jcim.1c00600}, DOI={10.1021/acs.jcim.1c00600}, number={9}, journal={Journal of Chemical Information and Modeling}, publisher={American Chemical Society (ACS)}, author={Bagal, Viraj and Aggarwal, Rishal and Vinod, P. K. and Priyakumar, U. Deva}, year={2021}, month=Oct, pages={2064–2076} }