ProteinGLM-7B-CLM
Model Introduction
ProteinGLM-7B-CLM is the open-source version of the latest generative protein language models designed to generate faithful and diverse protein sequences. The ProteinGLM family models are developed by Tsinghua University. Along with this, we have released the int4 quantization ProteinGLM weights and other small models, which include: 1B, 3B, and 10B models trained with masked language modeling for protein understanding, and 1B, 3B, and 7B causal language models aimed at protein design.
Out-of-Distribution Perplexity Evaluation
We evaluated the ProteinGLM-CLM (PGLM) and ProteinGLM-INT4(100B) models on two OOD test sets, one with sequence identity lower than 0.9 with the training set (<0.9 ID) and the other with sequence identity lower than 0.5 with the training set (<0.5 ID). Each OOD dataset comprises approximately 10,000 protein sequences. The perplexity results, compared against ProGen2-xlarge (6.4B), are as follows (lower is better):
Model | ProGen2-xlarge (6.4B) | PGLM (1B) | PGLM (3B) | PGLM (7B) | PGLM-INT4 (100B) |
---|---|---|---|---|---|
< 0.9 ID | 9.7 | 9.8 | 9.3 | 8.9 | 8.7 |
< 0.5 ID | 14.3 | 14.0 | 13.7 | 13.5 | 13.3 |
How to use
from transformers import AutoModelForCausalLM, AutoTokenizer, AutoConfig
import torch
tokenizer = AutoTokenizer.from_pretrained("Bo1015/proteinglm-7b-clm", trust_remote_code=True, use_fast=True)
model = AutoModelForCausalLM.from_pretrained("Bo1015/proteinglm-7b-clm", trust_remote_code=True, torch_dtype=torch.bfloat16)
if torch.cuda.is_available():
model = model.cuda()
model.eval()
gen_kwargs = {'max_length': 256, 'top_p': 0.8, 'temperature':0.9, "num_beams": 1}
prompt=['', 'MLFVVL', 'LDL', 'VTQA']
for idx, each in enumerate(prompt):
print(f"Begin generating idx: {idx} with prompt {each}")
output = model.chat(tokenizer, each, **gen_kwargs)
print(f"\nEnd generation with length: {len(output.split())} - seqs: {output}\n")
LICENSE
The model in this repository is open source under the Creative Commons Attribution-NonCommercial 4.0 International License.
Citations
If you find our work useful, please consider citing the following paper:
@article{chen2024xtrimopglm,
title={xTrimoPGLM: unified 100B-scale pre-trained transformer for deciphering the language of protein},
author={Chen, Bo and Cheng, Xingyi and Li, Pan and Geng, Yangli-ao and Gong, Jing and Li, Shen and Bei, Zhilei and Tan, Xu and Wang, Boyan and Zeng, Xin and others},
journal={arXiv preprint arXiv:2401.06199},
year={2024}
}
@article{cheng2024training,
title={Training Compute-Optimal Protein Language Models},
author={Cheng, Xingyi and Chen, Bo and Li, Pan and Gong, Jing and Tang, Jie and Song, Le},
journal={bioRxiv},
pages={2024--06},
year={2024},
publisher={Cold Spring Harbor Laboratory}
}
- Downloads last month
- 4