Does reasoning help
in spatial omics?

Dhruva Rajwade · Marianna Rapsomaniki

Biomedical Data Science Center, CHUV · SIB · University of Lausanne

What We Work On

Represent, Interpret, Perturb

VirtualMultiplexer — Pati et al., Nat. Mach. Intell. 2024
Joint morpho-molecular tissue embeddings — Martinelli et al., LMRL @ ICLR 2026

ATHENA — Martinelli & Rapsomaniki, Bioinformatics 2022
ProteinPNet — McConnell et al., arXiv 2025

CAROT — Driessen et al., Cell Systems 2026
CMonge — Driessen, Rajwade, et al., Nat. Mach. Intell. 2026
Spatial heterogeneity of tumour organoids — Norkin et al., bioRxiv 2026

Tiny Recursive Models

a 7M-parameter model that solves hard puzzles by revising its own answer

5379186834812662845897
Sudoku-Extreme · 87.4% solved
Maze-Hard · 85.3% solved
inputoutput
ARC-AGI-1 / 2 · 44.6% / 7.8%

Jolicoeur-Martineau, Less is More: Recursive Reasoning with Tiny Networks, 2025.

TRM · the architecture

improve the latent state first, then improve the prediction

TRM recursive architecture schematic
1
remove
Strip both loops and what is left is a plain 2-layer transformer — exactly the main baseline we compare against later.
2
3
4
1$x$ — the input question.
2$y$ — the current answer. Starts as noise.
3$z$ — the latent reasoning state.
4Putting it together — read $(x, y, z)$ → update $z$ a few times → use $z$ to improve $y$ → repeat.
how TRM really worksclick to play / pause

From puzzles to tissue

would recursion over space benefit spatial omics?

5379186834812662845897
a cell is fixed by its row, column and box
DLPFC Visium sample
a spot is shaped by its neighbours — DLPFC, cortical layers
HER2ST spot matrix
expression is shaped by tissue architecture — HER2ST, breast tumour

Can TRM iteratively refine predictions
jointly across entire biological samples?

Tasks we train/eval on

expression → domains, and histology → expression

Task 1 · SDI

Spatial domains · DLPFC

expression per spot · 78×128 gridcortical layers · 78×128 grid
  • Input: whole section — a sequence of per-spot PCA-transformed gene expression profiles
  • Output: joint prediction of cortical class per spot (7 layers/classes)
  • In effect a segmentation task: joint multi-class classification over all spots
  • Dataset size: 12 human cortex sections
  • Eval setup: leave-one-slice-out — test slice transformed into train PCA space
  • Metric: ARI — higher is better
Task 2 · H2G

Histology → expression · HER2ST

H&E
H&E · 224×224 patch per spot
expression · 300 genes per spot · 35×35 grid
  • Input: whole slide — a sequence of per-spot FM patch embeddings
  • Output: joint prediction of expression of 300 genes across the whole slide
  • In effect a regression task: log-normalized, continuous expression
  • Dataset size: 36 breast-cancer slides
  • Eval setup: held-out patient slide
  • Metrics: PCC — higher is better · RVD — lower is better

Existing work for both tasks

how each task is usually solved

Task 1 · SDI

Spatial domains · DLPFC

  • Nobody solves it supervised — the standard is clustering / unsupervised methods (SpaGCN, STAGATE, GraphST)
  • Fit per slice — usually on the test slice itself; nothing transfers to the next section
  • Spatial context comes from local graph neighbourhoods
Task 2 · H2G

Histology → expression · HER2ST

  • Train their own image encoders + a regression head (ST-Net, HisToGene, TRIPLEX), or run diffusion on FM patch embeddings (STEM)
  • Predictions are local: patch → spot
  • No work tries to predict the whole slide

Our contributions

One tiny recursive model, reasoning over the whole slide.

  1. 1Trained an 896K-parameter TRM on both tasks, with robust evaluation.
  2. 2Ablated the efficacy of recursion with systematic baselines and ablations.
  3. 3Demonstrated ACT for a continuous task, and partial zero-shot transfer on the discrete task (train on brain, infer on breast).

Baselines to keep recursion honest

same 2-layer block, same parameters — only the loop changes

control 1

No-Recursion 2-Layer

Same parameters and backbone architecture as TRM — equal to a single model forward pass.

control 2

Universal Transformer ×21

Depth-matched: 2 layers × 3 × (6+1) = 42 effective depth. No prediction refinement, no outer supervision.

control 3

336-layer unrolled net

2 × 3 × (6+1) × 8 (Nsup steps) = 336 layers. Fails to fit even the training data.

plus published per-slice methods: SpaGCN, STAGATE, GraphST, 3d-OT (SDI) · HisToGene, BLEEP, TRIPLEX, STEM (H2G)
TRM recursive architecture schematic
remove
Strip both loops and what is left is a plain 2-layer transformer — exactly the main baseline we compare against later.

Domain identification, zero-shot

TRM beats both matched baselines on all 12 held-out slices

0.559
TRM · mean LOSO ARI
0.461
no recursion
0.483
Universal Transformer
0.532
GraphST — which trains on the test slice
ARI · LOSO070809106970717273747576Mean
No Rec. 2-Layer.412.366.466.337.566.580.578.546.447.406.419.413.461
Univ. Transformer.462.407.458.408.636.612.541.547.437.442.410.439.483
TRM (ours).519.492.555.525.695.736.665.591.520.520.466.426.559
SpaGCN †.414.369.354.336.423.406.380.363.340.352.292.293.360
STAGATE †.485.471.518.483.570.535.573.510.478.483.404.376.491
GraphST †.504.527.589.547.621.588.571.547.547.480.417.440.532
3d-OT †.643.639.685.622.684.633.849.798.703.722.646.631.688

† per-sample unsupervised, trained on test slice · green: best · bold: ours

SDI: Prediction refinement over latent recursion steps

prediction at 1, 3, 6 latent steps
Held-out slice 151508. One latent step: noise (ARI 0.003). Three: the gross layers appear (0.417). Six: the boundaries sharpen (0.489).

SDI: Does it transfer to a different tissue?

train on brain, infer on breast (20 GT classes)

Method (zero-shot unless noted)Max ARI
PCA + k-means0.289
No Rec. 2-Layer0.343
No Rec. 2-Layer + spatial0.458
TRM latent0.388
TRM latent + spatial0.538
GraphST — fit on the slice0.577
3d-OT — fit on the slice0.683

We project breast data into the cortex PCA space before clustering. Reality check: adding coordinates helps the plain baseline too (+0.115) — the spatial gain overshadows recursion here.

zero-shot breast cancer transfer
The reasoning latent, learned on cortex, still organizes an unseen cancer tissue — close to methods trained on that very slice.

Histology → expression: best supervised result

B1 holdout, STEM protocol, 300 genes

0.785
TRM · PCC over all 300 genes
0.762
no recursion
0.745
Universal Transformer
0.598
STEM — previous best
MethodPCC-10PCC-300RVD
No Rec. 2-Layer0.8650.7620.257
Univ. Transformer0.8300.7451.088
TRM (ours)0.8830.7850.354
HisToGene †0.6810.52510.34
BLEEP †0.7730.5650.603
TRIPLEX †0.7910.5770.643
STEM †0.8300.5980.069

STEM keeps the best RVD — it’s a diffusion model, built to match variance. We close most of that gap with adaptive halting, two slides from now.

predicted clusters vs pathologist annotations
Clustering TRM’s predicted expression recovers the pathologist’s annotations on the held-out slide.

How deep is deep enough?

which axis of recursion matters

DLPFC recursion ablation
SDI · (a) ARI saturates at ~3 blocks. (b) higher NZH lets more NZL steps help. (c) cutting NZL from 6 to 1 costs 0.25 ARI.
HER2ST recursion ablation
H2G · (a) PCC also saturates at ~3 blocks. (b) prediction refinement drives it: NZH 1→3 improves PCC 0.51→0.72. (c) in a complete forward pass, performance is already saturated and additional NZL adds nothing.
TRM recursive architecture schematic
remove
Strip both loops and what is left is a plain 2-layer transformer — exactly the main baseline we compare against later.

Adaptive computation time (ACT)

let the model decide when to stop recursing

Test-time scaling

The model automatically allocates compute for each problem at inference.

ACT

Lets the model determine computation through the number of reasoning steps — recursion, for us.

1Each outer recursion (Nouter) updates $(z, y)$ and a halt head predicts $q_k = \sigma(\mathrm{halt}(z_k))$.
2Inference: stop at the first $k$ with $q_k > \theta$; otherwise run to $K_{\max}$.
3Training: $\mathcal{L} = \sum_k \big[\mathcal{L}_{\mathrm{task}}(y_k) + \mathrm{BCE}(q_k, t_k)\big]$, where $t_k$ indicates whether the answer is good enough (binary: correct/incorrect in discrete tasks).
4Discrete tasks (Sudoku): $t_k = \mathbf{1}[y_k = y^*]$. Regression has no exact match — $t_k$ must be built.
TRM schematic

click for ACT

Halt recipes for H2G

what to supervise $t_k$ with, on a held-out subset of each slide’s spots

StrategyPCC-300RVDmean nhalt
TRM fixed Nouter=80.7850.3548.0
Slide-level PCC-halt (never fires)0.7230.1638.0
Slide-level RVD-halt (never fires)0.7230.1648.0
Slide-level MSE-halt0.7790.1092.0
Per-gene PCC-halt0.7800.1584.9

Slide-level signals either never fire or always halt at the minimum step — but the halt loss still stabilizes variance (MSE-halt: RVD 0.354 → 0.109). One halt logit per gene is the only recipe that adapts to the input: ~42% less compute at matched PCC.

per-gene halt details $q_k^{(g)} = \sigma\big(\mathrm{halt}_g(z_k)\big), \quad g = 1,\dots,302$ — one halt logit per gene $t_k^{(g)} = \mathrm{PCC}_g(\hat{y}_k, y)$ on a held-out 20% of the slide’s spots, re-sampled every iteration $\mathcal{L}_{\mathrm{halt}} = \sum_k \sum_g \mathrm{BCE}\big(q_k^{(g)}, t_k^{(g)}\big)$ halt at the first $k$ with $\tfrac{1}{G}\sum_g q_k^{(g)} > \theta$, with $\theta = 0.4$ set inside the distribution of converged halt probabilities
halt step distribution
Halt step, 36 slides: bimodal at 2 and 8; the unseen test slide halts at 5, between the groups.
halt probability threshold
The 0.4 threshold cleanly splits the halt-probability distribution into early-halt vs never-halt slides.
random-K test-time scaling
Random-K training (K ~ U[2,16]) restores test-time scaling — PCC 0.69 → 0.72 from Nouter 1 → 4 — the gradient ACT needs.

Does reasoning help?

Recursive modelling does help in spatial omics.

  1. 1TRM beats parameter- and depth-matched baselines on both tasks — on every held-out slice.
  2. 2The loop that matters is task-dependent: latent recursion (NZL) for domains, prediction refinement (NZH) for expression.
  3. 3Adjusting model capacity makes ACT and test-time scaling possible — with a per-gene halt signal for regression.
  4. 4It is possible to scale models with limited data along an alternate axis.

What’s next

recursion at whole-slide scale — and beyond

Whole-slide Xenium · H&E → expression, zero-shot

Ovary GT vs prediction
Ovary · platform transfer · top-50 PCC 0.636 vs 0.145 (Phoenix, 1.2B) · ours: 2.1M params
Cervix GT vs prediction
Cervix · held-out organ · top-50 PCC 0.428 vs 0.143 (Phoenix)

Also in progress

Perturbation predictionDrug and CRISPR response with the same recursive operator.
Recursive flow matchingFlow matching with recursion over local tissue neighbourhoods.
Equilibrium reasonersRecursion as convergence to a fixed point.

When does looping a small model beat scaling a big one?

What is the right stop signal for continuous outputs? · If the encoder is a foundation model, is the latent state ever needed?

code · github.com/AI4SCR/recursive-reasoning-omics · dhruva.rajwade@chuv.ch

← / → navigate