Sudoku: Understanding Spatial Organization of Tissue by Learning to Generate

Mo Chen, Junjie Pang, Adi Lin, Erpai Luo, Zhen Li, Yuxiang Li, Tao Qin, Haiguang Liu, Xuegong Zhang, Shaoshuai Li, Lei Wei, Qijin YinarXiv 2026

TL;DR

Biological tissue isn’t just a soup of cells; it’s an intricate architecture where every cell's identity is constrained by its neighbors, much like numbers on a Sudoku board. This paper introduces SUDOKU, a foundation model for spatial transcriptomics that learns the "rules" of tissue organization by masking out anywhere from a few cells to entire regions and learning to generate the missing pieces. By unifying tissue representation and spatial generation into a single order-free model, SUDOKU takes a compelling step toward simulating virtual tissues—even predicting whether a mutated tumor will recruit immune cells around itself.

What Problem Does This Paper Address?

Spatial transcriptomics (ST) lets biologists measure the activity of ~20,000 genes inside millions of individual cells while recording each cell's exact 2D physical coordinates. In principle, we can now learn the blueprint of organs directly from data.

However, modeling tissue is tricky for three reasons:

  1. Noisy, massive data: Gene expression is sparse and noisy, while cell states naturally form a hierarchy (broad cell types down to fine functional states).
  2. Multi-scale rules: Cells respond to immediate touch and chemical signals, which collectively form larger structures like cortical layers or tumor microenvironments.
  3. No 1D reading order: Unlike text, a slice of brain or liver doesn't run left-to-right.

Existing ST models largely fall into two camps: representation models that mask a fixed fraction of data (capturing only a narrow slice of spatial rules and unable to sample new configurations), or autoregressive generative models that flatten 2D tissue into an artificial 1D sequence—forcing a cell to ignore half its neighbors simply because they appear "later" in line.

Table 1: Pre-training objectives of spatial transcriptomics models. Mask rate: masking rate during training; Generative: whether the output is a distribution over cell states that can be sampled; Order- free: whether generation imposes no order on the cells; Multi-scale: whether the pre-trained model gives representations at more than one spatial scale.

Methods

SUDOKU treats tissue modeling like solving its namesake puzzle, combining a hierarchical cell-state tokenizer with spatial discrete denoising (an absorbing-state discrete diffusion approach).

Figure 1: Spatial discrete denoising. A coordinate-aware spatial transformer predicts masked cel- lular states from visible spatial context across variable masking rates, learning dependencies from local cell–context relationships to multicellular organization. The same model provides contextual representations under full observation and generates missing cellular configurations under partial observation.
  • Hierarchical Tokenizer: Instead of wrestling with 20,000 raw genes per cell, an autoencoder compresses each cell's transcriptome using two-level residual vector quantization (256 codes per level, creating a 65,536-state vocabulary). Level 1 captures the coarse cell type; Level 2 captures subtle residual variations.
  • Variable-Rate Spatial Denoising: During training, SUDOKU grabs a spatial neighborhood of cells and hides a random fraction $t \sim U(0, 1)$. Visible cells enter a bidirectional Transformer as continuous latents (preserving rich detail, inspired by BEiT v2), and physical distances between cells are encoded via 2D axial rotary positional encodings (2D-RoPE) scaled to median cell spacing. The model outputs probability distributions over the two-level discrete codes for all masked positions.
  • Unified Inference: Because $t$ spans from 0 to 1, one backbone handles two regimes. At $t = 0$ (full observation), hidden states act as multi-scale embeddings (controlled simply by pooling over different neighborhood radii). At $t > 0$ (partial observation), SUDOKU iteratively generates missing tissue in $T$ parallel steps, committing the highest-confidence cells first so harder positions benefit from newly generated context.

Datasets

  • Pre-training Corpus: A quality-controlled dataset of 49.1 million cells across 396 single-cell whole-transcriptome sections, spanning 12 organs (normal and tumor) from humans and mice.
  • Evaluation Benchmarks (all held out):
  • Niche Retrieval: HESTA (human embryo Stereo-seq) and DLPFC (human cortex Visium—a spot-resolution platform unseen during pre-training).
  • Multi-scale Clustering: Six whole-transcriptome MERFISH mouse brain sections annotated across cell types, laminar bands, and brain regions.
  • Spatial Generation: A newly constructed benchmark of 972 spatial "inpainting" questions across 31 human/mouse brain and kidney sections, testing four missing geometries (scattered points, interior blocks, shells, multiple blocks).
  • Perturbation Prediction: SPAC-seq, profiling 125 CRISPR-perturbed tumor clones in mouse lung metastases.

Key Insights and Ideas

  • Varying the mask rate teaches multi-scale biology: Hiding 5% of cells forces the model to learn local cell–cell compatibility; hiding 80% forces it to hallucinate coherent multicellular neighborhoods.
  • Distributions beat averages for representation: Ablations show that predicting probability distributions over discrete tokens yields noticeably better embeddings than regressing continuous latents (0.503 vs. 0.429 retrieval AUPRC). If a spatial niche permits either Cell A or Cell B, regression blurs them into a meaningless average, whereas a categorical distribution forces the model to preserve the ambiguity of the context.
  • Hierarchy prevents catastrophic misses: Flattening the 65,536-token vocabulary into a single non-hierarchical codebook causes spatial generation accuracy to plummet from 0.405 to 0.247. Sharing coarse codes lets similar cell states share statistical strength.

Key Results

  • Niche Retrieval & Clustering: SUDOKU beats specialized tools like QueST on 7 of 8 organs in HESTA (reaching 0.932 AUPRC on liver) and generalizes to unseen spot-level Visium data on DLPFC. On mouse brain clustering, simply adjusting the readout radius lets SUDOKU achieve top Adjusted Rand Index (ARI) across all three scales: region (0.342), laminar band (0.493), and cell type (0.520), whereas baselines specialize in either fine or coarse scales.
  • Spatial Generation: Across all 972 masked-tissue puzzles, SUDOKU outperforms both $k$-nearest-neighbor baselines and the autoregressive generative model GeST across every geometry and difficulty tier.
  • Predicting Tumor Immune Recruitment: Given only the transcriptional state of a CRISPR-mutated tumor clone (without being told which gene was knocked out), SUDOKU generates the surrounding 50-µm cellular band. Its predicted immune-cell fraction correlates strongly with ground truth (0.77 Spearman correlation vs. 0.49 for GeST). In a Cd274 (PD-L1) knockout case study—which removes a tumor's "shield" against T-cells—SUDOKU predicts 63% immune infiltration (ground truth: 65%), while GeST collapses to 10%.

Limitations and Future Work

  • Fixed Gene Panels: Because the tokenizer uses an MLP over the whole transcriptome, it expects a fixed input dimension and cannot natively ingest partial targeted gene panels without modification.
  • Fine-Tuning Overhead: Applying SUDOKU to new tissue sections currently still benefits from self-supervised fine-tuning; scaling pre-training across more platforms may unlock stronger zero-shot transfer.
  • Static Transcriptomes & Cell-Level Metrics: Current generation benchmarks score individual cell-type accuracy rather than higher-order neighborhood motifs. Furthermore, SUDOKU models static snapshots of RNA; incorporating histology images, cell morphology, and temporal tissue dynamics remains an open frontier toward a complete virtual tissue.

Summary updated

BibTeX
@misc{chen2026sudoku,
  author = {Mo Chen and Junjie Pang and Adi Lin and Erpai Luo and Zhen Li and Yuxiang Li and Tao Qin and Haiguang Liu and Xuegong Zhang and Shaoshuai Li and Lei Wei and Qijin Yin},
  title = {{Sudoku: Understanding Spatial Organization of Tissue by Learning to Generate}},
  year = {2026},
  eprint = {2611.37044},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.37044},
}
Figure