brain-uce-pilot-mix-v3-d768l14v2-bican
A pilot Universal Cell Embedding (UCE)-style model for brain single-cell RNA-seq. It is the
released model KuanP/brain-uce-pilot-mix-v3-d768l14v2
(the d768 / 14-layer v2 recipe trained on data mix v3 / mixture C for 262,144 steps) plus a
65,536-step anneal on BICAN data only, to step 327,680. The anneal used 15 BICAN caches
(BICAN NeMO for 12 species and the BICAN basal-ganglia atlas for human, macaque and marmoset),
one pass over a 16,777,216-sample mixture, with the learning rate falling from the parent's
1.5e-5 floor to 0 and the parent's optimizer state carried over. Two basal-ganglia donors were
held out of the anneal (section 1). The architecture, vocabulary, cell-sentence settings and
usage are the parent's: config.json is byte-identical to the parent's, and the output is the
same 768-d, L2-normalised cell embedding.
| Benchmark name | mixv3_d768l14v2_262k_bicanA |
| Parent | KuanP/brain-uce-pilot-mix-v3-d768l14v2 (benchmark name mixv3_d768l14v2_262k), run brain_mixC_v2026_09_d768l14v2_noeval_262144steps/2026-10-18_03-33-38, step 262,144. The anneal resumed from a copy of that run's checkpoint-262144, whose weights have the same sha256 (3b5f3ae6...58fe) as the parent repository's model.safetensors |
| Training run | brain_bicanA_v2026_09_d768l14v2_mid_noeval_327680steps/2026-10-20_05-53-26 |
| Code | training: uce-training-suite (remote in training/git_info.json; a private repository, so this commit is not publicly reachable), branch ucsc-brain, commit 80f6c048a4821735bfcab6d1672988b6dd9eb1c4. That commit is the parent's training commit 3c5ffe9 plus the two anneal experiment configs. The run also used uncommitted working-tree changes, byte-identical to the parent run's, which include the v2 model options. They are listed in training/git_info.json and not published. Inference: UCE-brain, branch d768l14-v2, not yet published on GitHub (section 4) |
| Weights | model.safetensors, 5,918,299,836 bytes, 151 fp32 tensors, the final model at step 327,680 (byte-identical to the run's checkpoint-327680). Tensor names, shapes and dtypes match the parent's. The frozen gene-token table and the positional-encoding buffer are byte-identical to the parent's, and the other 149 tensors were updated |
| Parameters | 114,014,209 trained + the frozen 266,403 x 5,120 ESM2 gene-token table (1,363,983,360), as in the parent |
| Embedding | 768-d, unit L2 norm (dot product = cosine similarity) |
| Status | pilot research model; license not yet chosen (see Caveats) |
1. The BICAN anneal (steps 262,144 to 327,680)
Data: 15 BICAN caches, mixture brain_bican_v2026_09_midA
The anneal draws only from the BICAN caches of the parent's corpus: 12 BICAN NeMO caches, one
per species, and the three BICAN HMBA basal-ganglia (BG) atlas caches (human, rhesus macaque,
marmoset). It does not use the 11 CELLxGENE Census and Discover caches of the parent's 26, so
this phase saw no non-brain tissue, no CELLxGENE data and no zebrafish. Mixture rules
(training/config.yaml: dataset.mixture):
- Species mass is proportional to (train cells)^0.7, and dataset weight within a species to n^0.5.
- There is no brain re-weighting (
brain_fraction_target0; every cell of these caches is brain) and there are no assay weights. - No cache is drawn more than 4 times its size (
max_epochs_per_spec4). - NeMO libraries that duplicate BG-atlas libraries are excluded (
exclude_nemo_bg_overlap). - The libraries of the two held-out donors are excluded (
exclude_sample_ids, below).
The trainer materialised 16,777,216 samples (training/mixture_summary.json) from 17,727,804
eligible cells:
| cache | species | eligible train cells | excluded from the train split | samples | share | draws per eligible cell |
|---|---|---|---|---|---|---|
nemo_mus_musculus | mus_musculus | 9,229,735 | - | 7,013,428 | 41.80 % | 0.76 |
nemo_homo_sapiens | homo_sapiens | 4,843,818 | 919,066 BG duplicates | 3,890,999 | 23.19 % | 0.80 |
nemo_macaca_mulatta | macaca_mulatta | 1,281,078 | 227,093 BG duplicates | 1,364,506 | 8.13 % | 1.07 |
nemo_callithrix_jacchus | callithrix_jacchus | 145,329 | 576,516 BG duplicates | 344,985 | 2.06 % | 2.37 |
nemo_macaca_nemestrina | macaca_nemestrina (macaca_mulatta vocabulary) | 71,309 | 31,358 BG duplicates | 233,077 | 1.39 % | 3.27 |
nemo_rattus_norvegicus | rattus_norvegicus | 84,271 | - | 261,983 | 1.56 % | 3.11 |
nemo_monodelphis_domestica | monodelphis_domestica | 83,091 | - | 259,409 | 1.55 % | 3.12 |
nemo_sus_scrofa | sus_scrofa | 80,753 | - | 254,278 | 1.52 % | 3.15 |
nemo_pan_troglodytes | pan_troglodytes | 78,578 | - | 249,464 | 1.49 % | 3.17 |
nemo_aotus_nancymaae | aotus_nancymaae | 51,823 | - | 186,408 | 1.11 % | 3.60 |
nemo_tupaia_chinensis | tupaia_chinensis | 33,805 | - | 135,220 | 0.81 % | 4.00 |
nemo_microcebus_murinus | microcebus_murinus | 20,178 | - | 80,712 | 0.48 % | 4.00 |
bg_homo_sapiens | homo_sapiens | 928,362 | 73,205 held-out donor | 1,158,354 | 6.90 % | 1.25 |
bg_macaca_mulatta | macaca_mulatta | 494,741 | 37,808 held-out donor | 847,962 | 5.05 % | 1.71 |
bg_callithrix_jacchus | callithrix_jacchus | 300,933 | - | 496,431 | 2.96 % | 1.65 |
| total (15 caches, 12 species) | 17,727,804 | 1,754,033 BG duplicates + 111,013 held-out donors | 16,777,216 | 100 % |
By species: mouse 41.8 %, human 30.1 %, rhesus macaque 13.2 %, marmoset 5.0 %, the other eight
species 0.5-1.6 % each. In the parent's mixture C, human was 59.65 % and mouse 23.12 % of samples.
The 15 caches keep the parent's 0.995 / 0.005 train / held-out split: each spec's split position
is pinned to the parent's (split_index), and the 15 val_indices_*.npy files of this run are
byte-identical to the parent run's. The held-out cells of these caches were therefore seen by
neither model.
Held-out donors
| donor | cache | libraries excluded | cells in the cache | excluded from the train split |
|---|---|---|---|---|
human H20.30.002 | bg_homo_sapiens | 13 | 73,578 | 73,205 |
macaque QM23.50.002 | bg_macaca_mulatta | 8 | 38,003 | 37,808 |
The excluded library ids are exactly the donor's libraries in that BG cache. The parent model saw both donors (its mixture excluded no samples). Two details:
- As far as library ids show, the human donor has only these 13 libraries: the HMBA whole-brain atlas v0.5 library table lists no others for this donor (the NeMO manifest has no donor column, so a NeMO library of this donor outside that table would not be detected). Six of them also exist in the NeMO human cache (44,636 cells), and those copies were excluded as BG duplicates.
- The macaque donor also has 63 libraries from other brain regions in the NeMO macaque cache (444,857 cells): medulla, pons, hypothalamus, cerebellum, hippocampus and others, none of them in the BG atlas. They were not excluded, so the anneal trained on this donor's cells from outside the basal ganglia. The macaque donor is held out only for its basal-ganglia libraries.
Schedule and optimisation (training/config.yaml: training, training/training_args.json)
| setting | value |
|---|---|
| start | the parent's checkpoint-262144: weights, AdamW moments and step counter (Hugging Face resume_from_checkpoint) |
| steps | 65,536, from 262,144 to 327,680 (max_steps 327,680) |
| batch | per_device_train_batch_size 32 x 8 A100 (one node, ilc cluster) x gradient_accumulation_steps 1 = global batch 256 |
| samples seen | 65,536 x 256 = 16,777,216 = one pass over the materialised mixture (the trainer's epoch counter goes from 4.0 to 5.0) |
| learning rate | 1.5e-5 (the parent's final floor) at step 262,144, cosine to 0 at step 327,680, no warm-up (lr_schedule_offset_steps 262,144, warmup_steps 0). Logged: 1.49999e-5 at step 262,200, 7.51e-6 at 294,900, 5.8e-11 at 327,600 |
| optimiser | adamw_torch_fused, betas (0.9, 0.98), eps 1e-9, weight_decay 0, max_grad_norm 1.0, as in the parent |
| objective | unchanged: mask 0.20, dataset-expressed negatives (gene universes _gene_universe_v2026-09), 1,024 sampled tokens, pad 2,048, the collator trims padding to a multiple of 256 |
| precision | bf16: true (autocast; fp32 master weights), torch_compile: true (inductor), DDP |
| evaluation | none during training (eval_strategy: 'no'); checkpoints every 500 steps, the last 5 kept |
| wall clock | 13 h 45 min (2026-10-19 22:54 to 2026-10-20 12:39 PDT), ilc job 242504, one launch, no restarts |
Training loss. The anneal starts at 0.385 (first logged value 0.3847 at step 262,200; mean
of its first 1,000 steps 0.3848) and ends at 0.380 (mean of the last 1,000 steps 0.3799).
This is the loss on the BICAN mixture, so it is not comparable with the parent's 0.406 on
mixture C. training/trainer_state.json holds the whole log: the parent's phase every 20 steps up
to step 262,140, then this phase every 100 steps. It has no optimizer state.
2. Architecture (unchanged from the parent)
config.json is byte-identical to the parent's, and the model.safetensors header lists the same
151 tensors with the same shapes. The parent card describes the model in full. In brief
(UCEForExpressionPrediction, model_type: uce):
input_ids [B, 2048]
-> Embedding(266403, 5120) frozen ESM2 gene-token table
-> L2-normalise each token token_norm: l2
-> Linear(5120 -> 768) -> GELU -> LayerNorm input_projection_type: linear_gelu_ln
-> + sinusoidal PE x 0.0360844 (= 1/sqrt(768))
-> 14 pre-norm blocks d_model 768, 6 heads x 128, RMSNorm, QK-norm,
SwiGLU FFN 2048, no biases, dropout 0.05
-> final RMSNorm -> position 0 (CLS)
-> MLP cell head [1024, 768, 768] + Linear 768->768 -> F.normalize
=> cell_embedding [B, 768], unit L2 norm
The training head is a separate target-gene layer (Linear 5120 -> 768 -> GELU -> LayerNorm) and an expression decoder [1536, 2048, 512, 128, 1] over [cell embedding | gene]. It is not needed for embeddings.
block (from the safetensors header; 151 F32 tensors, 1,479,570,433 elements) | elements |
|---|---|
uce.embedding_layer.embedding.weight (frozen ESM2 table, 266,403 x 5,120; unchanged by the anneal) | 1,363,983,360 |
uce.pos_encoder.pe (fixed sinusoidal buffer) | 1,572,864 |
| trained: encoder (14 blocks + final RMSNorm) | 99,116,288 |
trained: input projector uce.input_gene_embedding_projector | 3,934,464 |
trained: cell head uce.cell_head | 2,760,960 |
trained: target-gene layer gene_embedding_layer (training only) | 3,934,464 |
trained: decoder expression_decoder (training only) | 4,268,033 |
| trained total | 114,014,209 |
The training log of the run reports the same total (Trainable: 114,014,209).
Token vocabulary (vocab_size 266,403): identical to the parent. vocab/ holds the same files
with the same sha256, and training/config.yaml: dataset.gene_mapping_path points at
all_species_gene_dict_v2026-09.json (sha256 496b9980...e336, the file shipped in vocab/).
Ids 0-3 are special tokens (pad 0, cls 1, chrom_token_right 2). Ids 4-237,410 are the genes
of the 11 non-zebrafish species, and ids 237,411-239,337 their chromosome-start tokens
(chrom_token_offset 237,411). Ids 239,338-266,376 are danio_rerio genes and ids
266,377-266,402 its chromosome tokens.
3. Benchmark results (uce_brain_v1)
The protocol is the parent card's. All metrics are computed on fixed per-dataset cell subsets
with donor-grouped cross-validation (GroupKFold on the donor column), so a classifier cannot
score by memorising a donor's batch effect. Embeddings are extracted with deterministic cell
sentences (seeded by row index), mask_prop = 0 and bf16 autocast. The primary label per dataset
is the benchmark config's label_col. Every number below is read from the benchmark's
results.parquet (sha256 e2a240ad...829f, 2026-10-20). This model was scored on the same cells,
with the same label and fold counts, as the parent.
Compared models:
mixv3_d768l14v2_262k_bicanA: this model.mixv3_d768l14v2_262k: the parent,KuanP/brain-uce-pilot-mix-v3-d768l14v2.public_uce_33l: the public UCE paper model (Rosen et al.,33l_8ep_1024t_1280.torch: 33 layers, d 1280, 1280-d output, legacy 145,469-token table). It was embedded with the public repository's own code (fp32, pad 1536) on the same cells. It sees fewer of the benchmark genes (see the parent card), and marmoset cells go through its human table.
Ranks are among all 17 models in the benchmark (16 on the marmoset sets, where the human-only legacy model has no gene overlap). The pool includes the parent and the 100M d768/12L model's BICAN arms.
Metric definitions:
- kNN F1 / acc: cosine k-nearest-neighbour label transfer (k = 15, distance-weighted) to held-out donors; macro-F1 and accuracy, mean over folds.
- probe F1 / acc: multinomial logistic regression on standardised embeddings, same folds.
- donor mix: within each cell type, normalised entropy of donor ids among the 30 nearest neighbours (1 = donors fully mixed), mean over labels.
- label ASW / batch ASW: scIB-style silhouettes on a 10k subsample,
(s(label)+1)/2andmean(1 - |s(donor)|). - PR / PCs95: participation ratio and number of PCs for 95 % variance of the embedding (a diagnostic of effective dimensionality, not a score).
- loss: mean per-cell training objective with the model's own mask fraction (0.20 for both this model and the parent) and vocabulary-wide negatives. It is comparable between this model and the parent, but not with the other suite models (mask 0.15). The public 33L has no loss.
Evaluation datasets and their provenance
| dataset | species | what it is | primary label / groups | cells scored |
|---|---|---|---|---|
down_syndrome | homo_sapiens | fetal cortex, Down syndrome vs control (CxG 0df5d172), 30 donors | cell_type / donor_id | 60,000 |
pediatric_glioma | homo_sapiens | pediatric high-grade glioma (HTAN CHOP; CxG 843c1459), 16 patients | cell_type / donor_id | 60,000 |
hmba_v05_macaque | macaca_mulatta | HMBA whole-brain v0.5 macaque, libraries not in the corpus, 4 donors | subclass / donor | 57,661 |
hmba_v05_marmoset | callithrix_jacchus | HMBA whole-brain v0.5 marmoset, libraries not in the corpus, 4 donors | subclass / donor | 54,423 |
human_striatum | homo_sapiens | BICAN BG atlas human cache, caudate + putamen + nucleus accumbens ROIs, 9 donors | cell_type / donor_id | 59,766 |
macaque_striatum | macaca_mulatta | BICAN BG atlas macaque cache, same ROIs, 7 donors | cell_type / donor_id | 59,822 |
hmba_v05_macaque_subclass_full | macaca_mulatta | hmba_v05_macaque cells, every subclass with >= 20 cells (127), <= 300 per subclass | subclass / donor | 22,798 |
hmba_v05_marmoset_subclass_full | callithrix_jacchus | same for marmoset (355 subclasses) | subclass / donor | 86,368 |
human_striatum_full | homo_sapiens | human_striatum cells, every cell type with >= 20 cells (29), <= 3,000 per type | cell_type / donor_id | 53,766 |
Provenance, for reading the comparisons below:
- Striatum sets.
human_striatum,human_striatum_fullandmacaque_striatumare cells of the BICAN basal-ganglia cachesbg_homo_sapiensandbg_macaca_mulatta. The parent trained on these caches as part of mixture C, and this anneal trained on them again, except for the two held-out donors. Those donors make up 5,319 of the 60,000 cells sampled forhuman_striatum(H20.30.002), 3,968 of the 53,766 ofhuman_striatum_full, and 2,146 of the 60,000 ofmacaque_striatum(QM23.50.002). The donor-grouped folds still test on donors the classifier was not fitted on, but the cells come from caches the embedding model trained on. - HMBA v0.5 sets. These hold only the HMBA whole-brain atlas v0.5 libraries that the corpus
does not contain. About 68 % of the atlas's cells are already in the corpus (via BICAN NeMO,
the BG atlases and Siletti via Census), and those cells were left out of these sets. None of
the sets' libraries occurs in any same-species BICAN BG or NeMO cache, so, as far as library ids
show, neither this model nor the parent trained on these cells. Three of the four HMBA macaque
donors (
QM23.50.001,QM23.50.002,QM23.50.003; 99.5 % of the 60,000hmba_v05_macaquecells) also gave basal-ganglia libraries tobg_macaca_mulatta. Both models therefore saw other cells from the same macaque donors. - Discover sets.
down_syndromeandpediatric_gliomawere excluded from the parent's mixture and are not in the BICAN caches, so neither model trained on them.
Donor-grouped kNN macro-F1, primary label
dataset (label) | this model | parent mixv3_d768l14v2_262k | this - parent | public_uce_33l | rank of this model (highest = 1) |
|---|---|---|---|---|---|
down_syndrome (cell_type) | 0.7980 | 0.7971 | +0.0009 | 0.7866 | 1 of 17 |
pediatric_glioma (cell_type) | 0.8477 | 0.8425 | +0.0052 | 0.8255 | 1 of 17 |
hmba_v05_macaque (subclass) | 0.7781 | 0.7818 | -0.0037 | 0.6556 | 2 of 17 |
hmba_v05_marmoset (subclass) | 0.3287 | 0.3166 | +0.0121 | 0.2746 | 1 of 16 |
human_striatum (cell_type) | 0.9315 | 0.9166 | +0.0149 | 0.9268 | 1 of 17 |
macaque_striatum (cell_type) | 0.8252 | 0.7956 | +0.0295 | 0.7139 | 1 of 17 |
hmba_v05_macaque_subclass_full (subclass) | 0.5435 | 0.5161 | +0.0274 | 0.3963 | 1 of 17 |
hmba_v05_marmoset_subclass_full (subclass) | 0.1757 | 0.1641 | +0.0116 | 0.1381 | 1 of 16 |
human_striatum_full (cell_type) | 0.8648 | 0.8444 | +0.0204 | 0.8517 | 1 of 17 |
Donor-grouped linear-probe macro-F1, primary label
dataset (label) | this model | parent mixv3_d768l14v2_262k | this - parent | public_uce_33l | rank of this model (highest = 1) |
|---|---|---|---|---|---|
down_syndrome (cell_type) | 0.8154 | 0.8119 | +0.0035 | 0.7992 | 1 of 17 |
pediatric_glioma (cell_type) | 0.8067 | 0.8106 | -0.0039 | 0.7903 | 16 of 17 (first: matryoshka_v09_131k 0.8453) |
hmba_v05_macaque (subclass) | 0.7605 | 0.7557 | +0.0047 | 0.6774 | 1 of 17 |
hmba_v05_marmoset (subclass) | 0.3693 | 0.3580 | +0.0113 | 0.3127 | 1 of 16 |
human_striatum (cell_type) | 0.9485 | 0.9396 | +0.0089 | 0.9387 | 1 of 17 |
macaque_striatum (cell_type) | 0.8687 | 0.8445 | +0.0242 | 0.7773 | 1 of 17 |
hmba_v05_macaque_subclass_full (subclass) | 0.5387 | 0.4965 | +0.0422 | 0.4227 | 1 of 17 |
hmba_v05_marmoset_subclass_full (subclass) | 0.2295 | 0.2158 | +0.0137 | 0.1817 | 1 of 16 |
human_striatum_full (cell_type) | 0.8944 | 0.8815 | +0.0129 | 0.8685 | 1 of 17 |
Against the parent, this model scores higher on 8 of 9 sets in both kNN and probe macro-F1
(kNN -0.0037 to +0.0295, mean +0.0131; probe -0.0039 to +0.0422, mean +0.0131). One seed per
model, so run-to-run noise was not measured, and differences of about 0.01 F1 are likely within
it. The changes on down_syndrome, pediatric_glioma and hmba_v05_macaque (all within 0.006 in
both metrics) are best read as no change. The gains above 0.01 are largest on macaque_striatum
(+0.0295 kNN / +0.0242 probe), hmba_v05_macaque_subclass_full (+0.0274 / +0.0422) and
human_striatum_full (+0.0204 / +0.0129). Two of these three are the striatum sets, whose
cells the anneal trained on.
Against the public 33L, this model is higher on all 9 sets in both metrics. The parent was below
it on the two human striatum sets in kNN macro-F1. This model's leads on human_striatum kNN
(+0.0047) and down_syndrome kNN (+0.0114) are about the noise level and best read as ties.
Trade-offs against the parent
| dataset | batch ASW: this model | parent | this - parent | donor mix: this model | parent | this - parent |
|---|---|---|---|---|---|---|
| down_syndrome | 0.7347 | 0.7274 | +0.0072 | 0.6521 | 0.6543 | -0.0022 |
| pediatric_glioma | 0.7794 | 0.7724 | +0.0070 | 0.2571 | 0.2565 | +0.0006 |
| hmba_v05_macaque | 0.6740 | 0.6798 | -0.0059 | 0.2480 | 0.2561 | -0.0081 |
| hmba_v05_marmoset | 0.7447 | 0.7447 | +0.0001 | 0.6476 | 0.6539 | -0.0064 |
| human_striatum | 0.7177 | 0.7378 | -0.0201 | 0.6871 | 0.7261 | -0.0390 |
| macaque_striatum | 0.7585 | 0.7484 | +0.0100 | 0.6050 | 0.6302 | -0.0252 |
| hmba_v05_macaque_subclass_full | 0.6584 | 0.6602 | -0.0018 | 0.2434 | 0.2496 | -0.0062 |
| hmba_v05_marmoset_subclass_full | 0.7299 | 0.7246 | +0.0053 | 0.6029 | 0.6042 | -0.0014 |
| human_striatum_full | 0.7618 | 0.7690 | -0.0072 | 0.6507 | 0.6869 | -0.0362 |
- Donor structure. The parent already kept more donor / batch structure than the other models it was compared with (see its card). Batch ASW is essentially unchanged: higher on 5 of 9 sets, lower on 4, -0.0201 to +0.0100, mean -0.0006. Donor-mixing entropy is lower on 8 of 9 sets (-0.0390 to -0.0014; +0.0006 on pediatric_glioma), most on the striatum sets (-0.039, -0.036, -0.025). A cell's same-type neighbours are now even more concentrated on fewer donors. This model has the lowest donor-mixing entropy of the 17 models (16 on the marmoset sets) on 8 of 9 sets (second, behind the parent, on pediatric_glioma) and the lowest batch ASW on 4. All classification scores above are donor-grouped, so this structure does not inflate them. For integration-style uses, expect to need batch correction.
- Data the anneal did not train on. The held-out pretraining loss (below) rises on every pretraining cache outside the BICAN set (+0.0038 to +0.0242), and the eval-set loss rises on the two CELLxGENE Discover sets (+0.0051, +0.0088). Both fall on the BICAN caches and the BICAN-derived and HMBA sets.
- Secondary labels (table below). Most move by 0.01 or less. The larger moves are
hmba_v05_macaqueneighborhood, probe macro-F1 0.7288 -> 0.6202 (-0.1086, while its probe accuracy moves 0.9665 -> 0.9649 and its kNN macro-F1 -0.0051; on the 100M d768/12L model the same probe macro-F1 also moved under both anneals: base 0.5718, control 0.5550, BICAN arm 0.5230);hmba_v05_marmosetneighborhood(+0.0115 kNN / +0.0174 probe);pediatric_gliomamolecularClass(+0.0187 / +0.0276); anddown_syndromedisease(-0.0102 / -0.0103). - Effective dimensionality. The participation ratio is higher than the parent's on all 9 sets (for example human_striatum 5.35 -> 6.50, macaque_striatum 4.71 -> 5.76).
Benchmark loss (comparable between this model and the parent: mask 0.20, vocabulary-wide negatives)
| dataset | this model | parent | this - parent |
|---|---|---|---|
| down_syndrome | 0.4060 | 0.4009 | +0.0051 |
| pediatric_glioma | 0.4447 | 0.4359 | +0.0088 |
| hmba_v05_macaque | 0.3695 | 0.3720 | -0.0025 |
| hmba_v05_marmoset | 0.3751 | 0.3830 | -0.0079 |
| human_striatum | 0.3580 | 0.3616 | -0.0036 |
| macaque_striatum | 0.3572 | 0.3602 | -0.0030 |
| hmba_v05_macaque_subclass_full | 0.3746 | 0.3777 | -0.0031 |
| hmba_v05_marmoset_subclass_full | 0.3751 | 0.3831 | -0.0080 |
| human_striatum_full | 0.3735 | 0.3769 | -0.0034 |
Held-out pretraining loss: the mean per-cell objective on up to the first 20,000 cells (1,512-20,000 per cache) of the held-out split of nine pretraining caches. These are the same cells for both models, and the BICAN caches keep the parent's split.
| model | bg_callithrix_jacchus | bg_homo_sapiens | census_homo_sapiens | census_macaca_mulatta | census_mus_musculus | discover_danio_rerio | discover_homo_sapiens | nemo_homo_sapiens | nemo_mus_musculus |
|---|---|---|---|---|---|---|---|---|---|
mixv3_d768l14v2_262k_bicanA | 0.3508 | 0.3611 | 0.3876 | 0.3723 | 0.3708 | 0.3573 | 0.3631 | 0.3698 | 0.3304 |
mixv3_d768l14v2_262k (parent) | 0.3600 | 0.3644 | 0.3763 | 0.3632 | 0.3625 | 0.3331 | 0.3593 | 0.3734 | 0.3348 |
| this - parent | -0.0092 | -0.0032 | +0.0113 | +0.0091 | +0.0083 | +0.0242 | +0.0038 | -0.0036 | -0.0045 |
The anneal trained on the bg_* and nemo_* caches; the census_* and discover_* caches were
not in it.
Missing control: what the gains can and cannot be attributed to
The matched control arm, brain_mixC_v2026_09_d768l14v2_midctrl_noeval_327680steps, runs the
same 65,536-step anneal on the unchanged mixture C. It has not been benchmarked yet. The
differences above therefore cannot be split between "BICAN-only data" and "65,536 more steps at a
decaying, low learning rate".
Evidence from a different model: the same design was run, with a control, on the 100M d768/12L
model mixv3_d768l12_524k. There, the control (mixv3_d768l12_524k_midC) changed every benchmark
loss by at most 0.0006 (9 eval sets + 9 held-out pretraining splits). Its kNN macro-F1 stayed
within 0.0032 of the base on 8 of 9 sets (-0.0142 on hmba_v05_macaque_subclass_full), and its
probe macro-F1 within 0.0030 on 8 of 9 (+0.0103 on hmba_v05_macaque). That anneal re-warmed over
1,000 steps to a peak of 5e-6 (with Adam beta2 0.95 and gradient clipping at 0.3), while this one
starts at 1.5e-5 with no warm-up. It is a different model with a 3x lower anneal learning rate,
so it does not show that the control would be a no-op here.
mixv3_d768l14v2_262k_bicanA, primary label, all metrics
dataset (label) | labels | folds | loss | kNN F1 | kNN acc | probe F1 | probe acc | donor mix | label ASW | batch ASW | PR | PCs95 | genes mapped |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
down_syndrome (cell_type) | 8 | 5 | 0.4060 | 0.7980 | 0.9218 | 0.8154 | 0.9213 | 0.6521 | 0.6046 | 0.7347 | 7.0870 | 41 | 1.0000 |
pediatric_glioma (cell_type) | 7 | 5 | 0.4447 | 0.8477 | 0.9730 | 0.8067 | 0.9683 | 0.2571 | 0.6192 | 0.7794 | 16.9265 | 60 | 1.0000 |
hmba_v05_macaque (subclass) | 52 | 4 | 0.3695 | 0.7781 | 0.8830 | 0.7605 | 0.8934 | 0.2480 | 0.6871 | 0.6740 | 13.1613 | 33 | 1.0000 |
hmba_v05_marmoset (subclass) | 145 | 4 | 0.3751 | 0.3287 | 0.7426 | 0.3693 | 0.7762 | 0.6476 | 0.6485 | 0.7447 | 10.0325 | 31 | 1.0000 |
human_striatum (cell_type) | 21 | 5 | 0.3580 | 0.9315 | 0.8093 | 0.9485 | 0.9016 | 0.6871 | 0.6687 | 0.7177 | 6.4990 | 25 | 1.0000 |
macaque_striatum (cell_type) | 25 | 5 | 0.3572 | 0.8252 | 0.7959 | 0.8687 | 0.9109 | 0.6050 | 0.6316 | 0.7585 | 5.7577 | 19 | 1.0000 |
hmba_v05_macaque_subclass_full (subclass) | 127 | 4 | 0.3746 | 0.5435 | 0.6907 | 0.5387 | 0.7077 | 0.2434 | 0.5967 | 0.6584 | 17.4206 | 40 | 1.0000 |
hmba_v05_marmoset_subclass_full (subclass) | 355 | 4 | 0.3751 | 0.1757 | 0.2444 | 0.2295 | 0.3249 | 0.6029 | 0.4021 | 0.7299 | 12.2072 | 42 | 1.0000 |
human_striatum_full (cell_type) | 29 | 5 | 0.3735 | 0.8648 | 0.9389 | 0.8944 | 0.9636 | 0.6507 | 0.7739 | 0.7618 | 14.5377 | 30 | 1.0000 |
"labels" = labels with >= 50 cells (>= 20 on the _full sets) that are scored; "folds" = number
of GroupKFold folds, min(5, number of donors).
Additional labels (donor-grouped macro-F1), this model vs the parent
| dataset | label | kNN macro-F1: this model | parent | probe macro-F1: this model | parent |
|---|---|---|---|---|---|
| down_syndrome | author_cell_type | 0.7720 | 0.7702 | 0.7822 | 0.7827 |
| down_syndrome | disease | 0.4700 | 0.4802 | 0.4618 | 0.4721 |
| down_syndrome | development_stage | 0.1343 | 0.1304 | 0.1476 | 0.1463 |
| pediatric_glioma | merged_cellType | 0.8477 | 0.8425 | 0.8080 | 0.8123 |
| pediatric_glioma | TumorNormal | 0.7661 | 0.7723 | 0.7997 | 0.8097 |
| pediatric_glioma | molecularClass | 0.2307 | 0.2120 | 0.2638 | 0.2362 |
| hmba_v05_macaque | class | 0.6993 | 0.7033 | 0.6518 | 0.6548 |
| hmba_v05_macaque | neighborhood | 0.6768 | 0.6819 | 0.6202 | 0.7288 |
| hmba_v05_macaque | roi | 0.0237 | 0.0225 | 0.0223 | 0.0224 |
| hmba_v05_marmoset | class | 0.5188 | 0.5134 | 0.5564 | 0.5562 |
| hmba_v05_marmoset | neighborhood | 0.6297 | 0.6182 | 0.6683 | 0.6509 |
| hmba_v05_marmoset | roi | 0.0118 | 0.0110 | 0.0133 | 0.0130 |
| human_striatum | tissue | 0.1650 | 0.1583 | 0.1752 | 0.1690 |
| macaque_striatum | tissue | 0.2293 | 0.2232 | 0.2264 | 0.2250 |
disease, TumorNormal and molecularClass are donor-level labels, and roi / tissue are
brain-region labels. None of them is a cell-type label, and the region labels score low for
every model.
4. How to use (UCE-brain, branch d768l14-v2)
Usage is identical to the parent. Only the repository id changes. Load this model with the
UCE-brain package at branch d768l14-v2 (to be
merged into main). That branch adds the v2 architecture options. Its load_model is strict: it
raises on config.json keys or tensors it does not know. Older UCE-brain versions refuse to
load this checkpoint, because their config check rejects input_projection_type: linear_gelu_ln. The training-suite commit 80f6c04 without the run's uncommitted v2 changes
refuses it in the same way.
The d768l14-v2 branch is not on GitHub yet. On 2026-10-20 the public repository has only
the branches main, data-mix-v3, multi-species and release, and none of them contains the
v2 options, so none can load this checkpoint. Until the v2 support is pushed (or merged into
main), the git checkout d768l14-v2 below fails. The same holds for the parent model.
git clone https://github.com/snap-stanford/UCE-brain.git && cd UCE-brain
git checkout d768l14-v2
uv sync
Requires torch>=2.4 (nn.RMSNorm); uv sync installs the locked torch 2.10. This model's
smoke test (below) ran with torch 2.13 / transformers 5.15.
Repository layout (the root is a checkpoint directory: config.json and model.safetensors side
by side, with the run's config.yaml beside them, where UCE-brain first looks for the
cell-sentence parameters):
brain-uce-pilot-mix-v3-d768l14v2-bican/
README.md this card
MANIFEST.md sizes + sha256 of every file
config.json UCEConfig (HF PretrainedConfig); byte-identical to the parent's
model.safetensors weights at step 327,680, incl. the frozen 266,403 x 5,120 gene-token table
config.yaml resolved config of the anneal; supplies the cell-sentence parameters
training/
config.yaml same file, kept with the provenance set
config_unresolved.yaml the config with Hydra interpolations unresolved
git_info.json commit / branch / list of uncommitted files of the training code
dataset_indices_summary.json samples / held-out cells per cache of the anneal
mixture_summary.json realised anneal mixture per cache (eligible cells, exclusions, samples)
trainer_state.json training log (parent's phase every 20 steps, anneal every 100); no optimizer state
training_args.json Hugging Face TrainingArguments of the anneal (token fields redacted)
vocab/
all_species_gene_dict_v2026-09.json species -> gene symbol -> {protein_embedding_id, chromosome_id, location}
gene_names_v2026-09/gene_names_<species>.txt each species' vocabulary, one symbol per line, in token-id order
Snippet. This is the parent card's snippet with the new repository id. This repository has
the parent's config.json, tensor layout, vocabulary and config.yaml: dataset cell-sentence
settings. The section-3 embeddings were computed by the training suite from the same
model.safetensors file this repository ships.
from uce_brain.data import load_gene_mapping, read_h5ad_subsampled
from uce_brain.inference import (
resolve_checkpoint, find_gene_mapping, load_model, load_cell_sentence_params, embed_adata,
)
ckpt = resolve_checkpoint("KuanP/brain-uce-pilot-mix-v3-d768l14v2-bican") # Hub repo id, or a local copy
params = load_cell_sentence_params(ckpt) # from config.yaml: pad_length 2048, chrom_token_offset 237411, ...
model = load_model(ckpt, device="cuda") # fp32 weights; bf16 autocast is applied at embed time
gene_mapping = load_gene_mapping(find_gene_mapping(ckpt)) # vocab/all_species_gene_dict_v2026-09.json
adata = read_h5ad_subsampled("cells.h5ad", n_cells=5000) # raw UMI counts
adata.obsm["X_uce"] = embed_adata(model, adata, gene_mapping, params, species="macaca_mulatta")
# float32 [n_cells, 768], unit L2 norm, row i == adata row i (mask_prop defaults to 0 for embeddings)
Smoke test of this model (2026-10-20, one A100 80 GB, UCE-brain d768l14-v2 code, torch
2.13 / transformers 5.15, Hub offline). UCE-brain's scripts/smoke_mix_v3.py makes the snippet's
calls (resolve_checkpoint, load_cell_sentence_params, load_model, read_h5ad_subsampled
with seed 0) and then scores the cells with compute_per_cell_loss. It was run on a local copy
of this repository folder (cell-sentence parameters from its config.yaml, genes from its
vocab/) and, separately, on the training run directory it was copied from; every number in
the table was identical between the two. The parent was run alongside the run-directory test
(same job, same code, same cells). kNN here is a quick check: cosine, k = 15,
distance-weighted, with random (not donor-grouped) 5-fold splits, so it is not comparable with
section 3.
| HMBA v0.5 macaque, 2,000 cells: this model | parent | human striatum, 2,000 cells: this model | parent | |
|---|---|---|---|---|
strict load_model | 151 tensors verified, 114,014,209 trainable | same | same | same |
| cell-sentence parameters | from config.yaml (chrom_token_offset 237411, pad_length 2048, ...) | same | same | same |
| genes mapped | 19,073 of 34,643 | same | 20,076 of 20,076 | same |
| embeddings | [2000, 768], finite, norm 1 +/- 2e-7 | same | same | same |
| pairwise cosine, first 256 cells: mean (max) | 0.7802 (0.9949) | 0.8131 (0.9967) | 0.3998 (0.9963) | 0.4758 (0.9968) |
| kNN acc / macro-F1 | class (25 labels): 0.9815 / 0.6463; subclass (77): 0.8885 / 0.4676 | 0.9800 / 0.6455; 0.8840 / 0.4397 | cell_type (27): 0.7805 / 0.5580 | 0.7555 / 0.5366 |
compute_per_cell_loss, first 512 cells (mask 0.20) | 0.3717 | 0.3734 | 0.3516 | 0.3551 |
| chromosome offset 1000 instead of 237411: cosine to the correct embedding; loss | 0.8485; 0.3829 | 0.8492; 0.3852 | 0.9945; 0.3517 | 0.9958; 0.3551 |
All of the smoke script's checks passed for both models on both inputs. The HMBA macaque cells
come from the atlas libraries that are not in the corpus (section 3); 1,989 of the 2,000 are
from the three donors that also gave basal-ganglia libraries to bg_macaca_mulatta. The human
cells are a sample of the benchmark's human_striatum set, i.e. cells of the bg_homo_sapiens
cache: 1,821 of the 2,000 are from donors this anneal trained on, and 179 from the held-out
donor H20.30.002; the parent trained on all of these donors. The matched control arm was not
part of this comparison, so the differences from the parent cannot be attributed to the BICAN
data (section 3). The snippet above was also run verbatim against the local copy of this folder,
with "cells.h5ad" replaced by the HMBA macaque file (2,000 cells): it found config.yaml and
vocab/all_species_gene_dict_v2026-09.json in the folder, logged 151 verified tensors and
114,014,209 trainable parameters with no warnings, and returned float32 [2000, 768] unit-norm
embeddings (loss 0.3717 on the first 512 cells).
Sanity checks after loading:
load_modelshould log that it verified 151 tensors againstmodel.safetensorsand that the model has 114,014,209 trainable parameters.- Embedding norms should be ~1.0 and the width 768.
- Pairwise cosine similarities should be well below 1.0 (smoke test: mean 0.78 on HMBA macaque and 0.40 on human striatum cells).
compute_per_cell_lossshould be well below ln 2 = 0.6931: 0.372 on 512 HMBA macaque cells and 0.352 on 512 human striatum cells for this model. It uses the training mask 0.20 but scores expressed against non-expressed genes of the input AnnData, so it approximates the training objective rather than reproducing it. A loss pinned at 0.6931 means the weights did not survive loading.
Downstream code that assumes 512-d UCE embeddings must read the width from the model
(config.output_embedding_dim = 768).
5. Input expectations
The same as for the parent, because the vocabulary and the cell-sentence settings are unchanged:
- Raw UMI counts, not normalised or log-transformed. The sentence sampler treats
count > 0as "expressed" and samples tokens with probability proportional tolog1p(count). - Gene symbols: every vocabulary symbol is upper-case. UCE-brain's
embed_adatamatches symbols case-insensitively by default and resolves Ensemblvar_namesthroughvar["feature_name"](orgene_symbol_column). Genes absent from the species' vocabulary are dropped, and the fraction mapped is logged. - Species must be one of the 12 top-level keys of
vocab/all_species_gene_dict_v2026-09.json(homo_sapiens,mus_musculus,macaca_mulatta,callithrix_jacchus,pan_troglodytes,rattus_norvegicus,monodelphis_domestica,sus_scrofa,aotus_nancymaae,tupaia_chinensis,microcebus_murinus,danio_rerio). UCE-brain also accepts aliases such ashuman,macaqueandmarmoset. Usemacaca_mulattafor pig-tailed macaque.danio_reriowas not in the anneal data (section 1). - Cell-sentence settings, read from
config.yaml: datasetand required to match training exactly:pad_length2048,sample_size1024,positive_sample_num512,negative_sample_num512,mask_prop0.2 (training; use 0.0 for embeddings),cls_token_idx1,pad_token_idx0,chrom_token_right_idx2,chrom_token_offset237411. A wrong offset does not raise. It silently produces well-formed embeddings that differ from the trained tokenisation. For this model (smoke test, section 4), offset 1000 gives cosine 0.8485 on macaque and 0.9945 on human cells to the correct embeddings; kNN accuracy moves by at most 0.011, and on the human cells the per-cell loss is unchanged (0.3516 vs 0.3517), so downstream scores may not reveal it. Always take the offset from the checkpoint (load_cell_sentence_params).negatives_universe/gene_universe_dirare training-only and are not read at inference. - Per-cell RNG: UCE-brain seeds each cell's sentence sampler with the cell's row position in the AnnData. Results are reproducible for the same row order, and a cell embedded at another position gets a different, equally valid draw.
- Not shipped:
all_tokens_v2026-09.torch(the ESM2 gene-token table, 5.4 GB), because the identical table is stored inmodel.safetensorsasuce.embedding_layer.embedding.weight, and the per-dataset gene universes used for the negatives. Both are only needed to train.
6. Caveats
- Pilot research model. One seed. Run-to-run noise was not measured, and benchmark differences of about 0.01 F1 are likely within it.
- No benchmarked control (section 3). The improvements over the parent cannot yet be attributed to the BICAN data rather than to the extra 65,536 low-learning-rate steps.
- Several eval sets are in-distribution for the anneal. The striatum sets are cells of the BG caches this anneal trained on, apart from two held-out donors. The macaque held-out donor's non-basal-ganglia NeMO libraries were trained on (section 1).
- Forgetting outside BICAN. The held-out loss on the Census and Discover caches rose by 0.004
to 0.024 (zebrafish most) against the parent. If you work outside BICAN-style brain data, also
compare with the parent
KuanP/brain-uce-pilot-mix-v3-d768l14v2. - Donor structure. This model has the lowest donor-mixing entropy of the 17 benchmark models (16 on the marmoset sets) on 8 of 9 sets. It has the lowest or second-lowest batch ASW (second only to the parent) on all 9 sets. Expect to need batch correction for integration-style uses.
- Not a drop-in replacement for the 512-d pilots: different output width (768), different
architecture keys in
config.json, and it needs UCE-brain with v2 support (branchd768l14-v2, ormainonce that is merged). That branch is not yet published on GitHub (section 4). - Training code is not public: the run used commit
80f6c04of the privateuce-training-suiterepository plus uncommitted working-tree changes (the v2 model options among them). The architecture needed for inference is in UCE-brain (section 4). - License not yet chosen. The front matter says
license: otherbecause the authors have not selected a license. Until they do, please contact them before any use beyond evaluation. - Pretraining sources: CELLxGENE Census build 2025-11-08 (human, mouse, rhesus macaque,
marmoset, chimpanzee); BICAN NeMO and BrainGenome (multi-species brain; BrainGenome is the
earlier cards' name for the three HMBA basal-ganglia atlas caches
bg_*); CELLxGENE Discover (human, mouse, rat, mouse lemur, pig, zebrafish). The attribution and terms of use of those original sources apply to the data this model was trained on. The anneal used only the BICAN caches: NeMO (nemo_*) and the HMBA basal-ganglia atlas (bg_*). - Coverage is designed, not uniform: the parent's mixture C (60 % human, 23 % mouse, 68 % brain), then an all-brain anneal with 42 % mouse and 30 % human samples (section 1).
- Species outside the vocabulary (any key not listed above) cannot be embedded without building a new gene mapping and token table.
- No evaluation ran during training; the numbers in section 3 come from the separate
uce_brain_v1benchmark run after training finished.