All models

molformer

A Transformer encoder for SMILES strings with linear attention and rotary embeddings, used to embed molecules.

Molecules, proteins and genomics · 790 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (38 KB)

Open in a new tab

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
44.4M
Operations
790
Framework
PyTorch
Recurrent
No
Published
Nature Machine Intelligence 2022
Cited by
586 (as of 22 October 2026)
Authors
Jerret Ross, Brian Belgodere, Vijil Chenthamarakshan and others
License
Apache-2.0
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m7392
Graph hash
0f6724fe134f97e0607a2c32ecb459f7ed1a89fa2e2c8fa6a2dd5c045e2346d2
Skeleton hash
af155c55cf31d688b4cfd9b00ae05805e599dbe2f280e954f006da30a14b6460
Architecture hash
5e091efa1f9795fb414d2b8d60a369ea561425de6a0589bd10d02844a8e3b4b7
Diagram SHA-256
4c4ed154cf5c90233406851eeac769b4fbf2e5eef4f792cf3cbefcdae5b31973
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

MoLFormer is a chemical language model, a Transformer encoder trained on small molecules represented as SMILES strings. It is trained by masked language modeling and combines a linear attention Transformer with rotary embeddings. The paper's motivation is that the vast chemical space and the limited availability of property labels make supervised learning challenging.

This model is the MoLFormer-XL version pretrained on 10% of the ZINC molecules and 10% of the PubChem molecules. The paper describes the linear-attention MoLFormer as 12 layers with 12 attention heads per layer and a hidden state size of 768. Its vocabulary has 2362 tokens, 5 of them special tokens, and molecules longer than 202 tokens were dropped from training. A molecule's embedding is the mean of all token embeddings in the last hidden state of the encoder.

Its model card says it is mainly intended as a feature extractor or for fine-tuning on a prediction task, and that it is not intended for molecule generation. The paper reports that linear attention and bucketing reduced the number of GPUs needed for pretraining from roughly 1000 to 16.

Key idea. The paper trained MoLFormer, a linear-attention Transformer encoder with rotary positional embeddings, on SMILES sequences of 1.1 billion unlabeled molecules to obtain molecular embeddings for property prediction.

  • molformer
  • molformer-xl
  • chemical language model
  • smiles transformer
  • molecular embeddings
  • molecular property prediction
  • smiles
  • molecular language model

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{ross2022largescalechemicallanguagerepresentations,
      title={Large-Scale Chemical Language Representations Capture Molecular Structure and Properties}, 
      author={Jerret Ross and Brian Belgodere and Vijil Chenthamarakshan and Inkit Padhi and Youssef Mroueh and Payel Das},
      year={2022},
      eprint={2106.09553},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2106.09553}, 
}