bio.rodeo
ModelsOrganizationsProvidersLeaderboardAboutSign in
bio.rodeo

The authoritative source for evaluating biological foundation models. No hype, just honest analysis.

Categories
  • DNA & Gene
  • RNA
  • Protein
  • Small molecule
  • Single-cell
  • Spatial omics
  • Pathology
  • Imaging
  • Metabolomics
  • Biosignals
  • Language model
bio.rodeoModelsOrganizationsProvidersLeaderboardAboutFAQSubmit a modelContact
© 2026 Pulsatance. All rights reserved. ~
Built by Pulsatance
Spatial omics foundation models
Spatial omicsSingle-cell

SToFM

Tsinghua University / PharMolix Inc. / Peking University

Spatial transcriptomics foundation model pairing gene-scale cell embeddings with an SE(2) Transformer over cell coordinates, pretrained on 88M cells.

Released: July 2025

SToFM is a foundation model for spatial transcriptomics (ST) that learns cell representations from three scales of tissue information at once: the gene expression profile of each cell, the micro-scale composition of its immediate neighborhood, and the macro-scale morphology of the slice it sits in. It was developed at the Institute for AI Industry Research at Tsinghua University with PharMolix and Peking University, and published at ICML 2025.

The gap it addresses is structural. Single-cell foundation models such as Geneformer and scGPT encode a cell's transcriptome but discard where that cell sits in the tissue; Nicheformer pretrains on ST data yet still encodes each cell independently. CellPLM was the first to combine expression with coordinates, but treats a tissue as a flat set of cells. SToFM's argument is that a slice carries information at several resolutions simultaneously, and that a model seeing only one of them loses the tissue architecture that makes ST worth generating.

The practical obstacle is scale: an ST slice can contain hundreds of thousands of cells, far past what pairwise attention can absorb. SToFM decomposes each slice into sub-slices of roughly 1,000 spatially contiguous cells and injects a compressed summary of the whole slice into every one of them, so local attention retains a view of global structure.

#Key Features

  • Virtual cells carry macro structure: Leiden clustering over a blend of cell embeddings and coordinates produces around 50 cluster centroids per slice, each appended to every sub-slice as a "virtual cell" that encodes the slice's overall morphology and partitioning.
  • SE(2)-invariant spatial attention: the model consumes a pairwise distance matrix rather than raw coordinates, passed through a learnable Gaussian module into pair representations that bias attention, making outputs invariant to translation and rotation of the slice.
  • Domain-adapted transcriptome encoder: the Geneformer-initialized cell encoder is incrementally trained on ST cells with masked gene modeling plus self-supervised contrastive learning, compensating for ST's shallower gene coverage and higher dropout relative to scRNA-seq.
  • Two spatial pretraining objectives: masked cell modeling reconstructs the embeddings of 10% of masked cells, while pairwise distance recovery restores coordinates perturbed with Gaussian noise, forcing the model to relate expression to position.
  • Frozen-embedding usage: all headline results come from training small task heads on frozen SToFM outputs, so downstream use does not require fine-tuning the backbone.

#Technical Details

The cell encoder is a 12-layer transformer with hidden size 512, 8 attention heads, a 25,426-token gene vocabulary, and a 2,048-token context. The SE(2) Transformer above it is 4 layers with hidden size 256, taking up to 2,048 cell and virtual-cell tokens per sub-slice. Pretraining used SToCorpus-88M — approximately 2,000 high-resolution slices totaling 88 million human and mouse cells from six technologies (MERFISH, 10x Xenium, CosMx, SeekSpace, Stereo-seq, Slide-seqv2), about 1.6-fold larger than the previous largest ST corpus and covering twice as many technologies. Training ran one epoch of domain adaptation followed by three epochs of multi-scale representation learning on 4 NVIDIA A100 GPUs over roughly 20 days.

With head tuning on frozen embeddings, SToFM leads every reported task. On cross-slice tissue region segmentation it reaches macro F1 0.4588 on human embryo Stereo-seq slices versus 0.3985 for CellPLM, and 0.6437 on DLPFC 10x Visium layers versus 0.5953 — notable because Visium appears in no model's pretraining data. Cell type annotation on mouse brain gives macro F1 0.4951 and 0.8362 against best baselines of 0.4186 and 0.7575. Zero-shot Leiden clustering of embeddings on a MERFISH mouse brain slice scores ARI 0.953 / NMI 0.921, against 0.902 / 0.891 for CellPLM. Cross-slice spatial deconvolution on mouse liver reaches Pearson 0.7546, and gene imputation on human skin Xenium data 0.4877.

#Applications

SToFM produces general-purpose cell embeddings that a lab can attach a linear or shallow head to for the standard ST analysis stack: annotating anatomical regions in developmental and neuroanatomical atlases, assigning cell types where sparse gene capture defeats expression-only methods, deconvolving spot-level data into cell type proportions, and imputing genes a targeted panel never measured. Because its margins are widest in the cross-slice setting, it suits transferring annotations across a slide series rather than relabeling each slice from scratch.

#Impact

SToFM shows that explicit multi-scale decomposition, rather than a larger flat context, is an effective way to bring tissue architecture into ST representation learning, and its ablation confirms each scale contributes independently. The code is MIT-licensed, the pretrained cell encoder and SE(2) Transformer checkpoints are downloadable, and SToCorpus-88M is public, making the corpus itself a reusable asset for the field; the authors plan to fold the model into PharMolix's OpenBioMed toolkit. Limitations are acknowledged: the model spans only three scales, ignores histology images and ligand-receptor priors that could sharpen microenvironment modeling, and its evaluations rest on a handful of slices per task rather than large held-out cohorts.

Citation

Preprint

DOI: 10.48550/arXiv.2507.11588

Recent citations

Papers that recently cited this model.

Not enough citation data yet.

Top citations

The most-cited papers that cite this model.

Not enough citation data yet.

Where to run SToFM

Providers that host SToFM for inference, fine-tuning, or weight download.

No providers recorded yet. Browse all providers

Fields of citing research

Not enough data

Openness

bio.rodeo opennessOpen weights · open weights, closed recipe
71Open
Usability — can I run it?94
Reproducibility — can I retrain it?43

Tags

cell_type_annotationfoundation_modelsegmentationspatial_transcriptomicstransformer

Resources

GitHub RepositoryResearch PaperResearch PaperDatasetLink