Models that predict gene expression from ordinary stained tissue slides (H&E histology) have to combine information from spots that may sit far apart on the slide. Current models handle this range problem with geometry. They merge neighbouring spots on a grid, or they group patches by their $(x, y)$ coordinates, so two distant patches of immune infiltrate can only share evidence through many intermediate layers. We propose to route long-range communication through a small set of summary tokens, one per curated biological pathway. During training, each tissue spot is told how strongly it should connect to each pathway token, using pathway activity computed from that spot's measured expression. At test time only the image is available. A spot then broadcasts to, and reads from, the tissue regions running the same molecular program, wherever they are.
The central claim is narrow and testable. On spatial transcriptomics benchmarks, where long-range routing is organised by known pathways, gene prediction should beat routing organised by coordinates or by unsupervised feature clusters at the same compute. The gain should be largest for genes whose spatial patterns are long-range and patchy. It should vanish when the pathway gene sets are replaced by random gene sets of matched size. If adding a pathway-level auxiliary loss to an existing model captures the same gain, the routing idea is wrong, and the experiments are designed to show that cleanly.
Where this sits
Two literatures meet here without having touched. The first builds known biology into a network's wiring. PONET restricts its genomic branch to Reactome pathway connectivity. GUIDE structures a graph network along the Gene Ontology. consDeepSignaling and DeepSigSurvNet mask layers to signaling pathways. All of these apply the prior only to a one-dimensional molecular vector. PONET's slide encoder, for example, is an unconstrained self-supervised Vision Transformer whose attention knows nothing about pathways. These papers motivate the proposal: they show that pathway structure helps when data are scarce. GUIDE reaches AUROC 0.75 against 0.68 for the unstructured G-MIND. PONET reaches C-Index 0.829 on KIRP with about 2.8M parameters. They also constrain it. PathExpSurv shows that static pathway databases miss disease-specific interactions and need a data-driven expansion. For that reason our design keeps some unconstrained routing capacity.
The second literature works around the local reach of convolutions. KAT supplies the mechanism we reuse. It summarises thousands of whole-slide patches into a few anchor tokens and passes messages patches→anchors→patches at linear cost. However, its anchors come from K-means on coordinates, and its authors name this purely spatial choice as a limitation. KAT also reports that dense global attention over-smooths distinct local patterns, which is a reason not to simply attend everywhere. HiST is the closest system and the one we must beat. It predicts spot-level expression from H&E on HEST-1k using a sparse lattice, dyadic coarsening by grid adjacency, local attention, and one global slide-calibration token. It predicts thousands of genes yet never uses gene–gene or pathway structure in its routing. CCNet is a different efficient route to a global receptive field: two factorised criss-cross passes. It shows that sparse multi-step routing can match dense attention, but its routes are again fixed by geometry.
Our proposal differs from all of them in one respect. The prior decides who talks to whom at long range in the image model. It does not shape a separate genomic branch, and it is not applied after the fact as an attention map.
Core mechanism
Let $h_i$ be the feature of tissue spot $i$ after a local encoder, for which we use HiST's local path unchanged. Take $K$ pathway tokens $z_k$, one per Reactome or Hallmark pathway after filtering for expressed genes. Add $R$ free tokens with no pathway identity, which serve as the expansion capacity that PathExpSurv argues for. Each spot computes a routing weight $a_{ik}\in[0,1]$ to each token from $h_i$. Tokens summarise their member spots, and each spot then reads back from the tokens:
$$z_k = \frac{\sum_i a_{ik} W_v h_i}{\sum_i a_{ik}}, \qquad h_i \leftarrow h_i + \sum_k a_{ik} W_o z_k .$$
Here $W_v$ and $W_o$ are learned projections. The cost is $O(N(K+R))$ for $N$ spots. Two spots at opposite ends of the slide now exchange information in one step, provided both route to the same pathway.
The domain knowledge enters through supervision of $a_{ik}$ for the $K$ pathway tokens. We use a spot-level activity score $s_{ik}$, the mean z-scored measured expression of the pathway's member genes, rank-normalised within the slide. It is computed only on training slides. The training objective is
$$\mathcal{L} = \sum_{i,g} (\hat y_{ig} - y_{ig})^2 + \lambda \sum_{i,k} \ell(a_{ik}, s_{ik}),$$
where $y_{ig}$ is measured expression of gene $g$, $\hat y_{ig}$ is the prediction, $\ell$ is binary cross-entropy against the normalised score, and $\lambda$ trades off the two terms. The free tokens are unsupervised.
The output head predicts each gene from the spot feature plus a soft pathway term. That term reads only from the tokens of pathways containing the gene, via a PONET-style mask. We apply the mask softly, as a weight penalty on non-member connections rather than hard zeros, so that unannotated cross-talk is not ruled out. With HiST's slide-calibration token kept, the model is HiST with its global path replaced.
Research Program
We will first build this module into a reimplementation of HiST. HiST's reported numbers stand, and our reproduction must land near them before any comparison counts.
The analysis then asks three questions. The first is whether pathway-anchored routing improves prediction beyond what the same pathway knowledge gives through other channels. The second is which genes benefit. We stratify genes by the spatial range of their autocorrelation, using Moran's I at increasing distance bands, and by whether they belong to any routed pathway. The third is whether the learned routing maps are faithful on held-out slides, meaning that $a_{ik}$ predicted from H&E alone correlates with the measured $s_{ik}$. If so, they are pathway maps inferred from histology, which is useful independently of gene-level accuracy.
A low-data sweep, training on 25%, 50% and 100% of training slides, tests the claim drawn from GUIDE and PONET: priors should matter most when samples are scarce.
Baselines
The do-nothing reference is predicting each gene's training-set mean expression per organ. This fixes the floor for $R^2$. A second reference is STFlow, the prior model HiST compares against. HiST reports $R^2$ 0.27 and Pearson 0.54 for STFlow on HEST-1k.
The strongest existing method is HiST. Its geometric multi-scale attention is designed for exactly this task and benchmark. It reports $R^2$ of 0.34 and Pearson $r$ of 0.59 on HEST-1k under 4-fold cross-validation split by slide ID, with 0.07 s per-slide latency and 1.38 GB peak memory. We will run HiST and our model on identical folds, identical frozen patch features, the same number of optimiser steps, and the same hyperparameter search budget (twenty trials each). Parameter counts will be matched within 10% by adjusting width.
Beating HiST means a mean $R^2$ gain across the four folds that exceeds fold-to-fold standard deviation, with no increase in latency beyond 2×. Pearson alone is not enough.
The ablation that isolates the key ingredient keeps our architecture fixed and changes only the anchors. The variants are: KAT-style coordinate K-means anchors with Gaussian spatial masks; K-means on image features, which gives semantic but knowledge-free anchors; pathway anchors with shuffled gene sets of matched sizes; and pathway anchors without the routing supervision ($\lambda=0$). Only the real pathway version should win, and the shuffled version should fall back to feature-cluster performance.
Why not just…?
Why not just add a pathway-activity auxiliary loss to HiST and leave its routing alone? This is the most serious threat. The knowledge could help simply by giving the encoder a richer training signal, with the routing change doing no work. We run exactly this variant: HiST plus a head predicting $s_{ik}$, same $\lambda$ search. If it matches our model, we will report that the benefit is multi-task supervision, not knowledge-organised routing, and the claim fails. The routing claim survives only if our model beats aux-loss HiST specifically on long-range-autocorrelated genes. The prediction is that it should, because an auxiliary head does not let distant spots share evidence.
Why not just let a dense global Transformer attend across all spots? KAT reports that standard ViTs need 3.37× more FLOPs and 6.46× more memory than kernel routing, and that dense attention over large patch sets over-smooths local patterns. STFlow, the heavier global baseline in HiST's comparison, uses 46.37 GB against HiST's 1.38 GB with lower accuracy. We include a dense-attention variant on the subset of slides that fit in memory to check this on our data.
Why not just compress the output through principal components of expression, which also captures co-expression without any database? A low-rank output head with $K+R$ components is a fair knowledge-free rival for the decoder side. We run it both on its own and combined with feature-cluster routing. If PCA routing plus a PCA decoder matches pathway routing, curated knowledge adds nothing beyond data-derived co-expression structure. We expect this to happen at 100% data, with the gap opening in the low-data sweep. That expectation is a hypothesis, not established.
Why not just use learned feature clusters as anchors? This is covered by the anchor ablation above. The shuffled-gene-set control distinguishes "any fixed grouping helps" from "biologically correct grouping helps".
Proposed Experiments
All experiments use the HEST-1k benchmark: 11 datasets across 10 organs and Visium, Xenium and legacy ST platforms, under HiST's 4-fold slide-ID split. We report $R^2$, Pearson $r$, latency and peak GPU memory.
The decisive checks are three. The first is our model versus HiST and versus aux-loss HiST, overall and stratified by gene spatial range. The second is real versus shuffled pathway anchors. The third is held-out correlation between image-predicted routing weights and measured pathway activity, reported per organ.
As a transfer probe, the frozen model's pathway-token summaries can serve as slide features for TCGA survival. This is reported against PONET's KIRP C-Index of 0.829, but it is secondary; the proposal stands or falls on HEST-1k.
A clean negative result is also informative. The negative outcome would be aux-loss HiST matching us, with shuffled gene sets matching real ones. That would show that, for histology-to-expression prediction, pathway knowledge belongs in the loss rather than in the wiring.
References
- Deep Biological Pathway Informed Pathology-Genomic Multimodal Survival Prediction
- A Biologically Interpretable Graph Convolutional Network to Link Genetic Risk Pathways and Imaging Phenotypes of Disease
- Predicting Anticancer Drug Response With Deep Learning Constrained by Signaling Pathways
- Investigating the relevance of major signaling pathways in cancer survival using a biologically meaningful deep learning model
- PathExpSurv: pathway expansion for explainable survival analysis and disease gene discovery
- Kernel Attention Transformer (KAT) for Histopathology Whole Slide Image Classification
- HiST: A Hierarchical Sparse Transformer for Cross-Modal Spatial Transcriptomics Modeling
- CCNet: Criss-Cross Attention for Semantic Segmentation