nanoprot-esm2-M
A protein language model (esm2 architecture) β 147.6M (147,616,000) parameters, trained on 1.77B (1,771,392,000) UniRef50 residues.
nanoprot-esm2-M is part of the nanoprot suite: a Pythia-style matrix of protein
language models spanning three architectures (gpt2, esm2, mamba) and four
scales (XS/S/M/L), each trained from scratch on UniRef50 under a matched,
Chinchilla-style data budget. The suite is built for controlled comparison β
same data, same tokenizer, one variable at a time.
Headline result
Validation masked cross-entropy (bits/residue over masked positions): 3.4934 Β± 0.0024 (n=3 seeds)
This is a masked-LM pseudo-perplexity over masked positions β a different quantity from the autoregressive models' bits-per-residue. Compare
esm2models to each other and on downstream / probing tasks, not via this number againstgpt2/mamba.
Model details
| Architecture | esm2 |
| Objective | MLM (masked-language-modeling) |
| Scale rung | M |
| Parameters | 147.6M (147,616,000) |
| Layers (depth) | 30 |
| Hidden size (d_model) | 640 |
| Attention heads | 20 |
| Max sequence length | 512 |
| Vocabulary | 33-token residue alphabet (ESM-2) |
| norm | layernorm |
| MLP activation | gelu |
| Precision | bf16 |
Training
| Data | UniRef50 release 2026_01 (28-Jan-2026), 60,251,814 sequences; held-out final shard for validation |
| Tokenizer | esm2 β 33-token residue alphabet (shared across the whole suite) |
| Optimizer | Muon (matrices) + AdamW (embeddings/scalars), weight_decay=0.1 |
| Batch size | 524,288 residues/step |
| Optimizer steps | 3,378 |
| Residues seen | 1.77B (1,771,392,000) |
| Param/data ratio | 12.0 (Chinchilla-style) |
| Total FLOPs | 1.777e+18 |
| Wall-clock | 0.90 h (54 min) on 4 GPU(s) |
| Seed | 0 (siblings: see below) |
| nanoprot version | 0.5.0 |
Evaluation
Evaluated on a held-out UniRef50 shard. Validation masked cross-entropy (bits/residue over masked positions): 3.4934 Β± 0.0024 (n=3 seeds).
This is a masked-LM pseudo-perplexity over masked positions β a different quantity from the autoregressive models' bits-per-residue. Compare esm2 models to each other and on downstream / probing tasks, not via this number against gpt2/mamba.
Intended use & limitations
Research use: learning protein representations, extracting residual-stream features, mechanistic-interpretability probing, and architecture comparison. Trained only on UniRef50 sequences β not for clinical or diagnostic use, and not aligned to any downstream task out of the box.
How to load
Install nanoprot (pip install nanoprot), download this repo, and point the
arch-aware loader at the folder β it works for any nanoprot architecture
(gpt2 / esm2 / mamba), reading the embedded config and selecting the right
tokenizer automatically.
from nanoprot.training.checkpoint import load_pretrained
model, cfg, meta, tokenizer = load_pretrained(
"path/to/this/repo", device="cpu", return_tokenizer=True,
)
model.eval()
# meta carries the trained-artifact facts (params, FLOPs, val metric, ...)
The nanoprot suite
Hub: yagizdevre/nanoprot-esm2-M (seed 0 is the default; siblings on branches seed1,
seed2). This model's sibling seeds:
nanoprot-esm2-M-s0β final masked-cross-entropy-bits 3.4916nanoprot-esm2-M-s1β final masked-cross-entropy-bits 3.4961nanoprot-esm2-M-s2β final masked-cross-entropy-bits 3.4924
The full suite spans {gpt2, esm2, mamba} x {XS, S, M, L} x {seed 0,1,2}.
See the nanoprot repository for the
complete grid and the scaling-curve comparisons.
Citation
@software{nanoprot,
author = {Devre, H. Yagiz},
title = {nanoprot: a minimal training framework for protein language models},
year = {2026},
url = {https://github.com/ygzdvr/nanoprot}
}
Reproducibility
Trained with nanoprot v0.5.0 (corpus prepared 2026-06-01T12:51:52+00:00). The exact, complete training
config is in config.yaml (also embedded in meta_003378.json).
Re-train with:
python -m scripts.train --config config.yaml
- Downloads last month
- 7
Collection including yagizdevre/nanoprot-esm2-M
Evaluation results
- masked-cross-entropy-bits on UniRef50 (held-out shard)self-reported3.493