Discovery of a Hematopoietic Manifold in scGPT Yields a Method for Extracting Performant Algorithms from Biological Foundation Model Internals
Organizations: Department of Computer Science, University of Tübingen, Tübingen, Germany
Abstract
We report the discovery and extraction of a compact hematopoietic algorithm from the single-cell foundation model scGPT, to our knowledge the first biologically useful, competitive algorithm extracted from a foundation model via mechanistic interpretability. We show that scGPT internally encodes a compact hematopoietic manifold with significant developmental branch structure, validated on a strict non-overlap Tabula Sapiens external panel and confirmed via frozen-head zero-shot transfer to an independent multi-donor immune panel. To isolate this geometry, we introduce a general three-stage extraction method consisting of direct operator export from frozen attention weights, a lightweight learned adaptor, and a task-specific readout, producing a standalone algorithm without target-dataset retraining. In 88-split donor-holdout benchmarks against scVI, Palantir, DPT, CellTypist, PCA, and raw-expression baselines, the extracted algorithm achieves the strongest pseudotime-depth ordering and leads on key subtype endpoints (CD4/CD8 AUROC 0.867, mono/macro AUROC 0.951). Compared to standard probing of frozen scGPT embeddings with a 3-layer MLP, the extracted head is BH-significantly better on 6/8 classification endpoints while completing a full 12-split evaluation campaign 34.5x faster with approximately 1000x fewer trainable parameters. The exported operator compresses from three pooled attention heads to a single head without statistically significant loss, and further to a rank-64 surrogate. Mechanistic interpretability of the compact operator reveals a concentrated four-factor core explaining 66.2% of ablation impact, with factors resolving into explicit T/lymphoid, B/plasma, granulocytic, and monocyte/macrophage gene programs. A supplementary second-manifold validation (intercellular communication geometry) confirms that the extraction method generalizes beyond hematopoiesis.
Figures & tables
| Panel | Trust. | Random | Donor | Branch |
|---|---|---|---|---|
| Internal (H65, ) | 0.979 | 0.495 | 0.496 | 0.382 |
| External lung ( ) | 0.617 | 0.236 | 0.687 | 0.058 |
| External Tabula non-overlap ( ) | 0.985 | 0.594 | 0.596 | 0.453 |
| Panel | Anchors | Donors | Stages | Corr | Corr resid | Trustworthiness | Blocked |
|---|---|---|---|---|---|---|---|
| External multi-donor zero-shot | 165 | 7 | 7 | 0.500 | 0.476 | 0.993 | 0.0005 |
| Method | Branch bal. acc. | Branch macro-F1 | Stage bal. acc. | Stage macro-F1 | CD4/CD8 AUROC | Mono/Macro AUROC | Pseudotime Spearman |
|---|---|---|---|---|---|---|---|
| H65 anchor head (10D) | 0.750 | 0.557 | 0.465 | 0.184 | 0.803 | 0.934 | 0.093 |
| H65 cell head (10D) | 0.828 | 0.584 | 0.552 | 0.216 | 0.867 | 0.951 | 0.249 |
| H65 hybrid conservative (10D) | 0.815 | 0.599 | 0.542 | 0.217 | 0.858 | 0.949 | 0.132 |
| Raw baseline (1200 log1p) | 0.826 | 0.595 | 0.567 | 0.219 | 0.805 | 0.833 | -0.044 |
| PCA-10 baseline | 0.733 | 0.543 | 0.503 | 0.194 | 0.842 | 0.944 | -0.007 |
| SVD-10 baseline | 0.731 | 0.541 | 0.499 | 0.192 | 0.842 | 0.936 | 0.002 |
| Method | Mean diff | Wilcoxon BH- | |
|---|---|---|---|
| H65 hybrid conservative (10D) | 88 | -0.056 | |
| H65 anchor head (10D) | 88 | -0.092 | |
| SVD-10 baseline | 88 | -0.185 | |
| PCA-10 baseline | 88 | -0.194 | |
| Raw baseline (1200 log1p) | 88 | -0.226 | |
| CellTypist stage-probability baseline | 88 | -0.260 |
| Extracted 10D head + MLP2 | Frozen scGPT + 3-layer MLP | Direct raw MLP ( ) | |
| Key classification metrics | |||
| Branch bal. acc. | 0.827 | 0.810 | 0.818 |
| Stage bal. acc. | 0.468 | 0.403 | 0.504 |
| CD4/CD8 AUROC | 0.856 | 0.817 | 0.827 |
| Mono/Macro AUROC | 0.956 | 0.946 | 0.920 |
| Training and deployment cost | |||
| Operator variant | Size | BH-sig. losses (of 8) | Key note |
|---|---|---|---|
| Full drift (3 pooled heads) | 17.5 MB | — | Reference |
| Compact top1 (L2H5) | 5.9 MB | 0/8 | Best single head |
| Top1 + rank 64 | 0.73 MB | 5/8 | Viable low-rank boundary |
| Top1 + rank 32 | 0.37 MB | 6/8 | Degraded |
| Hard sparse (16 factors, 60 genes) | 0.12 MB | 7/8 | Interpretable, baseline-level |
| Factor | Role | Drop | Top read/write genes | Enriched programs |
|---|---|---|---|---|
| f01 | Branch routing | 0.430 | R: CSF3R, SLC6A1, IL7R; W: CSF3R, SLC25A37, FCER1G | Mono/macro diff.; naïve CD8 + T; granulopoiesis |
| f02 | Lymphoid contrast | 0.254 | R: IL7R, GSTPL, IGF2R; W: HLA-DRA, MARCH6, IGKV5 | Lymphoid B vs T/NK; CD4 + T maturation |
| f00 | Stage ordering | 0.280 | R: EPB41, GMR1, VPEL3; W: ISHC, LGALS14, EPB41 | Classical monocyte; naïve CD8 + T program |
| f03 | Mono/macro struct. | 0.241 | R: LGALS3, GT58, LYZ; W: VPEL5, ALPL, SLC28A3 | Macrophage; granulocyte; B-cell markers |
| Metric | Anchor-trained | Cell-trained |
| Corr (projected distance vs target) | 0.607 | 0.614 |
| Residualized corr | 0.605 | 0.612 |
| Trustworthiness | 0.972 | 0.969 |
| CD4/CD8 AUC(abs), global 3D | 0.744 | 0.886 |
| Monocyte/Macrophage AUC(abs), global 3D | 0.759 | 0.937 |
| Normalized within-stage spread | 0.217 | 0.314 |
| Metric | Anchor-trained | Cell-trained | Hybrid strong-topology | Hybrid conservative |
|---|---|---|---|---|
| Corr | 0.607 | 0.614 | 0.473 | 0.634 |
| Residualized corr | 0.605 | 0.612 | 0.472 | 0.632 |
| Trustworthiness | 0.972 | 0.969 | 0.969 | 0.959 |
| CD4/CD8 AUC(abs), global 3D | 0.744 | 0.886 | 0.934 | 0.911 |
| Monocyte/Macrophage AUC(abs), global 3D | 0.759 | 0.937 | 0.914 | 0.851 |
| Normalized within-stage spread | 0.217 | 0.314 | 0.348 | 0.318 |
| Method | Mean signed | Mean | Positive-share (%) | |
|---|---|---|---|---|
| H65 anchor head (10D) | 307 | 0.093 | 0.235 | 65.1 |
| H65 cell head (10D) | 352 | 0.249 | 0.439 | 71.0 |
| H65 hybrid conservative (10D) | 307 | 0.132 | 0.364 | 64.5 |
| Raw baseline (1200 log1p) | 307 | -0.044 | 0.266 | 37.5 |
| PCA-10 baseline | 307 | -0.007 | 0.259 | 38.1 |
| SVD-10 baseline | 307 | 0.002 | 0.279 | 51.8 |
| Metric | Cell head mean | Best comparator (mean) | Mean diff | Wilcoxon BH- |
|---|---|---|---|---|
| Branch balanced accuracy | 0.828 | Raw baseline (0.826) | -0.0018 | |
| Branch macro-F1 | 0.584 | Palantir baseline (0.621) | +0.0358 | |
| Stage balanced accuracy | 0.552 | Raw baseline (0.567) | +0.0148 | |
| Stage macro-F1 | 0.216 | Palantir baseline (0.242) | +0.0254 | |
| CD4/CD8 AUROC | 0.867 | H65 hybrid conservative (0.858) | -0.0088 | |
| CD4/CD8 balanced accuracy | 0.798 | H65 hybrid conservative (0.794) | -0.0025 |
| Method | ARI | AMI | NMI | V-measure |
|---|---|---|---|---|
| H65 anchor head (10D) | 0.269 | 0.546 | 0.547 | 0.547 |
| H65 cell head (10D) | 0.330 | 0.520 | 0.521 | 0.521 |
| H65 hybrid conservative (10D) | 0.387 | 0.618 | 0.619 | 0.619 |
| Raw baseline (1200 log1p) | 0.393 | 0.626 | 0.627 | 0.627 |
| PCA-10 baseline | 0.305 | 0.581 | 0.582 | 0.582 |
| SVD-10 baseline | 0.326 | 0.591 | 0.592 | 0.592 |
| Method | ARI | AMI | NMI | V-measure | |
|---|---|---|---|---|---|
| H65 anchor head (10D) | 2 | 0.613 | 0.670 | 0.670 | 0.670 |
| H65 cell head (10D) | 4 | 0.120 | 0.293 | 0.294 | 0.294 |
| H65 hybrid conservative (10D) | 3 | 0.255 | 0.410 | 0.410 | 0.410 |
| Raw baseline (1200 log1p) | 3 | 0.338 | 0.437 | 0.437 | 0.437 |
| PCA-10 baseline | 2 | 0.145 | 0.288 | 0.288 | 0.288 |
| SVD-10 baseline | 3 | 0.358 | 0.461 | 0.462 | 0.462 |
| Method | TSP10 | TSP14 | TSP17 | TSP26 |
|---|---|---|---|---|
| Raw baseline (1200 log1p) | ok | fail | ok | ok |
| PCA-10 baseline | ok | ok | fail | fail |
| SVD-10 baseline | ok | ok | fail | ok |
| Frozen scGPT avg-pool | fail | ok | fail | fail |
| Frozen scGPT CP- <cls> | fail | ok | fail | ok |
| H65 anchor head (10D) | ok | fail | ok | fail |
| Metric | H65 cell head (10D) | scGPT avg-pool | scGPT CP- <cls> |
|---|---|---|---|
| Branch balanced accuracy ( ) | 0.866 | 0.880 | 0.861 |
| Branch macro-F1 ( ) | 0.529 | 0.526 | 0.503 |
| Stage balanced accuracy ( ) | 0.610 | 0.593 | 0.570 |
| Stage macro-F1 ( ) | 0.188 | 0.154 | 0.145 |
| CD4/CD8 AUROC ( ) | 0.890 | 0.825 | 0.828 |
| Mono/Macro AUROC ( ) | 0.926 | 0.798 | 0.775 |
| Metric | H65 cell head (4D) + linear | Frozen scGPT avg-pool + MLP | 95% CI | BH- | ||
|---|---|---|---|---|---|---|
| Branch macro-F1 | 40 | 0.597 | 0.547 | -0.045 | [-0.067, -0.023] | 0.010 |
| Branch balanced accuracy | 40 | 0.801 | 0.810 | 0.010 | [-0.001, 0.024] | 0.192 |
| Stage macro-F1 | 40 | 0.236 | 0.157 | -0.078 | [-0.087, -0.068] | 0.0013 |
| Stage balanced accuracy | 40 | 0.540 | 0.403 | -0.127 | [-0.164, -0.086] | 0.0020 |
| CD4/CD8 AUROC | 29 | 0.845 | 0.817 | -0.026 | [-0.033, -0.018] | 0.0013 |
| CD4/CD8 balanced accuracy | 29 | 0.780 | 0.744 | -0.034 | [-0.045, -0.025] | 0.0013 |
| Metric | H65 cell head (10D) + MLP2 | Frozen scGPT avg-pool + MLP | 95% CI | BH- | ||
|---|---|---|---|---|---|---|
| Branch balanced accuracy | 40 | 0.827 | 0.810 | 0.017 | [0.012, 0.024] | 0.0011 |
| Branch macro-F1 | 40 | 0.556 | 0.547 | 0.010 | [-0.003, 0.022] | 0.194 |
| Stage balanced accuracy | 40 | 0.468 | 0.403 | 0.063 | [0.048, 0.077] | 0.0011 |
| Stage macro-F1 | 40 | 0.180 | 0.157 | 0.024 | [0.020, 0.027] | 0.0011 |
| CD4/CD8 AUROC | 29 | 0.856 | 0.817 | 0.038 | [0.032, 0.044] | 0.0011 |
| CD4/CD8 balanced accuracy | 29 | 0.779 | 0.744 | 0.034 | [0.028, 0.040] | 0.0011 |
| Metric | Frozen scGPT + MLP | Direct raw1200 | Direct raw1200 | Extracted 10D + MLP2 |
|---|---|---|---|---|
| Branch balanced accuracy | 0.810 | 0.814 | 0.818 | 0.827 |
| Branch macro-F1 | 0.547 | 0.550 | 0.557 | 0.556 |
| Stage balanced accuracy | 0.403 | 0.499 | 0.504 | 0.468 |
| Stage macro-F1 | 0.157 | 0.190 | 0.186 | 0.180 |
| CD4/CD8 AUROC | 0.817 | 0.828 | 0.827 | 0.856 |
| CD4/CD8 balanced accuracy | 0.744 | 0.758 | 0.759 | 0.779 |
| Component | Scope | H65 cell head (4D) + linear | Frozen scGPT avg-pool + MLP |
|---|---|---|---|
| Reference 1200-gene matrix extraction | one-time shared | 164.7 s | |
| Method-specific cache build | one-time | 99.5 s (drift + head training) | 5163.8 s (avg-pool extraction) |
| Per-split evaluation | mean / split | 8.8 s | 159.2 s |
| Trainable parameters / task | downstream | 5–170 | 172,610–174,690 |
| Factor | Role | Drop | Top read/write genes | Enriched programs |
|---|---|---|---|---|
| f01 | Branch routing | 0.430 | R: EPB41, GBR1, VPEL3, GPX1, TAL001; W: DIF2R, EPB41, VPEL5, RBXP3L, RMT39 | Classical and non-classical monocyte identity |
| f02 | Lymphoid contrast | 0.254 | R: IL7R, GSTPL, DIF2R, ChrFTB, GPFC, FNL; W: HLA-DRA, MARCB9, AC96579.19, IGKC, IGLC1 | Naïve CD8 + T-cell; thymic CD4 + ; B-cell lineage |
| f00 | Stage ordering | 0.280 | R: IL7R, TENTSC, GSPT1, GVPC, GBK1, PRBX2; W: CSF3R, SLC2BA1, S100A8, ELR2, ACSL1, PRBB | Naïve CD8 + T-cell; T-regulatory; granulopoiesis |
| f03 | Mono/macro struct. | 0.241 | R: LGALS3, BLC2L1, LV2, THBS1, C10A, BLVR8; W: VPEL1, ALPL, SLC28A3, FIG30R, ALT8, TENTSC | Macrophage; phagocyte; granulocyte/neutrophil |
| Unit | Corr resid | Trustworthiness | CD4/CD8 AUC 3D | Mono/Macro AUC 3D |
|---|---|---|---|---|
| L2H5 (screen rank 1) | 0.634 | 0.985 | 0.711 | 0.873 |
| L0H3 (screen rank 2) | 0.627 | 0.981 | 0.743 | 0.769 |
| L6H6 (screen rank 3) | 0.621 | 0.984 | 0.765 | 0.867 |
| L6H4 (screen rank 4) | 0.610 | 0.986 | 0.765 | 0.810 |
| L0H7 (screen rank 5) | 0.636 | 0.977 | 0.746 | 0.765 |
| Endpoint | Best subset | Size | Best / intact |
|---|---|---|---|
| Branch BA | 4 | 69.7% | |
| Branch F1 | 4 | 71.7% | |
| Stage BA | 4 | 44.0% | |
| Stage F1 | 4 | 45.5% | |
| CD4/CD8 AUROC | 3 | 83.1% | |
| CD4/CD8 BA | 3 | 82.9% |
| Run (key change) | External corr | vs PCA2 |
|---|---|---|
| v4 (pair hygiene + hard negatives) | 0.8850 | -0.0909 |
| v5 (cell-trained transfer head) | 0.9624 | -0.0199 |
| v7 (metric head + cleaned pair set + ensemble) | 0.9707 | -0.0061 |
| v9 (cell-metric head + ensemble) | 0.9800 | +0.0032 |
| v10 (MLP-geom/dim6 extras) | 0.9747 | -0.0021 |
| v11 (raw diverse 100k-cell internal training + ensemble) | 0.9825 | +0.0057 |
Single-Cell Transcriptomics
Single-cell transcriptomics measures gene activity cell by cell to map cell types, states, interactions, and responses across tissues and conditions.
See all 65 papers