/ Модель

Характеристики

Параметры
320 млн
Лицензия
Своя лицензия
Архитектура
uce · dense
Библиотека
uce_brain
Опубликована
21 окт 2026

brain-uce-pilot-mix-v3-d768l14v2

ЭмбеддингиТекст → embedding3 профессии
8скачиваний за 30 дней0лайковвеса обновлены21 окт 2026

Описание модели

Составлено на русском по карточке модели и метаданным Hugging Face

Пилотная UCE-модель строит 768-мерные эмбеддинги клеток мозга по одноклеточным RNA-seq данным для сравнительного анализа клеток и видов.

KuanP/brain-uce-pilot-mix-v3-d768l14v2 — экспериментальная модель в стиле Universal Cell Embedding (UCE) для построения эмбеддингов отдельных клеток мозга по данным одноклеточного RNA-seq. Модель разработана автором репозитория KuanP и обучена с нуля на смеси данных v3: около 147,7 млн клеток 13 видов, включая человека, мышь и макаку. В метаданных указаны архитектура UCEForExpressionPrediction и 320,2 млн параметров; README сообщает о 114,0 млн обученных параметров и размере эмбеддинга 768 измерений.

Энкодер принимает упорядоченную по хромосомам последовательность замороженных токенов генов ESM2 и выдаёт L2-нормированный вектор клетки. Это пилотный чекпойнт с 14 слоями, размерностью 768, нормализацией RMSNorm и SwiGLU; обучение шло 262 144 шага. Модель предназначена для извлечения клеточных представлений, пригодных для анализа и сравнения клеток мозга разных видов. Для загрузки требуется специальная ветка d768l14-v2 пакета UCE-brain; старые версии пакета чекпойнт не загружают.

Лицензия в метаданных обозначена как other, поэтому конкретные условия использования следует проверять в карточке репозитория. README характеризует модель как пилотную и не приводит результатов оценки качества; она обучалась без валидации на описанном прогоне.

Сценарии применения

  • построение эмбеддингов клеток мозга по данным single-cell RNA-seq
  • сравнение клеточных профилей между видами
  • получение векторных представлений клеток для последующей кластеризации
  • подготовка представлений клеток для downstream-анализа экспрессии генов

Ограничения

Это пилотная модель без приведённых в карточке результатов оценки качества; запуск требует специальной ветки UCE-brain d768l14-v2, поскольку старые версии пакета не поддерживают её конфигурацию. Лицензия указана как other, поэтому условия использования нужно сверить в репозитории.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus, LLM Stats

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

brain-uce-pilot-mix-v3-d768l14v2

A pilot Universal Cell Embedding (UCE)-style model for brain single-cell RNA-seq, trained from scratch on "data mix v3" (mixture C), the same designed mixture over the v2026-09 corpus (26 caches, 147,675,214 cells, 13 species) as KuanP/brain-uce-pilot-mix-v3, for 262,144 steps at global batch 256 on 8 A100 GPUs. It keeps the UCE input (a chromosome-ordered "cell sentence" of frozen ESM2 gene tokens) and changes the network and objective to follow the public 33-layer UCE model more closely: a separate target-gene layer and an MLP cell head, a pre-norm RMSNorm / QK-norm / SwiGLU encoder (14 layers, d 768), L2-normalised gene tokens, mask 0.20 with dataset-expressed negatives and dropout 0.05. It has 114.0M trained parameters and outputs a 768-d, L2-normalised cell embedding; all earlier pilots in this series output 512-d embeddings.

Benchmark namemixv3_d768l14v2_262k
Training runbrain_mixC_v2026_09_d768l14v2_noeval_262144steps/2026-10-18_03-33-38
Codetraining: uce-training-suite (remote in training/git_info.json; a private repository, so this commit is not publicly reachable), branch ucsc-brain, commit 3c5ffe9c7893783a345fc510fb7914728e122cc9 plus uncommitted working-tree changes that include the v2 model options (listed in training/git_info.json; not published). Inference: UCE-brain, branch d768l14-v2 (section 4)
Weightsmodel.safetensors, 5,918,299,836 bytes, 151 fp32 tensors, final model at step 262,144
Parameters114,014,209 trained + the frozen 266,403 x 5,120 ESM2 gene-token table (1,363,983,360)
Embedding768-d, unit L2 norm (dot product = cosine similarity)
Statuspilot research model; license not yet chosen (see Caveats)

1. Training data: "data mix v3" (mixture C), the same draw as brain-uce-pilot-mix-v3

The corpus (CELLxGENE Census 2025-11-08 human, mouse, rhesus macaque, marmoset, chimpanzee; BICAN NeMO and BrainGenome multi-species brain; CELLxGENE Discover human, mouse, rat, mouse lemur, pig, zebrafish), the 0.995 / 0.005 train / held-out split (seed 42) and the mixture parameters (training/config.yaml: dataset.mixture) are those of brain-uce-pilot-mix-v3. The trainer materialised the same 67,108,864 samples: training/mixture_summary.json equals the v3 release's file except for cluster paths and an added all-zero heldout_sample counter, and training/dataset_indices_summary.json is byte-identical, so the held-out cells are the same. The difference is how the samples were consumed: 262,144 steps x global batch 256 instead of 131,072 x 512. The d768/12L baseline mixv3_d768l12_262k in section 3 was trained on the same draw at the same batch size and step count.

Mixture rules (see the v3 card for details): species mass proportional to (train cells)^0.7; brain cells re-weighted to at least 67 % within a species; dataset weight proportional to n^0.5 within each (species, brain / non-brain) stratum; sci-RNA-seq3 at half weight; no cache repeated more than 4x in expectation; the two CELLxGENE Discover datasets used for evaluation (0df5d172-5888-4cec-9a96-e637636bbfef, 843c1459-e852-429c-9339-17b5760e7716) and NeMO libraries duplicated in the BrainGenome caches excluded.

speciessamplesshareof which brainbrain share within species
homo_sapiens40,033,42059.65 %26,079,67265.1 %
mus_musculus15,516,98523.12 %9,254,22659.6 %
macaca_mulatta4,493,3276.70 %4,379,53997.5 %
callithrix_jacchus2,588,5863.86 %2,588,586100.0 %
danio_rerio1,734,8682.59 %863,39149.8 %
rattus_norvegicus568,2170.85 %568,217100.0 %
pan_troglodytes551,0430.82 %551,043100.0 %
microcebus_murinus416,8330.62 %220,33352.9 %
sus_scrofa375,6640.56 %251,69567.0 %
monodelphis_domestica265,4490.40 %265,449100.0 %
macaca_nemestrina238,5040.36 %238,504100.0 %
aotus_nancymaae190,7480.28 %190,748100.0 %
tupaia_chinensis135,2200.20 %135,220100.0 %
total (13 species, 26 caches)67,108,864100 %45,586,62367.9 %

"Brain" is the tissue_general == "brain" label only (table identical to the v3 card, because the draw is identical). training/mixture_summary.json reports brain_share 0.712 instead: that is the mixer's expected share under its broader brain definition (tissue_general brain, central nervous system, nervous system or spinal cord).


2. Architecture and training recipe

Verified against config.json (the saved UCEConfig), training/config.yaml (the resolved Hydra config), training/training_args.json and the tensor list of model.safetensors.

Model (UCEForExpressionPrediction, model_type: uce)

input_ids [B, 2048]
  -> Embedding(266403, 5120)                 frozen ESM2 gene-token table (embedding_requires_grad: false)
  -> L2-normalise each token (5120 dims)     token_norm: l2 (no LayerNorm(5120): use_embedding_layer_norm false)
  -> Linear(5120 -> 768) -> GELU -> LayerNorm   input_projection_type: linear_gelu_ln
  -> + sinusoidal PE x 0.0360844 (= 1/sqrt(768))   pe_scale; max_sequence_length 2048
  -> 14 pre-norm blocks                      encoder_impl: uce, norm_first: true; d_model 768, 6 heads x 128;
                                             RMSNorm (norm_type: rmsnorm); QK-norm (RMSNorm over head_dim on q, k);
                                             SwiGLU FFN, hidden 2048 (ffn_type: swiglu); no bias terms
                                             (encoder_bias: false); dropout 0.05 on PE, attention, FFN and residual branches
  -> final RMSNorm                           final_norm: true
  -> position 0 (CLS slot)                   embedding_reduction: cls
  -> cell head (cell_head_type: mlp, cell_head_dims [1024, 768, 768]):
       [Linear 768->1024, LayerNorm, GELU, Dropout 0.05]
       [Linear 1024->768, LayerNorm, GELU, Dropout 0.05]
       [Linear 768->768,  LayerNorm, GELU, Dropout 0.05]
       Linear 768->768
  -> F.normalize
  => cell_embedding [B, 768], unit L2 norm   (output_embedding_dim 768)

Training head (not needed for embeddings): each target gene's frozen token, L2-normalised, goes through a separate target-gene layer Linear(5120 -> 768) -> GELU -> LayerNorm (separate_gene_layer: true; earlier pilots reused the encoder's input projector here). The decoder takes the concatenation [cell embedding 768 | gene 768] and applies decoder_layer_dims [1536, 2048, 512, 128, 1] (Linear -> LayerNorm -> GELU -> Dropout 0.05 per hidden layer, no dropout on its input: decoder_input_dropout: false) to emit one logit.

What changed relative to the earlier pilots

brain-uce-pilot-mix-v3mixv3_d768l12_262k (d768/12L baseline)this model
trained parameters28,905,98590,315,009114,014,209
encoder8 x 512, 4 heads, post-norm LayerNorm, GELU FFN 204812 x 768, 6 heads, post-norm LayerNorm, GELU FFN 307214 x 768, 6 heads, pre-norm RMSNorm + final RMSNorm, QK-norm, SwiGLU FFN 2048, no biases
token inputLayerNorm(5120) -> Linear -> LayerNorm -> GELU, PE x 1sameL2 norm -> Linear -> GELU -> LayerNorm, PE x 1/sqrt(768)
cell head, outputLinear + LayerNorm, 512-dLinear + LayerNorm, 512-d3 MLP blocks + Linear on the CLS row, 768-d
decoder gene inputshared input projectorshared input projectorseparate target-gene layer
decoderDropout -> 1024-512-512-1Dropout -> 1280-512-512-11536-2048-512-128-1, no input dropout
dropout0.10.10.05
masked genes / negatives15 % / any vocabulary gene with zero countsame20 % / dataset-expressed (below)
optimiserAdamW (0.9, 0.999, 1e-8), wd 0.01sameAdamW (0.9, 0.98, 1e-9), wd 0
learning rate1e-4, 500 warm-up steps, cosine to 05e-5, 1,000 warm-up, cosine to 05e-5, 2,000 warm-up, cosine to a 1.5e-5 floor
steps x global batch, GPUs131,072 x 512, 8 H100262,144 x 256, 8 H100262,144 x 256, 8 A100

The design follows the public UCE 33-layer model (Rosen et al.: separate gene_embedding_layer, full_block cell head and decoder, L2-normalised tokens, dropout 0.05, mask 0.20, negatives from the source dataset's genes), with a modern pre-norm encoder in place of its post-norm ReLU stack; QK-norm and the final norm are there for training stability.

Parameter count

From the safetensors header (151 tensors, all F32, 1,479,570,433 elements):

blockelements
uce.embedding_layer.embedding.weight (frozen ESM2 table, 266,403 x 5,120)1,363,983,360
uce.pos_encoder.pe (fixed sinusoidal buffer, 2048 x 1 x 768)1,572,864
trained: encoder (14 blocks + final RMSNorm)99,116,288
trained: input projector uce.input_gene_embedding_projector3,934,464
trained: cell head uce.cell_head2,760,960
trained: target-gene layer gene_embedding_layer (training only)3,934,464
trained: decoder expression_decoder (training only)4,268,033
trained total114,014,209

105,811,712 of the trained parameters (encoder, input projector, cell head) are used to compute an embedding; the training log of the run reports the same total (Trainable: 114,014,209). Weights are stored in fp32 (config.json: dtype float32); training ran under bf16 autocast.

Token vocabulary (vocab_size 266,403)

Identical to brain-uce-pilot-mix-v3 (vocab/ here has the same sha256 for every file): ids 0-3 special tokens (pad_token_idx 0, cls_token_idx 1, chrom_token_right_idx 2); ids 4-237,410 genes of the 11 non-zebrafish species; ids 237,411-239,337 their chromosome-start tokens (chrom_token_offset 237,411 + chromosome_id); ids 239,338-266,376 danio_rerio genes; ids 266,377-266,402 danio_rerio chromosome-start tokens. training/config.yaml: dataset.gene_mapping_path points at all_species_gene_dict_v2026-09.json, the file shipped in vocab/.

Objective: masked expressed-gene prediction with dataset-expressed negatives

Per cell (training/config.yaml: dataset):

  1. Align the cell's raw counts to the species' vocabulary; expressed = count > 0.
  2. Hold out mask_prop = 20 % of the expressed genes from the sentence.
  3. Draw sample_size = 1,024 gene tokens with replacement, probability proportional to log1p(count); group by chromosome, shuffle the chromosome blocks, sort by genomic location inside each block, wrap each block in [CHROM_x] ... [CHROM_END], prepend [CLS], pad to pad_length = 2,048.
  4. Targets: 512 expressed genes (held-out genes first, topped up from the other expressed genes) and 512 non-expressed genes; loss = binary cross-entropy with logits over the 1,024 targets (chance ln 2 = 0.6931).
  5. Dataset-expressed negatives (negatives_universe: dataset_expressed): the 512 negatives are drawn only from genes that have zero counts in the cell and are detected (count >= 1) in at least one of up to 10,000 sampled cells of the same source dataset in the same cache (685 cache x source-dataset groups). Earlier pilots drew negatives from every vocabulary gene with zero count, which includes genes the source assay never measures, a dataset-identity signal the embedding had to carry. Averaged over cells, a dataset's detected set holds 82.7 % of its cache's genes (median over the 685 groups 84.0 %).

Steps 1-4 are the same as in brain-uce-pilot-mix-v3 apart from the mask fraction. Dataset-expressed negatives only change training targets; embeddings depend on steps 1-3 only.

Optimisation (training/config.yaml: training, training/training_args.json)

settingvalue
steps262,144 (= 2^18); max_steps, no epochs
batchper_device_train_batch_size 32 x 8 A100 (one node, ilc cluster) x gradient_accumulation_steps 1 = global batch 256
samples seen262,144 x 256 = 67,108,864 sentences from the materialised mixture (section 1)
optimiseradamw_torch_fused, betas (0.9, 0.98), eps 1e-9, weight_decay 0 (i.e. Adam), max_grad_norm 1.0
learning ratepeak 5e-5, warmup_steps 2,000, cosine_with_min_lr with min_lr_rate 0.3 (floor 1.5e-5, reached at step 262,144)
precisionbf16: true (autocast; fp32 master weights), torch_compile: true (inductor), DDP; the collator trims padding to a multiple of 256 tokens (exact: padded positions are masked out of attention)
data26 species specs, split 0.995 / 0.005 / 0 with seed 42; 10 dataloader workers, persistent
evaluationnone during training (eval_strategy: 'no'); checkpoints every 5,000 steps
initialisationfrom scratch; residual output projections at std 0.02 / sqrt(28) (scaled_residual_init); the gene-token table was loaded from all_tokens_v2026-09.torch and never updated
wall clock42 h 56 min (2026-10-17 to 2026-10-19), no restarts

Training loss. The logged training loss falls from 0.696 (step 20) to 0.406 (mean of the last 1,000 steps 0.4062; 0.4105 around step 131,072); the full curve, every 20 steps, is in training/trainer_state.json. This number is not comparable with the earlier pilots' training losses (brain-uce-pilot-mix-v3 0.371 and mixv3_d768l12_262k 0.369 at their last logged step): mask 0.20 and dataset-expressed negatives make the task harder (the removed negatives are genes never detected in the cell's source dataset, which are easy to call non-expressed).


3. Benchmark results (uce_brain_v1)

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, bf16 autocast. The primary label per dataset is the benchmark config's label_col. Numbers below are read from the benchmark's results.parquet.

Compared models:

  • mixv3_d768l14v2_262k: this model.
  • mixv3_131k_gb512: KuanP/brain-uce-pilot-mix-v3 (512-d, 28.9M trained, same samples).
  • mixv3_d768l12_262k: the d768/12-layer post-norm baseline on the same draw, steps and batch (512-d, 90.3M trained, mask 0.15, vocabulary negatives).
  • 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), embedded with the public repository's own code (fp32, pad 1536) on the same cells. Its table covers fewer of the benchmark genes (0.95 of the human sets, 0.76 macaque, 0.78 marmoset; marmoset cells are embedded through its human table by identical gene symbol), and its code's fixed filter_genes(min_cells=10) step leaves 0.82-0.87 (human), 0.71 (macaque) and 0.74 (marmoset) of the benchmark genes actually fed to the model.

Ranks are among the 16 models scored in the benchmark (15 on the marmoset sets, where the human-only legacy model has no gene overlap), excluding continuations of this checkpoint; continuations of other checkpoints (the d768/12L BICAN mid-training arms) are included. This checkpoint's own BICAN mid-trained continuation (mixv3_d768l14v2_262k_bicanA, not released) scores higher than this model on 8 of 9 sets in both kNN and probe macro-F1; counting it, this model ranks 1st-3rd on kNN and 2nd on probe macro-F1 (15th on pediatric_glioma). All numbers are from the benchmark results as of 2026-10-20 (results.parquet sha256 e2a240ad...829f).

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)/2 and mean(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 and vocabulary-wide negatives (the benchmark has no dataset-expressed path); for this model that is mask 0.20 against 0.15 for the other suite models, so its loss column is not comparable.

Evaluation datasets

datasetspecieswhat it isprimary label / groupscells scored
down_syndromehomo_sapiensfetal cortex, Down syndrome vs control (10x multiome nuclei; CxG 0df5d172): 8 CL cell types, 30 donorscell_type / donor_id60,000
pediatric_gliomahomo_sapienspediatric high-grade glioma (HTAN CHOP, 10x 3' v3 nuclei; CxG 843c1459): 7 CL cell types, 16 patientscell_type / donor_id60,000
hmba_v05_macaquemacaca_mulattaHMBA whole-brain v0.5 macaque, 10x multiome nuclei not in pretraining: 4 donorssubclass / donor57,661
hmba_v05_marmosetcallithrix_jacchusHMBA whole-brain v0.5 marmoset, 10x multiome nuclei not in pretraining: 4 donorssubclass / donor54,423
human_striatumhomo_sapiensBICAN HMBA basal-ganglia atlas, caudate + putamen + nucleus accumbens ROIs, 9 donorscell_type / donor_id59,766
macaque_striatummacaca_mulattaBICAN HMBA basal-ganglia atlas, caudate + putamen + nucleus accumbens ROIs, 7 donorscell_type / donor_id59,822
hmba_v05_macaque_subclass_fullmacaca_mulattasame cells as hmba_v05_macaque, every subclass with >= 20 cells (127), capped at 300 cells per subclasssubclass / donor22,798
hmba_v05_marmoset_subclass_fullcallithrix_jacchussame for marmoset (355 subclasses)subclass / donor86,368
human_striatum_fullhomo_sapienshuman_striatum cells, every cell type with >= 20 cells (29), capped at 3,000 per typecell_type / donor_id53,766

The two Discover datasets were excluded from the training mixture. The striatum sets are cells of the BICAN basal-ganglia caches, which are part of the pretraining corpus, so they measure cell typing on in-distribution data; the HMBA v0.5 sets are the cross-species transfer test.

Donor-grouped kNN macro-F1, primary label (headline)

dataset (label)this modelmixv3_131k_gb512 (brain-uce-pilot-mix-v3)mixv3_d768l12_262kpublic_uce_33lrank of this model
down_syndrome (cell_type)0.79710.76060.76120.78661 of 16
pediatric_glioma (cell_type)0.84250.82260.81810.82551 of 16
hmba_v05_macaque (subclass)0.78180.55340.61920.65561 of 16
hmba_v05_marmoset (subclass)0.31660.19780.23250.27461 of 15
human_striatum (cell_type)0.91660.77510.80710.92682 of 16
macaque_striatum (cell_type)0.79560.63480.67110.71391 of 16
hmba_v05_macaque_subclass_full (subclass)0.51610.37490.42060.39631 of 16
hmba_v05_marmoset_subclass_full (subclass)0.16410.09900.11670.13811 of 15
human_striatum_full (cell_type)0.84440.71700.75420.85172 of 16

First of 16 on 7 of 9 sets (on down_syndrome only by 0.0105 over the public 33L, which is within the likely noise, so read it as a tie); second to the public 33L on the two human striatum sets (0.9166 vs 0.9268 and 0.8444 vs 0.8517). Against brain-uce-pilot-mix-v3 the gain is +0.020 to +0.228 (largest on HMBA macaque, +0.228, and the striatum sets, +0.127 to +0.161); against the d768/12L baseline trained on the same samples it is +0.024 to +0.163.

Donor-grouped linear-probe macro-F1, primary label

dataset (label)this modelmixv3_131k_gb512mixv3_d768l12_262kpublic_uce_33lrank of this model
down_syndrome (cell_type)0.81190.78810.79770.79921 of 16
pediatric_glioma (cell_type)0.81060.82080.81850.790315 of 16 (first: matryoshka_v09_131k 0.8453)
hmba_v05_macaque (subclass)0.75570.60930.67360.67741 of 16
hmba_v05_marmoset (subclass)0.35800.23700.27880.31271 of 15
human_striatum (cell_type)0.93960.83590.88310.93871 of 16
macaque_striatum (cell_type)0.84450.74740.79580.77731 of 16
hmba_v05_macaque_subclass_full (subclass)0.49650.42130.42330.42271 of 16
hmba_v05_marmoset_subclass_full (subclass)0.21580.14190.17640.18171 of 15
human_striatum_full (cell_type)0.88150.79980.83750.86851 of 16

Trade-off: more donor structure is kept

datasetbatch ASW: this modelmixv3_131k_gb512mixv3_d768l12_262kpublic_uce_33lrank (lowest = 1)donor mix: this modelmixv3_131k_gb512mixv3_d768l12_262kpublic_uce_33lrank (lowest = 1)
down_syndrome0.72740.83820.85700.78971 of 160.65430.70280.70140.69411 of 16
pediatric_glioma0.77240.84650.86490.79741 of 160.25650.29550.29860.26241 of 16
hmba_v05_macaque0.67980.84260.87540.74681 of 160.25610.30590.30740.32021 of 16
hmba_v05_marmoset0.74470.85420.88580.78221 of 150.65390.69420.70140.70711 of 15
human_striatum0.73780.85160.86910.73622 of 160.72610.78580.79260.74861 of 16
macaque_striatum0.74840.86890.90690.78171 of 160.63020.69000.69930.71581 of 16
hmba_v05_macaque_subclass_full0.66020.82180.85270.73971 of 160.24960.28430.29150.31131 of 16
hmba_v05_marmoset_subclass_full0.72460.84540.87750.76001 of 150.60420.62160.62660.64291 of 15
human_striatum_full0.76900.87770.89210.79001 of 160.68690.75500.75930.70171 of 16

The model has the lowest batch ASW of all 16 models on 8 of 9 sets (on human striatum the public 33L is 0.0016 lower) and the lowest donor-mixing entropy on all 9: a cell's nearest neighbours of the same type are concentrated on fewer donors than in any other model. Better cell-type separation (label ASW highest of 16 on 7 of 9 sets and second on human_striatum, 0.665 against the public 33L's 0.671, but 12th of 15 on hmba_v05_marmoset_subclass_full, 0.389, below brain-uce-pilot-mix-v3 at 0.416 and the d768/12L baseline at 0.446) is accompanied by more retained donor / batch structure; this is a cross-model observation with one seed per model, not a measured trade-off. Since all classification scores above are donor-grouped, this structure does not inflate them, but for integration-style uses (clustering across donors, donor-mixed neighbourhoods) expect to need batch correction more than with the earlier pilots. The embedding is also lower-rank: participation ratio 4.7-16.4 on these sets, below the d768/12L baseline's on all 9 (8.6-35.3).

mixv3_d768l14v2_262k, primary label, all metrics

dataset (label)labelsfoldsloss (not comparable)kNN F1kNN accprobe F1probe accdonor mixlabel ASWbatch ASWPRPCs95genes mapped
down_syndrome (cell_type)850.40090.79710.92170.81190.92330.65430.60550.72746.5900431.0000
pediatric_glioma (cell_type)750.43590.84250.96840.81060.96440.25650.62630.772416.3831631.0000
hmba_v05_macaque (subclass)5240.37200.78180.88640.75570.88430.25610.68030.679812.5072311.0000
hmba_v05_marmoset (subclass)14540.38300.31660.72620.35800.76100.65390.64110.74479.5059291.0000
human_striatum (cell_type)2150.36160.91660.78850.93960.86080.72610.66540.73785.3535231.0000
macaque_striatum (cell_type)2550.36020.79560.75290.84450.86400.63020.62200.74844.7059161.0000
hmba_v05_macaque_subclass_full (subclass)12740.37770.51610.67440.49650.68580.24960.58320.660215.9904371.0000
hmba_v05_marmoset_subclass_full (subclass)35540.38310.16410.22790.21580.31060.60420.38940.724611.8193401.0000
human_striatum_full (cell_type)2950.37690.84440.93280.88150.95170.68690.76170.769013.1548291.0000

"labels" = labels with >= 50 cells (>= 20 on the _full sets) that are scored; "folds" = number of GroupKFold folds, min(5, number of donors).

mixv3_d768l14v2_262k, additional labels (donor-grouped kNN and probe)

datasetlabelkNN acckNN macro-F1probe accprobe macro-F1
down_syndromeauthor_cell_type0.87320.77020.87720.7827
down_syndromedisease0.49080.48020.48840.4721
down_syndromedevelopment_stage0.24790.13040.27940.1463
pediatric_gliomamerged_cellType0.96840.84250.96710.8123
pediatric_gliomaTumorNormal0.80870.77230.83800.8097
pediatric_gliomamolecularClass0.40810.21200.47050.2362
hmba_v05_macaqueclass0.95390.70330.94690.6548
hmba_v05_macaqueneighborhood0.97020.68190.96650.7288
hmba_v05_macaqueroi0.24680.02250.25680.0224
hmba_v05_marmosetclass0.81830.51340.84320.5562
hmba_v05_marmosetneighborhood0.86890.61820.88680.6509
hmba_v05_marmosetroi0.04990.01100.05950.0130
human_striatumtissue0.25940.15830.27740.1690
macaque_striatumtissue0.30360.22320.30940.2250

disease, TumorNormal and molecularClass are donor-level labels and roi / tissue are brain-region labels; under donor-grouped folds these sit near chance for every model.

Held-out pretraining loss (not comparable across these models)

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 (the same cells for the three models below, since they share the split). This model is scored with mask 0.20, the other two with mask 0.15, all with vocabulary-wide negatives:

modelbg_callithrix_jacchusbg_homo_sapienscensus_homo_sapienscensus_macaca_mulattacensus_mus_musculusdiscover_danio_reriodiscover_homo_sapiensnemo_homo_sapiensnemo_mus_musculus
mixv3_d768l14v2_262k0.36000.36440.37630.36320.36250.33310.35930.37340.3348
mixv3_131k_gb5120.37560.38280.38510.35030.37260.33250.36620.39590.3631
mixv3_d768l12_262k0.37450.38650.38460.34610.37170.32690.36580.39800.3646

One training seed per model, so run-to-run noise was not measured; differences of about 0.01 in F1 are likely within it. Two first places in the tables above fall inside that band and are best read as ties: down_syndrome kNN (+0.0105 over the public 33L) and human_striatum probe (+0.0009).


4. How to use (UCE-brain, branch d768l14-v2)

Load this model with the UCE-brain package at branch d768l14-v2 (to be merged into main). That branch adds the v2 architecture options (L2 token norm, linear_gelu_ln projector, PE scaling, the pre-norm RMSNorm / QK-norm / SwiGLU encoder, the MLP cell head and the separate target-gene layer) to UCE-brain's model, and keeps every earlier released checkpoint loading as before (bitwise-identical embeddings). Its load_model is now strict: it raises on config.json keys or tensors it does not know, which no released checkpoint has (strict=False downgrades this to warnings). Older UCE-brain versions refuse to load this checkpoint: their config check rejects input_projection_type: linear_gelu_ln. The uce_suite package at the training commit 3c5ffe9 does the same; the run used uncommitted v2 changes on top of it.

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. Tested with torch 2.10 / transformers 5.2 and torch 2.13 / transformers 5.15.

Repository layout (its root is a checkpoint directory: config.json and model.safetensors side by side, with the run's config.yaml beside them, the first place UCE-brain looks for the run config that supplies the cell-sentence parameters):

brain-uce-pilot-mix-v3-d768l14v2/
  README.md                          this card
  MANIFEST.md                        sizes + sha256 of every file
  config.json                        UCEConfig (HF PretrainedConfig), including the v2 keys
  model.safetensors                  weights, incl. the frozen 266,403 x 5,120 gene-token table
  config.yaml                        resolved training config; 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     train / val cell counts per cache
    mixture_summary.json             realised mixture draw per cache
    trainer_state.json               training log every 20 steps (loss, grad norm, learning rate); no optimizer state
    training_args.json               Hugging Face TrainingArguments of the run (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, tested on one A100 GPU with the d768l14-v2 code against a local copy of this repository (2,000 HMBA macaque cells -> float32 [2000, 768], unit norm, 151 tensors verified; UCE-brain's own GPU tests reproduce the training suite's embeddings, which the benchmark numbers above come from):

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")   # 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)

Sanity checks after loading: load_model logs that it verified 151 tensors against model.safetensors and that the model has 114,014,209 trainable parameters; embedding norms ~1.0 and width 768; pairwise cosine similarities well below 1.0 (mean 0.58 on the HMBA macaque cells); compute_per_cell_loss well below ln 2 = 0.6931: 0.373 on 512 HMBA macaque cells and 0.355 on 512 human striatum cells. It uses the training mask 0.20 but draws negatives from the cell's zero-count genes among the AnnData's mapped genes, not from the training's dataset-expressed set, so it approximates the training objective (the benchmark's loss column, computed by the training suite, spans 0.360-0.436). 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

  • Raw UMI counts, not normalised or log-transformed. The sentence sampler treats count > 0 as "expressed" and samples tokens with probability proportional to log1p(count); a normalised matrix changes both.
  • Gene symbols: every vocabulary symbol is upper-case; UCE-brain's embed_adata matches symbols case-insensitively by default and resolves Ensembl var_names through var["feature_name"] (or gene_symbol_column). Genes absent from the species' vocabulary are dropped; the fraction mapped is logged.
  • Species must be one of the 12 top-level keys of vocab/all_species_gene_dict_v2026-09.json (UCE-brain also accepts aliases such as human, macaque, marmoset): homo_sapiens (20,076 genes), mus_musculus (22,198), macaca_mulatta (21,513), callithrix_jacchus (21,743), pan_troglodytes (22,543), rattus_norvegicus (23,154), monodelphis_domestica (21,248), sus_scrofa (22,080), aotus_nancymaae (21,779), tupaia_chinensis (21,079), microcebus_murinus (19,994), danio_rerio (27,039). macaca_nemestrina (pig-tailed macaque) was trained through the macaca_mulatta vocabulary; use that key for it.
  • Cell-sentence settings, read from config.yaml: dataset and required to match training exactly: pad_length 2048, sample_size 1024, positive_sample_num 512, negative_sample_num 512, mask_prop 0.2 (training; use 0.0 for embeddings), cls_token_idx 1, pad_token_idx 0, chrom_token_right_idx 2, chrom_token_offset 237411. A wrong offset does not raise; it silently produces well-formed embeddings that differ from the trained tokenisation (for this model, offset 1000 gives cosine 0.85 on macaque and 0.996 on human cells to the correct embeddings, with kNN scores and, on human cells, even the per-cell loss unchanged), so downstream scores will not reveal it. Always take the offset from the checkpoint (load_cell_sentence_params). negatives_universe / gene_universe_dir are training-only and are not read at inference.
  • Per-cell RNG: sentences are sampled; UCE-brain seeds each cell's sampler with the cell's row position in the AnnData, so results are reproducible for the same AnnData row order and comparable across models. The same cell embedded in a different subset or at another position gets a different, equally valid draw (per-cell cosine about 0.985 to the benchmark's cached embedding, which seeds by dataset row; kNN accuracy within 0.006).
  • Not shipped: all_tokens_v2026-09.torch (the 266,403 x 5,120 ESM2 gene-token table, 5.4 GB) is not included because the identical table is stored inside model.safetensors as uce.embedding_layer.embedding.weight. The per-dataset gene universes used for the negatives are not shipped either; both are only needed to train.

6. Caveats

  • Pilot research model. One seed; the v2 recipe was chosen from short pilot runs, not a hyper-parameter search. Run-to-run noise was not measured; benchmark differences of about 0.01 F1 are likely within it.
  • Donor structure. See the trade-off in section 3: this model keeps more donor / batch signal than any other model in the benchmark, by donor-mixing entropy on all 9 sets and by batch ASW on 8 of 9.
  • 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 (branch d768l14-v2, or main once that is merged).
  • Training code is not public: the run used commit 3c5ffe9 of the private uce-training-suite repository 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: other because 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); 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.
  • Coverage is designed, not uniform (same mixture as brain-uce-pilot-mix-v3): 60 % of the training samples are human and 23 % mouse; the eight smallest species contribute 0.2-0.85 % each and brain tissue 68 % of samples.
  • 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_v1 benchmark run after training finished.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · uce_brain

Нельзя запустить

Архитектура uce неизвестна transformers в образе рантайма.

Класс архитектуры
UCEForExpressionPrediction
Ревизия весов
139c7c9

0 моделей