# Embedding spaces — provenance and reproduction The benchmark ships four precomputed embedding caches. **All of them were computed by us from public model weights applied to the public 490-sequence cohort** (`cache/k562_experiments/cohort/cohort_doublet_filtered.csv`, UniProt reviewed human sequences; headers include `sp|ACCESSION|NAME_HUMAN`). No embedding file is taken from a third party — what is third-party is the **model weights** (public checkpoints, exact paths below). ## Summary table | File (cache/embeddings/) | Shape | Model checkpoint (public) | Pooling / normalization | Computed by | |---|---|---|---|---| | `k562_esm2_650m_491x1280.npy` | (490, 1280) | `facebook/esm2_t33_650M_UR50D` (HF) | residue mean, L2-normalized; sequences >1022 aa split into 1022-aa chunks, length-weighted mean | us | | `esm2_3b_490.npy` | (490, 2560) | `facebook/esm2_t36_3B_UR50D` (HF) | same protocol as above | us | | `protrek_490.npy` | (490, 1024) | `westlake-repl/ProTrek_650M` (HF) + code from `github.com/westlake-repl/ProTrek` | `get_protein_repr` (official API; the model returns L2-normalized 1024-d protein representations) | us | | `rpe1_protrek_patched_1091x1024.npy` | (1091, 1024) | same ProTrek checkpoint | same API; base 1087-TF cache + 4 missing TFs patched with a gated sanity check (below) | us | Every file's SHA-256 is pinned in `data/embedding_checksums.txt` and verified by the test suite. ## Reproduction ```bash # weights (one-time, ~3.6 GB for ProTrek; ESM2 auto-downloads from HF) bash data/download_models.sh models # rebuild any cache and check it against the pinned SHA-256 python scripts/recompute_embeddings.py --model esm2_650m python scripts/recompute_embeddings.py --model esm2_3b python scripts/recompute_embeddings.py --model protrek --protrek-src models/protrek_src ``` The script exits non-zero if the recomputed checksum does not match, so the caches are verifiable rather than trusted. ## The RPE1 patched cache — what "patched" means `rpe1_protrek_patched_1091x1024.npy` serves the RPE1 raw-data pipeline. Its base is a 1087-TF ProTrek cache computed with the identical checkpoint and API. Four training TFs were missing from the original cache and were added in 2026-09 with a **gated sanity check**: 6 TFs already present were re-embedded first, and the patch was written only because all cosines vs the existing cache were ≥ 0.9999 (measured 1.0000). Full receipt with the per-TF alias resolution (UniProt accessions, readthrough-gene exclusion): `data/splits/embedding_patch_receipt.json`. ## Using a different encoder The benchmark is encoder-agnostic: compute any (490, d) embedding for the cohort sequences with your own model, L2-normalize rows, and pass it via `load_benchmark(embedding=...)` (or your own array — `SplitData.phi_*` are plain numpy). ESM2-650M is the default because it is the cheapest reproducible reference point; conclusions in the associated paper were verified to be flat across all three encoders above.