Views
No views yet

| Model Arch | Value |
|---|---|
| Num Attention Head | 40 |
| Num Hidden Layer | 36 |
| Hidden Size | 2560 |
| FFN Hidden Size | 6832 |
| Context Length | 12.8K |
HHblits_MSA. The remaining 29.9 million sequences were input into MSA Retriever, resulting in 7.7 million sequences with more than 25 homologous sequences. This dataset was designated as Retriever_MSA. During training, RAGPLM randomly sampled from the two datasets with probabilities of 0.75 and 0.250.05×L span positions from a query sequence of length L, with span lengths following a geometric distribution (p=0.2), and capped the maximum length at 10. Our experiments revealed that this settings lead to an average of 15% of the query tokens were masked. (2) To prevent information leakage, when a residue was selected, all residues at the same index across all sequences (the column of the MSA matrix) were also masked. (3) When a column of MSA was selected for masking, the entire column was replaced with the <MASK> token in 80% of cases, with random amino acids in 10% of cases, and remained unchanged in the remaining 10% of cases. To help the model distinguish which tokens are from the same chain and which tokens have the same residue index, we use 2D rotary position embedding to encode the tokens.| MLM-3B | GB.Protein-RAG-3B | |
|---|---|---|
| Training data | UniRef+ColabFoldDB | HHblits_MSA, Retriever_MSA |
| Initial params | Random | MLM-3B |
| Learning rate | 2.5e-4 | 1e-4 |
| Training tokens | 1000B | 100B |
| Batch size | 2560 | 256 |
| Micro batch size | 4 | 1 |
| Sample length | 1024 | 12,800 |
| Attention | Bi-directional | Bi-directional |
[SEP] token as hooks for downstream tasks.


1mgen fit --model SequenceClassification --model.backbone aido_protein_rag_3b --data SequenceClassificationDataModule --data.path <hf_or_local_path_to_your_dataset>
2mgen test --model SequenceClassification --model.backbone aido_protein_rag_3b --data SequenceClassificationDataModule --data.path <hf_or_local_path_to_your_dataset>1import torch
2from modelgenerator.tasks import Embed
3model = Embed.from_config({"model.backbone": "aido_protein_rag_3b"}).eval()
4model.backbone.max_length = 12800
5restypes = 'ARNDCQEGHILKMFPSTWYV'
6data = {
7 'sequences': [''.join(random.choice(restypes) for _ in range(50))],
8 'msa': [ [ ''.join(random.choice(restypes+'-') for _ in range(50)) for _ in range(25) ] ],
9 'str_emb': np.random.normal(size=(1, 50, 384))
10}
11transformed_batch = model.transform(data)
12with torch.no_grad():
13 embedding = model(transformed_batch)
14
15print(embedding.shape)1import torch
2from modelgenerator.tasks import SequenceClassification
3model = SequenceClassification.from_config({"model.backbone": "aido_protein_rag_3b", "model.n_classes": 2}).eval()
4model.backbone.max_length = 12800
5restypes = 'ARNDCQEGHILKMFPSTWYV'
6data = {
7 'sequences': [''.join(random.choice(restypes) for _ in range(50))],
8 'msa': [ [ ''.join(random.choice(restypes+'-') for _ in range(50)) for _ in range(25) ] ],
9 'str_emb': np.random.normal(size=(1, 50, 384))
10}
11transformed_batch = model.transform(data)
12with torch.no_grad():
13 logits = model(transformed_batch)
14
15print(logits)
16print(torch.argmax(logits, dim=-1))1import torch
2from modelgenerator.tasks import TokenClassification
3model = TokenClassification.from_config({"model.backbone": "aido_protein_rag_3b", "model.n_classes": 3}).eval()
4model.backbone.max_length = 12800
5restypes = 'ARNDCQEGHILKMFPSTWYV'
6data = {
7 'sequences': [''.join(random.choice(restypes) for _ in range(50))],
8 'msa': [ [ ''.join(random.choice(restypes+'-') for _ in range(50)) for _ in range(25) ] ],
9 'str_emb': np.random.normal(size=(1, 50, 384))
10}
11transformed_batch = model.transform(data)
12with torch.no_grad():
13 logits = model(transformed_batch)
14
15print(logits)
16print(torch.argmax(logits, dim=-1))1import torch
2from modelgenerator.tasks import SequenceRegression
3model = SequenceRegression.from_config({"model.backbone": "aido_protein_rag_3b"}).eval()
4model.backbone.max_length = 12800
5restypes = 'ARNDCQEGHILKMFPSTWYV'
6data = {
7 'sequences': [''.join(random.choice(restypes) for _ in range(50))],
8 'msa': [ [ ''.join(random.choice(restypes+'-') for _ in range(50)) for _ in range(25) ] ],
9 'str_emb': np.random.normal(size=(1, 50, 384))
10}
11transformed_batch = model.transform(data)
12with torch.no_grad():
13 logits = model(transformed_batch)
14
15print(logits.shape)@article {Li2024.12.02.626519,
author = {Li, Pan and Cheng, Xingyi and Song, Le and Xing, Eric},
title = {Retrieval Augmented Protein Language Models for Protein Structure Prediction},
url = {https://www.biorxiv.org/content/10.1101/2024.12.02.626519v1},
year = {2024},
doi = {10.1101/2024.12.02.626519},
publisher = {bioRxiv},
booktitle={NeurIPS 2024 Workshop on Machine Learning in Structural Biology},
}