Downloads · 30 days
0
ChangwenXu/CLOUD
CLOUD is a fill-mask model from ChangwenXu. Use it when you need the model to fill a missing word. It is set up for transformers. The card lists the license as mit.
CLOUD (Crystal Language mOdel for Unified and Differentiable materials modeling) is a Transformer-based foundation model that learns crystal representations from string encodings of crystal structures. Crystals are se…
Downloads · 30 days
0
Access
Public
Updated May 6, 2026
Repo size
531 MB
Likes
0
Public
Click a slice to open those files.
.safetensors531 MB · 100%
From the Hugging Face model README
CLOUD (Crystal Language mOdel for Unified and Differentiable materials modeling) is a Transformer-based foundation model that learns crystal representations from string encodings of crystal structures. Crystals are serialized with a novel Symmetry-Consistent Ordered Parameter Encoding (SCOPE), a compact, coordinate-free representation that captures space-group symmetry, Wyckoff positions, and composition. The model can be fine-tuned for accurate, generalizable, and scalable property prediction, and can be combined with physics laws (e.g. the Debye model) for thermodynamic-consistent predictions.
| Architecture | BERT encoder (BertForMaskedLM) |
| Hidden size | 768 |
| Hidden layers | 12 |
| Attention heads | 12 |
| Intermediate size | 3072 |
| Max sequence length | 64 |
| Vocab size | 30522 (custom SCOPE tokenizer) |
| Parameters | ~110M |
| Precision | float32 |
| Pretraining objective | Masked language modeling on SCOPE strings |
| Pretraining data | ~6M crystal structures from OPTIMADE |
ckpt/
├── config.json # BertForMaskedLM config
├── generation_config.json
├── model.safetensors # Pretrained weights (~530 MB)
├── training_args.bin # HF Trainer arguments used for pretraining
├── tokenizer_config.json # SCOPE tokenizer config
├── special_tokens_map.json
├── added_tokens.json
└── vocab.txt # SCOPE vocabulary
from transformers import AutoTokenizer, AutoModelForMaskedLM
tokenizer = AutoTokenizer.from_pretrained("ChangwenXu/CLOUD", subfolder="ckpt")
model = AutoModelForMaskedLM.from_pretrained("ChangwenXu/CLOUD", subfolder="ckpt")
CLOUD operates on SCOPE string representations. Use the conversion utility from the code repository to turn a CIF file into a SCOPE string:
git clone https://github.com/BattModels/CLOUD.git
cd CLOUD
python structure_to_str.py --dir <path_to_cif> --out <output_path> \
--numproc <num_of_processes> --batchsize <batch_size>
import torch
from transformers import AutoTokenizer, AutoModel
tokenizer = AutoTokenizer.from_pretrained("ChangwenXu/CLOUD", subfolder="ckpt")
encoder = AutoModel.from_pretrained("ChangwenXu/CLOUD", subfolder="ckpt")
encoder.eval()
scope_string = "..." # SCOPE representation produced by structure_to_str.py
inputs = tokenizer(scope_string, return_tensors="pt", padding=True, truncation=True, max_length=64)
with torch.no_grad():
outputs = encoder(**inputs)
# Pooled [CLS] embedding for the crystal:
crystal_embedding = outputs.last_hidden_state[:, 0]
Recipes for fine-tuning on MatBench, UnconvBench, MatBench Discovery / WBM, and the physics-informed CLOUD-DEBYE variant are provided in the GitHub repository (train.py, train_mp.py, wbm_predict.py, train_debye.py).
If you find CLOUD useful in your research, please cite:
@article{xu2026cloud,
title = {{CLOUD}: A Scalable and Physics-Informed Foundation Model for Crystal Representation Learning},
author = {Xu, Changwen and Zhu, Shang and Viswanathan, Venkatasubramanian},
journal = {Nature Communications},
volume = {17},
number = {1},
pages = {4074},
year = {2026},
doi = {10.1038/s41467-026-70467-3}
}
@inproceedings{xu2024cloud,
title = {{CLOUD}: A Scalable Scientific Foundation Model for Crystal Representation Learning},
author = {Xu, Changwen and Zhu, Shang and Viswanathan, Venkatasubramanian},
booktitle = {NeurIPS 2024 Workshop on Foundation Models for Science: Progress, Opportunities, and Challenges},
year = {2024}
}
Released under the MIT License, © 2025 Changwen Xu.