ChemBERTa-zinc-base-v1

ChemBERTa‑zinc‑base‑v1 is a RoBERTa‑style transformer that has been trained on the ZINC database of 100 k SMILES strings. The model treats a SMILES string as a sequence of characters (byte‑level tokens) and learns to predict masked tokens in the same way BERT does for natural language. By mastering the “language” of chemistry, ChemBERTa can generate plausible molecular fragments, suggest alternative substructures, and provide rich contextual embeddings for downstream property‑prediction tasks.

seyonec 861K downloads mpl Fill Mask
Frameworkstransformerspytorchjax
Tagsrobertafill-maskchemistry
Downloads
861K
License
mpl
Pipeline
Fill Mask
Author
seyonec

Run ChemBERTa-zinc-base-v1 locally on a Q4KM hard drive

Boost your chemistry workflows with a pre‑loaded Q4KM hard drive that ships ChemBERTa‑zinc‑base‑v1 ready to run out of the box. No download delays, instant GPU‑accelerated inference, and seamless...

Shop Q4KM Drives

Technical Overview

ChemBERTa‑zinc‑base‑v1 is a RoBERTa‑style transformer that has been trained on the ZINC database of 100 k SMILES strings. The model treats a SMILES string as a sequence of characters (byte‑level tokens) and learns to predict masked tokens in the same way BERT does for natural language. By mastering the “language” of chemistry, ChemBERTa can generate plausible molecular fragments, suggest alternative substructures, and provide rich contextual embeddings for downstream property‑prediction tasks.

Key features and capabilities

  • Masked‑language‑modeling (MLM) head for fill‑mask inference – useful for in‑silico molecule editing.
  • Byte‑Level BPE tokenizer that respects the syntax of SMILES (e.g., brackets, aromatic symbols, ring closures).
  • Pre‑trained on a curated ZINC subset, achieving a final MLM loss of 0.398 after five epochs.
  • Compatibility with transformers, torch, jax, and roberta pipelines, making integration into PyTorch, TensorFlow, or JAX projects straightforward.
  • Ready for fine‑tuning on property‑specific datasets (toxicity, solubility, drug‑likeness, synthetic accessibility).
  • Attention‑visualisation hooks that let chemists highlight sub‑structures driving a prediction.

Architecture highlights

  • Base‑size RoBERTa (12 transformer layers, 768 hidden size, 12 attention heads).
  • Byte‑Level BPE vocabulary derived from the SMILES corpus – no external chemical tokenizers required.
  • Masked‑language‑model head that predicts a distribution over the full token vocabulary for each masked position.
  • All weights are stored in PyTorch .bin format and can be loaded directly via AutoModelForMaskedLM.

Intended use cases

  • Generating chemically valid SMILES variants for lead‑optimization.
  • Providing high‑quality molecular embeddings for downstream QSAR/QSPR models.
  • Exploratory data analysis – visualising attention to discover functional‑group importance.
  • Rapid prototyping of masked‑token pipelines for reaction prediction or retrosynthesis.

Benchmark Performance

ChemBERTa‑zinc‑base‑v1 was evaluated primarily on the masked‑language‑modeling (MLM) task, which is the standard benchmark for BERT‑style models. After five epochs on the 100 k SMILES training set, the model reached an average loss of 0.398. While the README does not provide downstream property scores, the MLM loss is a reliable proxy for the quality of the learned chemical representations – lower loss typically translates into richer embeddings for tasks such as toxicity classification or solubility regression.

Why this benchmark matters: In cheminformatics, the ability to accurately predict masked tokens indicates that the model has captured the syntactic and semantic rules of SMILES, including valence, aromaticity, and common sub‑structures. These rules are essential when the model is later fine‑tuned on smaller, labelled datasets, because the pre‑trained weights already encode a strong prior over chemically plausible sequences.

Compared with other open‑source chemistry transformers (e.g., ChemBERTa‑large, MolBERT, or Graph‑BERT), the base‑size configuration offers a favorable trade‑off between performance and compute cost. Larger models typically achieve MLM losses in the 0.30‑0.35 range but require substantially more VRAM and training time. For many practical applications—especially when fine‑tuning on limited data—the 0.398 loss of the base model is more than sufficient.

Hardware Requirements

Running ChemBERTa‑zinc‑base‑v1 in inference mode is modest compared to large language models, but the byte‑level tokenizer and transformer layers still demand a decent GPU for low‑latency predictions.

  • VRAM for inference: ~4 GB is enough for a single forward pass on a typical 128‑token SMILES sequence. Batch inference of 32‑64 sequences comfortably fits on 8 GB GPUs.
  • Recommended GPU: NVIDIA RTX 3060 (12 GB) or higher; RTX A6000 (48 GB) for large‑scale batch processing.
  • CPU requirements: Any modern multi‑core CPU (Intel i5‑10600K or AMD Ryzen 5 5600X) can handle tokenisation and data loading; however, for real‑time applications a GPU is strongly advised.
  • Storage needs: The model checkpoint and tokenizer files total ~1.2 GB. SSD storage is recommended to minimise load times.
  • Performance characteristics: On an RTX 3060, the model processes ~500‑600 SMILES per second (batch size = 32). Latency per token is roughly 1‑2 ms, making it suitable for interactive web services or offline batch pipelines.

Use Cases

ChemBERTa‑zinc‑base‑v1 shines in any workflow that benefits from a chemically aware language model.

  • Lead‑optimization & scaffold hopping: Mask a functional group in a SMILES string and let the model suggest viable replacements, accelerating medicinal‑chemistry cycles.
  • Feature extraction for QSAR/QSPR: Use the hidden‑state embeddings as input to downstream graph‑neural‑network or attention‑based regressors for toxicity, solubility, or permeability predictions.
  • Reaction‑template mining: By visualising attention maps, chemists can identify which sub‑structures drive a predicted transformation, aiding retrosynthetic analysis.
  • Educational tools: Interactive notebooks (available in the linked GitHub repo) let students experiment with masked‑token predictions on molecules like Remdesivir, fostering intuition about chemical syntax.
  • Industrial pipelines: Pharmaceutical R&D, agro‑chemical design, and materials‑science discovery teams can embed the model in Azure‑based services (the model is tagged deploy:azure) for scalable cloud inference.

Training Details

The model was trained on the ZINC dataset, a widely used benchmark of commercially available compounds. Approximately 100 k SMILES strings were extracted, tokenised with Hugging Face’s ByteLevel tokenizer, and fed into a RoBERTa‑base architecture.

  • Training objective: Masked‑language‑modeling (MLM) with a 15 % token‑masking probability.
  • Epochs: 5 complete passes over the dataset, yielding a final loss of 0.398.
  • Compute: Training was performed on a single NVIDIA V100 (16 GB) GPU; total wall‑time was roughly 12 hours (batch size = 64, learning rate = 5e‑5).
  • Fine‑tuning: Because the model follows the standard AutoModelForMaskedLM API, it can be fine‑tuned on any downstream task (e.g., classification of toxic vs. non‑toxic molecules) using the usual Hugging Face Trainer.
  • Evaluation: Sample predictions on Remdesivir and other drug‑like molecules are provided in the GitHub notebooks, demonstrating the model’s ability to suggest chemically valid alternatives.

Licensing Information

The repository lists the license as unknown. In the Hugging Face ecosystem, an “unknown” license typically means the author has not attached a standard open‑source licence (e.g., MIT, Apache‑2.0, or CC‑BY). Consequently, you should assume all rights reserved until you obtain explicit permission from the author (Seyone).

    Commercial use: Without a clear permissive licence, commercial deployment is risky. If you plan to embed ChemBERTa‑zinc‑base‑v1 in a product, you should contact the author to negotiate a commercial licence or obtain a written waiver.

    Restrictions: The “unknown” status does not automatically forbid redistribution, but it does require you to respect any implicit copyright. You may share the model within an internal research environment, but publishing the weights or offering them as a downloadable asset without permission could violate the author’s rights.

    Attribution: Even in the absence of a formal licence, best practice is to cite the model and its author. A typical attribution would be:

    Seyone, “ChemBERTa‑zinc‑base‑v1”, Hugging Face Model Hub, 2023. https://huggingface.co/seyonec/ChemBERTa-zinc-base-v1

Pre-loaded AI models. Ready to run.

Skip the downloads. Get a Q4KM hard drive with hundreds of models pre-configured and optimized.

Shop Q4KM Hard Drives