Run this model with HF Jobs

Run yerevann/chemma-2b on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs and TRL to fine-tune https://huggingface.co/yerevann/chemma-2b. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/yerevann/chemma-2b on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/yerevann/chemma-2b. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/yerevann/chemma-2b. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

Chemma-2B

Chemma-2B is a 2B-parameter causal language model for molecular generation, property conditioning, property prediction, and optimization. It continues pretraining from Gemma-2B on PubChemForLM: 40 billion tokens describing more than 110 million PubChem molecules, computed properties, and molecular similarities.

Model details

  • Architecture: GemmaForCausalLM; 18 layers, hidden size 2,048, 8 attention heads, 1 key-value head
  • Context length: 2,048 tokens
  • Training objective and precision: causal language modeling in bfloat16
  • Training-data cutoff: January 26, 2023
  • Tokenization: Gemma tokenizer extended with chemistry-specific tags
  • Molecular preprocessing: RDKit-canonicalized SMILES; numeric properties rounded to two decimals

Prompt format

Chemma training samples are separated with <bos>. Generate a molecule by ending a structured property prefix with [START_SMILES]:

<bos>[SAS]2.25[/SAS][SIMILAR]CC(=O)OC1=CC=CC=C1C(=O)O 0.62[/SIMILAR][START_SMILES]

The similarity field is reference SMILES, a space, then the target ECFP Tanimoto similarity. To predict a property, provide the molecule and open the desired property tag:

<bos>[START_SMILES]CC(=O)OC1=CC=CC=C1C(=O)O[END_SMILES][SAS]

Common trained tags include [SAS], [QED], [WEIGHT], [TPSA], [CLOGP], [FORMULA], [RINGCOUNT], and [SIMILAR]. Use only tags present in the training format; arbitrary natural-language instructions or oracle names are unsupported.

Usage

from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "yerevann/chemma-2b"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id, device_map="auto", torch_dtype="auto"
)

prompt = "<bos>[QED]0.80[/QED][START_SMILES]"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
    **inputs, max_new_tokens=128, do_sample=True, temperature=0.8, top_p=0.95
)
print(tokenizer.decode(outputs[0], skip_special_tokens=False))

For optimization, use the Mol-E implementation and canonical PMO prompt registry. In the five-seed PMO-10K reproduction, this checkpoint obtains summed Top-10 AUC scores of 17.500147 (task-agnostic) and 20.550791 (task-informed) across 23 tasks.

Intended use and limitations

This checkpoint is intended for research on small-molecule language modeling and optimization. Generated strings may be invalid, duplicated, chemically implausible, difficult to synthesize, unsafe, or outside the requested property range. Reported properties are predictions or optimization-oracle outputs, not experimental measurements. PubChem-derived data may contain errors or biases, and the model has no knowledge of changes after the cutoff date. Do not use it for clinical decisions or as a substitute for experimental and expert review.

Resources and license

The checkpoint is released under CC BY-NC 4.0. Users must also comply with applicable terms of the base model and source data.

Downloads last month
828
Safetensors
Model size
3B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for yerevann/chemma-2b

Base model

google/gemma-2b
Finetuned
(295)
this model
Quantizations
1 model

Collection including yerevann/chemma-2b

Paper for yerevann/chemma-2b