chandar-lab/AMPLIFY_350M_base

Model

0

stars

9

commits

1

repos using this model

1

linked in READMEs

May 28, 2025

updated

AMPLIFY
biology
custom_code
safetensors

README

AMPLIFY

AMPLIFY is an efficient, state-of-the-art protein language model pre-trained using masked language modeling on UniRef100, OAS, and SCOP (UR100P). AMPLIFY can generate residue and protein embeddings, suggest mutations, differentiate disordered proteins from non-protein sequences, and much more. AMPLIFY is available in two sizes, 120M and 350M parameters, with the _base models not extended beyond 512 residues (Stage 1). The model architecture and pre-training procedure are detailed below. For more details, please refer to the accompanying paper.

Model Descritpion

AMPLIFY 120MAMPLIFY 350M
hidden-size640960
num-hidden-layers2432
num-attention-heads1015
intermediate-size25603840
max-position-embeddings20482048
vocab-size2727
rope-theta1000010000
dropout-prob00
embedding-init-range0.020.02
norm-eps1.0e-051.0e-05
hidden-actswigluswiglu
pre-activation-layer-normtruetrue
layer-norm-after-embeddingfalsefalse
layer-norm-before-last-layertruetrue
rms-normtruetrue
ffn-biasfalsefalse
attn-biasfalsefalse

Training Descritpion

Stage 1Stage 2
datasetUR100PUR100P
max-steps100000025000 (120M) or 50000 (350M)
max-length5122048
optimizeradamwadamw
lr0.0010.0001
betas(0.9, 0.95)(0.9, 0.95)
eps1.0e-081.0e-08
weight-decay0.010.01
schedulercosinedecaynone
warmup-steps1,000none
final-step900,000none
warmup-steps1,000none
gradient-clipping1.01.0
tf32truetrue
mixed-precisionbf16bf16
paddingmax-lengthmax-length
random-truncatetruetrue
mask-probability0.150.15
total-batch-size40964096
deepspeedtruetrue
zero-stage33

Get Started

from transformers import AutoModel
from transformers import AutoTokenizer
from datasets import load_dataset

# Load AMPLIFY and tokenizer
model = AutoModel.from_pretrained("chandar-lab/AMPLIFY_350M", trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained("chandar-lab/AMPLIFY_350M", trust_remote_code=True)

# Move the model to GPU (required due to Flash Attention)
model = model.to("cuda")

# Load the UniProt validation set
dataset = load_dataset("chandar-lab/UR100P", data_dir="UniProt", split="test")

for sample in dataset:
    # Protein
    print("Sample: ", sample["name"], sample["sequence"])

    # Tokenize the protein
    input = tokenizer.encode(sample["sequence"], return_tensors="pt")
    print("Input: ", input)

    # Move to the GPU and make a prediction
    input = input.to("cuda")
    output = model(input)
    print("Output: ", output)

    break

Citations

If you find the models useful in your research, we ask that you cite the paper:

@article{Fournier2024.09.23.614603,
	title        = {Protein Language Models: Is Scaling Necessary?},
	author       = {Fournier, Quentin and Vernon, Robert M. and van der Sloot, Almer and Schulz, Benjamin and Chandar, Sarath and Langmead, Christopher James},
	year         = {2024},
	journal      = {bioRxiv},
	publisher    = {Cold Spring Harbor Laboratory},
	doi          = {10.1101/2024.09.23.614603},
	url          = {https://www.biorxiv.org/content/early/2024/09/23/2024.09.23.614603},
	elocation-id = {2024.09.23.614603},
	eprint       = {https://www.biorxiv.org/content/early/2024/09/23/2024.09.23.614603.full.pdf}
}

Contributors

qfournier

7 commits

davidhd

2 commits

chandar-lab/AMPLIFY_350M_base

Model

0

stars

9

commits

1

repos using this model

1

linked in READMEs

May 28, 2025

updated

AMPLIFY
biology
custom_code
safetensors

README

AMPLIFY

AMPLIFY is an efficient, state-of-the-art protein language model pre-trained using masked language modeling on UniRef100, OAS, and SCOP (UR100P). AMPLIFY can generate residue and protein embeddings, suggest mutations, differentiate disordered proteins from non-protein sequences, and much more. AMPLIFY is available in two sizes, 120M and 350M parameters, with the _base models not extended beyond 512 residues (Stage 1). The model architecture and pre-training procedure are detailed below. For more details, please refer to the accompanying paper.

Model Descritpion

AMPLIFY 120MAMPLIFY 350M
hidden-size640960
num-hidden-layers2432
num-attention-heads1015
intermediate-size25603840
max-position-embeddings20482048
vocab-size2727
rope-theta1000010000
dropout-prob00
embedding-init-range0.020.02
norm-eps1.0e-051.0e-05
hidden-actswigluswiglu
pre-activation-layer-normtruetrue
layer-norm-after-embeddingfalsefalse
layer-norm-before-last-layertruetrue
rms-normtruetrue
ffn-biasfalsefalse
attn-biasfalsefalse

Training Descritpion

Stage 1Stage 2
datasetUR100PUR100P
max-steps100000025000 (120M) or 50000 (350M)
max-length5122048
optimizeradamwadamw
lr0.0010.0001
betas(0.9, 0.95)(0.9, 0.95)
eps1.0e-081.0e-08
weight-decay0.010.01
schedulercosinedecaynone
warmup-steps1,000none
final-step900,000none
warmup-steps1,000none
gradient-clipping1.01.0
tf32truetrue
mixed-precisionbf16bf16
paddingmax-lengthmax-length
random-truncatetruetrue
mask-probability0.150.15
total-batch-size40964096
deepspeedtruetrue
zero-stage33

Get Started

from transformers import AutoModel
from transformers import AutoTokenizer
from datasets import load_dataset

# Load AMPLIFY and tokenizer
model = AutoModel.from_pretrained("chandar-lab/AMPLIFY_350M", trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained("chandar-lab/AMPLIFY_350M", trust_remote_code=True)

# Move the model to GPU (required due to Flash Attention)
model = model.to("cuda")

# Load the UniProt validation set
dataset = load_dataset("chandar-lab/UR100P", data_dir="UniProt", split="test")

for sample in dataset:
    # Protein
    print("Sample: ", sample["name"], sample["sequence"])

    # Tokenize the protein
    input = tokenizer.encode(sample["sequence"], return_tensors="pt")
    print("Input: ", input)

    # Move to the GPU and make a prediction
    input = input.to("cuda")
    output = model(input)
    print("Output: ", output)

    break

Citations

If you find the models useful in your research, we ask that you cite the paper:

@article{Fournier2024.09.23.614603,
	title        = {Protein Language Models: Is Scaling Necessary?},
	author       = {Fournier, Quentin and Vernon, Robert M. and van der Sloot, Almer and Schulz, Benjamin and Chandar, Sarath and Langmead, Christopher James},
	year         = {2024},
	journal      = {bioRxiv},
	publisher    = {Cold Spring Harbor Laboratory},
	doi          = {10.1101/2024.09.23.614603},
	url          = {https://www.biorxiv.org/content/early/2024/09/23/2024.09.23.614603},
	elocation-id = {2024.09.23.614603},
	eprint       = {https://www.biorxiv.org/content/early/2024/09/23/2024.09.23.614603.full.pdf}
}

Contributors

qfournier

7 commits

davidhd

2 commits