card for benchmark eba8e0f953ffead6
Browse files
README.md
CHANGED
|
@@ -1,60 +1,118 @@
|
|
| 1 |
---
|
| 2 |
license: cc-by-4.0
|
| 3 |
-
pretty_name:
|
|
|
|
|
|
|
| 4 |
tags:
|
| 5 |
- protein
|
|
|
|
| 6 |
- masked-language-modeling
|
| 7 |
- benchmark
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
#
|
| 11 |
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
|
| 19 |
-
|
|
|
|
| 20 |
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
|
|
|
|
|
|
| 28 |
|
| 29 |
## Splits
|
| 30 |
|
| 31 |
-
| Split | Proteins | Families | Residues | Scored (masked) residues |
|
| 32 |
|---|---|---|---|---|---|
|
| 33 |
-
|
|
|
|
|
| 34 |
| val_select | 4,751 | 4,751 | 1,066,372 | 156,231 | 1,024 |
|
| 35 |
-
| validation | 25,459 | 4,751 | 5,919,918 | 889,145 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
## Files
|
| 38 |
|
| 39 |
-
| File |
|
| 40 |
-
|---|---|
|
| 41 |
-
| `
|
| 42 |
-
| `
|
| 43 |
-
| `
|
| 44 |
-
| `
|
| 45 |
-
| `
|
| 46 |
-
| `
|
| 47 |
-
| `
|
| 48 |
-
| `
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
`train_tokens.u8` and `train_three_di.u8` are flat uint8 streams, `train_offsets.i64` the int64 start of every
|
| 53 |
-
protein, `probe_subset.i64` the probe subset's indices, `train_families.json` the family of every training protein;
|
| 54 |
-
`val_select.pt`, `validation.pt` and `test.pt` hold padded `input_ids`, `masked`, `three_di`, `family` and `lengths`
|
| 55 |
-
tensors and the list of `families`. `speedrunning_plms.benchmark.load_train` and `load_held_out` read them and verify the digests.
|
| 56 |
|
| 57 |
## Source and terms
|
| 58 |
|
| 59 |
-
AlphaFold
|
| 60 |
-
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: cc-by-4.0
|
| 3 |
+
pretty_name: SpeedrunningPLMs
|
| 4 |
+
task_categories:
|
| 5 |
+
- fill-mask
|
| 6 |
tags:
|
| 7 |
- protein
|
| 8 |
+
- protein-language-model
|
| 9 |
- masked-language-modeling
|
| 10 |
- benchmark
|
| 11 |
+
- speedrun
|
| 12 |
+
- alphafold
|
| 13 |
+
- foldseek
|
| 14 |
+
size_categories:
|
| 15 |
+
- 1M<n<10M
|
| 16 |
---
|
| 17 |
|
| 18 |
+
# SpeedrunningPLMs: the benchmark data
|
| 19 |
|
| 20 |
+
**Train a protein language model in ten minutes on one GPU, and know exactly how good it is.** This is the fixed data
|
| 21 |
+
of [SpeedrunningPLMs](https://github.com/Synthyra/SpeedrunningPLMs), a masked language model speedrun on proteins: 1,754,034 training
|
| 22 |
+
proteins from the AlphaFold Database as one token stream, and held-out splits whose masks are drawn once, so every
|
| 23 |
+
run, every seed and every reference model is scored on the same hidden residues. No held-out protein has a training
|
| 24 |
+
relative at 30 percent sequence identity over 80 percent coverage, by sequence (MMseqs2) or by structure (Foldseek), so
|
| 25 |
+
a lower loss means a model that generalizes across protein families, not one that remembers them.
|
| 26 |
|
| 27 |
+
The benchmark id `eba8e0f953ffead6` is the SHA-256 of `manifest.json`; every result carries it, and two results
|
| 28 |
+
compare only when it agrees.
|
| 29 |
|
| 30 |
+
## What a run does with it
|
| 31 |
+
|
| 32 |
+
| Step | Rule |
|
| 33 |
+
|---|---|
|
| 34 |
+
| Corruption | 15 percent of the standard residues are replaced by MASK, nothing else; CLS, EOS and padding are never masked. Training uses the same corruption. |
|
| 35 |
+
| Loss | Cross entropy over the 20 standard residues at the masked positions, in nats per masked residue. A model with a larger vocabulary (ESM2 has 33 tokens, ESMC 64) is scored on its 20 residue columns, so every model faces the same 20-way problem. |
|
| 36 |
+
| Clock | Ten minutes of applied training steps on one GPU. Compile warmup and in-run validation are outside the clock and capped. |
|
| 37 |
+
| Selection | The weights with the lowest loss on `val_select` (one protein per validation family, at most 1,024 tokens) are scored once on the full validation and test splits at full length (at most 2,048 tokens). The headline is the test loss. |
|
| 38 |
+
| Structure probe | A linear probe from the hidden states to the 20 Foldseek 3Di states, trained on the fixed 20,000-protein subset and scored on validation and test. Reported beside the loss, never used for selection. |
|
| 39 |
|
| 40 |
## Splits
|
| 41 |
|
| 42 |
+
| Split | Proteins | Families | Residues | Scored (masked) residues | Max tokens |
|
| 43 |
|---|---|---|---|---|---|
|
| 44 |
+
| train | 1,754,034 | 333,143 | 389,084,153 | drawn each step | free |
|
| 45 |
+
| test | 25,778 | 4,807 | 6,098,489 | 915,208 | 2,048 |
|
| 46 |
| val_select | 4,751 | 4,751 | 1,066,372 | 156,231 | 1,024 |
|
| 47 |
+
| validation | 25,459 | 4,751 | 5,919,918 | 889,145 | 2,048 |
|
| 48 |
+
|
| 49 |
+
Families are disjoint across the three splits, inherited from the Alignment Atlas family split of the AlphaFold
|
| 50 |
+
Database (`Synthyra/alignment_atlas_families_afdb_v6` at `83737fa33e72`). `val_select` is a subset of validation: each
|
| 51 |
+
family's longest representative, truncated, for the in-run selection; the full splits are scored once at the end.
|
| 52 |
+
Lengths run from 50 to 2,046 residues, and every result reports the loss by length bin (50 to 99, 100 to 249, 250 to
|
| 53 |
+
499, 500 to 999, 1,000 and more).
|
| 54 |
+
|
| 55 |
+
## Where models stand
|
| 56 |
+
|
| 57 |
+
Test loss on this data, every model scored by the same evaluator on the same masked residues. The reference models
|
| 58 |
+
trained for days on UniRef, which shares sequences with these proteins, so their rows are a comparator rather than
|
| 59 |
+
a fair baseline; the ten-minute record and the full table live in the [code repository](https://github.com/Synthyra/SpeedrunningPLMs).
|
| 60 |
+
|
| 61 |
+
| Model | Trained on | Test loss |
|
| 62 |
+
|---|---|---|
|
| 63 |
+
| unigram residue frequencies | the floor | 2.8933 |
|
| 64 |
+
| ESM2 8M | UniRef50, days | 2.6253 |
|
| 65 |
+
| ESM2 35M | UniRef50, days | 2.4992 |
|
| 66 |
+
| ESM2 150M | UniRef50, days | 2.3303 |
|
| 67 |
+
| ESM2 650M | UniRef50, days | 2.0710 |
|
| 68 |
+
| ESM2 3B | UniRef50, days | 1.8705 |
|
| 69 |
+
| ESMC 300M | UniRef and more, days | 2.1269 |
|
| 70 |
+
| ESMC 600M | UniRef and more, days | 2.0510 |
|
| 71 |
+
| ESMC 6B | UniRef and more, days | 1.6891 |
|
| 72 |
+
|
| 73 |
+
## Loading
|
| 74 |
+
|
| 75 |
+
```bash
|
| 76 |
+
pip install git+https://github.com/Synthyra/SpeedrunningPLMs
|
| 77 |
+
```
|
| 78 |
+
|
| 79 |
+
```python
|
| 80 |
+
from pathlib import Path
|
| 81 |
+
|
| 82 |
+
from huggingface_hub import snapshot_download
|
| 83 |
+
from speedrunning_plms import benchmark
|
| 84 |
+
|
| 85 |
+
data_dir = Path(snapshot_download("Synthyra/SpeedrunningPLMs", repo_type="dataset"))
|
| 86 |
+
stream = benchmark.load_train(data_dir) # memory-mapped tokens, offsets, 3Di states, probe subset
|
| 87 |
+
protein = stream.protein(0) # (length + 2,) uint8: CLS, residues, EOS
|
| 88 |
+
test = benchmark.load_held_out(data_dir, "test") # tensors sorted by descending length, digests verified
|
| 89 |
+
metrics = benchmark.evaluate_split(model, test, device) # any model exposing logits and its 20 residue columns
|
| 90 |
+
```
|
| 91 |
+
|
| 92 |
+
The files need no library to read: the streams are flat NumPy arrays (`np.memmap("train_tokens.u8", dtype=np.uint8)`)
|
| 93 |
+
and the held-out files are `torch.load` dictionaries. Token ids are ESM2's: CLS 0, PAD 1, EOS 2, MASK 32, and the
|
| 94 |
+
residues A 5, C 23, D 13, E 9, F 18, G 6, H 21, I 12, K 15, L 4, M 20, N 17, P 14, Q 16, R 10, S 8, T 11, V 7, W 22, Y 19. The 3Di classes index Foldseek's alphabet `ACDEFGHIKLMNPQRSTVWY` in order, with
|
| 95 |
+
255 at positions that are not residues.
|
| 96 |
|
| 97 |
## Files
|
| 98 |
|
| 99 |
+
| File | Size | What it holds |
|
| 100 |
+
|---|---|---|
|
| 101 |
+
| `train_tokens.u8` | 374 MB | one uint8 ESM2 token stream of every training protein, CLS, residues, EOS, in a seed-0 shuffled order |
|
| 102 |
+
| `train_offsets.i64` | 13 MB | int64: where each protein starts in the stream, plus the stream's end |
|
| 103 |
+
| `train_three_di.u8` | 374 MB | uint8: the Foldseek 3Di class of every stream position, 255 at CLS and EOS |
|
| 104 |
+
| `train_families.json` | 23 MB | the family of each training protein, in stream order |
|
| 105 |
+
| `probe_subset.i64` | 156 KB | int64: the stream indices of the structure probe's 20,000 training proteins, one per family |
|
| 106 |
+
| `val_select.pt` | 14 MB | the selection split: `input_ids`, `masked`, `three_di`, `lengths`, `family`, `families` |
|
| 107 |
+
| `validation.pt` | 145 MB | the full validation split, the same tensors at full length |
|
| 108 |
+
| `test.pt` | 143 MB | the full test split, the same tensors at full length |
|
| 109 |
+
| `manifest.json` | small | the source, the objective, the seeds, every count and every file's SHA-256 |
|
| 110 |
+
|
| 111 |
+
Every file's SHA-256 is in `manifest.json` and the loaders verify it, so a run cannot read altered data unnoticed.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
|
| 113 |
## Source and terms
|
| 114 |
|
| 115 |
+
AlphaFold Database sequences (CC BY 4.0) and their Foldseek 3Di states, grouped into families by sequence and
|
| 116 |
+
structure and split by family in Synthyra's Alignment Atlas. This release carries the tokens, the 3Di states and the
|
| 117 |
+
family index of each protein, no coordinates. The dataset is CC BY 4.0; cite the [code repository](https://github.com/Synthyra/SpeedrunningPLMs) and the
|
| 118 |
+
AlphaFold Database.
|