Antibody language models (AbLMs) help decode immune repertoires for therapeutic discovery, but optimal scaling strategies remain unclear. We trained
ESM-2-based AbLMs across five sizes (8M–650M parameters) and three paired Ab sequences dataset scales (~1.6M total sequences). Results described in our preprint on biorxiv. Effective AbLM scaling requires balancing model size with data availability to avoid diminishing returns.Datasets used for pre-training are avaliable on [Zenodo] and code is avaliable on ...
1from transformers import EsmTokenizer, EsmForMaskedLM
2
3model = EsmForMaskedLM.from_pretrained("brineylab/8M_half_checkpoint-435000")
4tokenizer = EsmTokenizer.from_pretrained("brineylab/650M_quarter_checkpoint-130000")
The model can be finetuned for classification tasks (such as specificity and pair classification in the paper) by loading the model with a sequence classification head:
1from transformers import EsmForSequenceClassification
2
3model = EsmForSequenceClassification.from_pretrained("brineylab/650M_quarter_checkpoint-130000")
4
5# freeze the base model weights prior to finetuning
6for param in model.base_model.parameters():
7 param.requires_grad = False