IBM/materials
Foundation Model for Materials - FM4M
IBM /materials – Foundation Models for Materials (FM4M)
What it is
- A collection of open‑source, pre‑trained foundation models that understand different representations of molecules and materials (SMILES strings, SELFIES strings, molecular graphs, 3‑D atom positions, electron‑density grids, etc.).
- Each model is trained on massive chemistry datasets (up to 91 M SMILES, >1 B molecules, >1.5 M 3‑D structures) and can be used either as‑is for feature extraction or fine‑tuned for downstream tasks such as property prediction, quantum‑property regression, or generative design.
- The repo ships a thin wrapper called FM4M‑Kit that lets you call any of the models through a unified Python API or a simple web UI hosted on Hugging Face Spaces.
Key models
| Model | Modality | Core architecture | Typical use‑case |
|---|---|---|---|
| SMI‑TED | SMILES strings | Transformer encoder‑decoder (≈289 M parameters) | Quantum property prediction, sequence‑to‑sequence tasks |
| SMI‑SSED | SMILES strings | Mamba‑based encoder‑decoder (fast inference) | Same as SMI‑TED but with higher speed |
| SELFIES‑TED | SELFIES strings | BART‑style transformer | Property prediction and auto‑regressive molecule generation |
| MHG‑GED | Molecular graphs | GNN encoder + Molecular Hypergraph Grammar decoder | Valid‑molecule generation and graph‑based regression |
| POS‑EGNN | 3‑D atomistic graphs | Equivariant geometric tensor network | Machine‑learning potentials for MD simulations |
| 3DGrid‑VQGAN | 3‑D electron‑density grids | VQ‑GAN encoder‑decoder | Compress high‑dimensional quantum data into latent vectors |
| SMILESDFT‑CLIP | Multimodal (SMILES + 3‑D density) | Joint VQ‑GAN + transformer (contrastive) | Learn aligned representations across string and field modalities |
| MOL‑MOE | Multi‑view (SMILES, SELFIES, graph) | Mixture‑of‑Experts | Fuse complementary views for higher‑accuracy property prediction |
| STR‑Bamba | String (SMILES/SELFIES) | Hybrid Transformer‑Mamba‑2 | Flexible handling of multiple string encodings |
| TDiMS | Descriptor (SMILES) | Topological distance of intra‑molecular substructures | Lightweight, interpretable features – no pre‑training needed |
How to get started
- Create a Conda environment
conda create -n fm4m python=3.9.8 conda activate fm4m - Install dependencies
pip install -r requirements.txt # Install torch‑scatter matching your CUDA version, e.g.: pip install torch-scatter -f https://data.pyg.org/whl/torch-$(python -c "import torch; print(torch.__version__.split('+')[0])")+cu118.html - Pick a usage style
- Direct model – go into
models/<model_name>/and follow the README/notebook there. - FM4M‑Kit (recommended) – import the wrapper and call a single function:
import fm4m # Extract features from SELFIES‑TED feats = fm4m.get_representation(model="selfies-ted", data=my_smiles) # Train a downstream regressor on a single model score = fm4m.single_modal( model="MHG-GED", x_train=X_train, y_train=y_train, x_test=X_test, y_test=y_test, downstream_model="DefaultRegressor" ) # Combine several modalities score = fm4m.multi_modal( model_list=["SELFIES-TED", "MHG-GED", "SMI-TED"], x_train=X_train, y_train=y_train, x_test=X_test, y_test=y_test, downstream_model="DefaultRegressor" ) - Web UI – open the Hugging Face Space linked from the repo and use the drag‑and‑drop interface to upload data, select models, and run a quick XGBoost downstream task.
- Direct model – go into
Repository layout
materials/
├─ models/ # One folder per uni‑modal model (smi_ted/, selfies_ted/, …)
│ ├─ fm4m.py # Core wrapper utilities
│ └─ …
├─ examples/ # Jupyter notebooks showing end‑to‑end pipelines
│ ├─ fm4m_example.ipynb
│ └─ battery_example.ipynb
├─ requirements.txt # Python dependencies
└─ README.md (this file)
When to use FM4M
- You have chemical or materials data (SMILES, graphs, 3‑D structures) and need high‑quality embeddings without training a model from scratch.
- You want to compare how different molecular representations affect a downstream prediction.
- You need a pre‑trained ML potential (POS‑EGNN) to run molecular dynamics at near‑DFT accuracy.
- You are interested in generative chemistry (SELFIES‑TED, MHG‑GED) that produces syntactically valid molecules.
Community & support
- Open‑source under an IBM‑friendly license; contributions are welcomed via pull requests.
- Models are hosted on Hugging Face with a GUI for quick exploration.
- The team runs regular tutorials and workshops (MRS 2025, AAAI 2025, NeurIPS 2024, etc.) and maintains a working group in the AI Alliance.
References
- The README lists a paper for each model (Nature Communications Chemistry 2025, NeurIPS 2024, etc.) for deeper technical details.
In short, IBM/materials provides a ready‑to‑use toolbox of large‑scale, multimodal foundation models that bring state‑of‑the‑art AI to materials science and chemistry research.
Related
- Project
- Project
- Project
- Project