A stool sample can reveal whether a person has inflammatory bowel disease, Parkinson's, or liver cirrhosis — but only if the diagnostic model was trained on people who live where the patient lives. Models built from the relative abundances of microbial species collapse when moved between countries, because baseline gut composition is reshaped by regional diet, lifestyle, and host genetics, and because organisms that signal disease in one population can be neutral or even protective in another (Molecular Characterization of the Fecal Microbiota in Patients with Nonalcoholic Steatohepatitis – A Longitudinal Study; Metagenomic analysis reveals the novel role of vaginal Lactobacillus iners in Chinese healthy pregnant women; An atlas of robust microbiome associations with phenotypic traits based on large-scale cohorts from two continents). The obvious fixes — bigger static corpora, more representation learning — treat each sample as an isolated snapshot. Yet two independent threads of evidence suggest the durable signal is not in the snapshot at all: longitudinal models that track how a gut community moves over months predict outcomes better than static ones (A self-knowledge distillation-driven CNN-LSTM model for predicting disease outcomes using longitudinal microbiome data), and cross-national Parkinson's biomarkers succeeded only when the analysis shifted from raw abundances to shifts in microbial interaction networks (Microbial biomarker discovery in Parkinson’s disease through a network-based approach).
This proposal builds a model that can actually exploit that signal at realistic scale, and uses it to test a scientific claim. The model side: longitudinal microbiome data is a spatio-temporal object where "space" is the phylogenetic tree relating thousands of species and "time" is an irregularly sampled patient trajectory. Existing longitudinal architectures flatten the tree into an arbitrary vector (A self-knowledge distillation-driven CNN-LSTM model for predicting disease outcomes using longitudinal microbiome data), and existing microbiome sequence models are both static and quadratic in cost (LLMs Can Learn the Language of the Microbiome; Self-Supervised Representation Learning for Microbiome Improves Downstream Prediction in Data-Limited Settings and Cross-Cohort Generalizability). We adapt a dual-path linear-time sequence architecture — the machinery that lets state-space models compress history into a fixed-size hidden state, $h_t = \bar{A}h_{t-1} + \bar{B}x_t$, so cost grows as $O(n)$ rather than $O(n^2)$ — to this tree-and-time structure. The scientific side: the central, untested hypothesis is that temporal kinetics (which taxa are rising, at what rate, in response to what) are more geographically invariant than abundance levels, so a model forced to represent dynamics should transfer zero-shot across countries where abundance models fail.
Core Claim
Two claims, one architectural and one empirical, that rise or fall together. Architecturally: a longitudinal microbiome encoder that (i) performs spatial mixing along the phylogenetic tree rather than a flat taxon index, and (ii) performs temporal and cross-taxon mixing with linear-cost state-space paths in the manner of DeMa: Dual-Path Delay-Aware Mamba for Efficient Multivariate Time Series Analysis, can process thousands of taxa across dozens of time points without the dimensionality reduction (PCA, coarse taxonomic ranks) that current longitudinal models need. Empirically: when this encoder is trained on longitudinal cohorts from some countries and tested zero-shot on held-out countries, it degrades less than matched static models, and its latent representations leak less country-of-origin information while retaining disease information. If the second claim is false — if dynamics are just as geographically entangled as abundances — the architecture is still a cheaper longitudinal encoder, but the biomarker-generalizability motivation collapses, and we would report that honestly.
The proposal is therefore an experiment on a hypothesis about biology, delivered by an architecture from the sub-quadratic sequence-modeling literature, with the spatio-temporal tradition supplying the inductive-bias design principle: never make a network re-learn topology you already know.
Research Program
Input geometry. Each patient visit yields a compositional vector of taxon counts (proportions that sum to one). We first apply the centered log-ratio transform, $z_j = \log x_j - \frac{1}{p}\sum_k \log x_k$ (with a small pseudocount for zeros), which maps the compositional simplex to ordinary Euclidean space in a way that respects its geometry; this is the same motivation behind Aitchison-geometry data augmentation, which produced average AUC gains of 5% for deep microbiome models versus 2% for tree ensembles (Data Augmentation for Compositional Data: Advancing Predictive Models of the Microbiome). Notably, the extreme sparsity of these vectors need not be treated as an extra modeling problem: tree-structured covariance models generate realistic zero patterns without explicit zero-inflation components (A tree-based model for addressing sparsity and taxa covariance in microbiome compositional count data), which supports handling zeros inside the encoder rather than by imputation.
The architecture (Phylo-Mamba). A stack of two interleaved block types. Tree blocks mix across taxa along the phylogenetic hierarchy: pooling and spreading information between each clade and its descendants, so that a state-space or convolutional operator over taxa sees biologically related neighbors rather than arbitrary vector indices. This borrows the spatial-inductive-bias lesson from the spatio-temporal literature — flattening a structured grid into a 1D vector forces a recurrent net to waste capacity re-learning geometry — and instantiates it for the tree. Temporal blocks are DeMa-style dual paths (DeMa: Dual-Path Delay-Aware Mamba for Efficient Multivariate Time Series Analysis): a series-independent Mamba path captures each clade's long-range trend in $O(n)$ time, while a delay-aware linear-attention path captures lagged cross-taxon coupling (one clade's rise preceding another's). DeMa itself was built for traffic and weather sensors; nothing in it knows about compositionality, phylogeny, or cohort shift, so the transfer is a genuine research risk, not a re-skin. Irregular sampling intervals are handled by making the state-decay matrix $\bar{A}$ a function of the gap since the previous visit, rather than by padding, replacing the heuristic padding schemes of A self-knowledge distillation-driven CNN-LSTM model for predicting disease outcomes using longitudinal microbiome data.
Small-sample training. Clinical longitudinal cohorts are tiny — 428 patients in PROTECT, roughly a thousand infants in DIABIMMUNE — far below the ~10,000-sample threshold at which pretrained Transformer models start beating Random Forests (LLMs Can Learn the Language of the Microbiome). We therefore do not attempt foundation-model pretraining as the main path. Instead we regularize with two proven ingredients: progressive self-knowledge distillation, which stabilized the CNN-LSTM on these same cohorts (A self-knowledge distillation-driven CNN-LSTM model for predicting disease outcomes using longitudinal microbiome data), and Aitchison Mixup on whole trajectories (Data Augmentation for Compositional Data: Advancing Predictive Models of the Microbiome). Optionally, we will test warm-starting the tree blocks on the 539,308-profile Atlas corpus (LLMs Can Learn the Language of the Microbiome) as a secondary experiment, though the file gives no reported transfer result for this and we treat it as exploratory.
The scientific instrument. Beyond prediction, the encoder gives us a measurable object: the latent trajectory embedding. We will quantify geographic portability by asking a linear probe to predict country-of-origin from the embedding. The hypothesis predicts that trajectory embeddings are harder to attribute to a country than matched static abundance embeddings, at matched disease information. This turns "dynamics are more universal than levels" from a slogan into a falsifiable measurement.
Baselines
The do-nothing reference is a tuned Random Forest on the most recent sample's raw species abundances — the default of the field, and a genuinely strong one below ~10,000 samples (LLMs Can Learn the Language of the Microbiome). We will also run it on trajectory summary statistics (slopes and variance per taxon) so that "RF can't see time" is not a strawman. Beating this baseline means higher held-out AUC on every split, at the same feature budget.
The strongest existing longitudinal competitor is the CNN-LSTM with self-knowledge distillation (A self-knowledge distillation-driven CNN-LSTM model for predicting disease outcomes using longitudinal microbiome data), which reported an AUC of 0.89 with F1 of 0.86 on PROTECT (best model, padded-in-sequence plus first distillation) and an AUC of 0.798 on DIABIMMUNE. We will reimplement it under identical splits, preprocessing, tuning budget, and compute, because those reported numbers are within-cohort and the file reports no cross-country result for it; beating it means matching or exceeding its within-cohort AUC and substantially outperforming it under leave-one-country-out transfer. For cross-geographic static prediction, the reference is the network-based NetMoss pipeline with its Random Forest, which achieved a test AUC of 0.864 across five countries on Parkinson's data (Microbial biomarker discovery in Parkinson’s disease through a network-based approach) — the best cross-national number in the file, and the honest bar for any claim of geographic robustness, even though it is static and cross-sectional rather than longitudinal.
Two ablations isolate the key ingredients. First, the identical architecture with tree blocks replaced by mixing over a random flat taxon permutation isolates the phylogenetic-spatial bias. Second, the identical architecture with the temporal path collapsed to mean-pooling over time isolates the value of modeling dynamics at all; this ablation is the crux, because if the time-pooled variant transfers across geography just as well, the paper's scientific claim is dead regardless of benchmark wins.
Why not just…?
Why not just use Random Forests or NetMoss-style features? This is the most serious objection, and the file's evidence partially supports it: Random Forests remain competitive below ~10,000 samples (LLMs Can Learn the Language of the Microbiome), and NetMoss already achieved 0.864 cross-national AUC on static data (Microbial biomarker discovery in Parkinson’s disease through a network-based approach). We concede that if the evaluation were static cross-sectional classification, this proposal would not be worth doing. The response is empirical, not rhetorical: the NetMoss result shows higher-order structure helps, but it is computed on single samples, and the longitudinal CNN-LSTM evidence shows temporal trajectories carry signal that static features miss (A self-knowledge distillation-driven CNN-LSTM model for predicting disease outcomes using longitudinal microbiome data). Whether higher-order structure over time generalizes even better is exactly the open question, and the RF-on-trajectory-statistics baseline plus the time-pooled ablation are designed to settle it against us if we are wrong.
Why not just fine-tune a pretrained microbiome language model? Waypoint and the masked-autoencoder representations are impressive, but they are static by construction — a sample is a sorted bag of taxa tokens, with no mechanism for a patient's history — and both acknowledge quadratic attention cost (LLMs Can Learn the Language of the Microbiome; Self-Supervised Representation Learning for Microbiome Improves Downstream Prediction in Data-Limited Settings and Cross-Cohort Generalizability). The self-supervised work did improve cross-cohort generalizability by up to 81%, which we take as evidence that representation matters for portability — but its cohorts are cross-sectional snapshots in the US, Israel, and the Netherlands, and it never tests whether the learned features are temporally aware. Fine-tuning Waypoint on per-visit profiles and aggregating over time would be a reasonable hybrid, so we will run exactly that as an additional baseline rather than dismiss it; our prediction, from Waypoint's own 10,000-sample threshold, is that it overfits the small longitudinal cohorts.
Why not just use a standard quadratic Transformer over the trajectory? With, say, 2,000 taxa and 30 visits tokenized jointly, quadratic attention is over the concatenated token sequence — the regime where DeMa showed linear models dominate on memory and runtime at equal or better accuracy (DeMa: Dual-Path Delay-Aware Mamba for Efficient Multivariate Time Series Analysis) and where TabPFN fails outright beyond 10,000 context tokens (Chunked TabPFN: Exact Training-Free In-Context Learning for Long-Context Tabular Data). But the honest answer is that at our cohort sizes, a small quadratic Transformer would fit in memory; the complexity argument matters for scaling to species-level resolution ($p \approx 10^4$) and for the promise of cheap cross-cohort retraining, not for the headline experiments. We will therefore include a matched quadratic Transformer at equal parameter count, and frame sub-quadratic cost as a scaling property we measure (wall-clock and GPU memory vs. sequence length), not as the reason the model works.
Proposed Experiments
E1 — Within-cohort sanity and strength (PROTECT). Pediatric ulcerative colitis severity prediction from the 428-patient PROTECT study, the same task and cohort as A self-knowledge distillation-driven CNN-LSTM model for predicting disease outcomes using longitudinal microbiome data, whose best model reported AUC 0.89 / F1 0.86. Success: match or exceed that AUC at species-level resolution without PCA dimensionality reduction, using their evaluation protocol. This experiment mainly establishes that the architecture is competent before the harder question is asked.
E2 — Zero-shot geographic transfer (DIABIMMUNE). The decisive experiment. DIABIMMUNE tracks infants monthly from birth to age three in Finland, Estonia, and Russia — three geographically adjacent but socioeconomically and culturally distinct countries, the same confounding gradient documented for adults (The gut microbiome in atherosclerotic cardiovascular disease). We run leave-one-country-out transfer: train on two countries, test zero-shot on the third, predicting T1D seroconversion and allergy outcomes (the CNN-LSTM paper reported within-cohort AUC 0.798 on DIABIMMUNE; no reported cross-country result exists on Lacuna for any longitudinal microbiome model — that absence is the gap this proposal fills). The comparison set: Phylo-Mamba, its two ablations (flat taxon ordering; time-pooled), the reimplemented CNN-LSTM, the RF on static and trajectory-statistic features, and fine-tuned static pretrained representations. Metrics: held-out AUC and F1, plus transfer drop (within-country minus cross-country AUC).
E3 — The geography probe. On DIABIMMUNE embeddings, a linear (and adversarially trained) probe predicts country-of-origin; a second probe predicts clinical outcome. The hypothesis: trajectory embeddings show a worse country-probe / better outcome-probe trade-off than static embeddings. This is the direct test of "kinetics are more universal than levels," and it can contradict E2 — if cross-country AUC is fine but the country probe is strong, transfer is succeeding for the wrong reason (shared batch artifacts), which we would report.
E4 — Static cross-national reference (Parkinson's consortium). To connect to the strongest published cross-geographic number, we apply the tree encoder to the six 16S datasets from five countries used by NetMoss (1,006 samples; reported test AUC 0.864 for the 11-genus Random Forest, Microbial biomarker discovery in Parkinson’s disease through a network-based approach), treating each sample as a length-one trajectory. Success: approach 0.864 AUC under leave-one-country-out with a single model and no per-country feature selection, which would suggest the phylogenetic bias captures some of what the interaction-network features capture. Failure here is informative but not fatal, since these data are static and the architecture is built for dynamics.
E5 — Scaling and cost. Wall-clock, GPU memory, and accuracy as sequence length grows from genus-level (~100 taxa × 30 visits) to species-level (~5,000 taxa × 30 visits), against the matched quadratic Transformer, reproducing in the microbiome setting the linear-scaling behavior DeMa demonstrated on traffic and weather benchmarks (DeMa: Dual-Path Delay-Aware Mamba for Efficient Multivariate Time Series Analysis; no scalar MSE/MAE values from that paper are reproduced in the file, so we compare only ordering and complexity trends, not absolute numbers).
Decisive Checks and Failure Modes
The proposal fails scientifically if, on E2, the time-pooled ablation transfers as well as the full model — then dynamics add nothing to portability and the paper becomes a modest efficiency result, which we would say plainly. It fails architecturally if the flat-ordering ablation matches the tree blocks, showing the phylogenetic bias is decorative. It is threatened most by NetMoss-style static network features: if those, extended with crude temporal statistics inside the Random Forest, match Phylo-Mamba's cross-country AUC on E2, the deep model has no case; that comparison is run head-to-head precisely so it can kill the idea. The strongest positive outcome would be E2 and E3 together: materially smaller transfer drops than every static baseline, and embeddings from which a probe can read the disease but not the country. That would justify scaling the approach to multi-regional IBD and Parkinson's longitudinal cohorts as the follow-up, and would give the biomarker-generalizability field its first direct evidence that the way a gut ecosystem moves is a property of the disease, not of the postal code.
References
- Molecular Characterization of the Fecal Microbiota in Patients with Nonalcoholic Steatohepatitis – A Longitudinal Study
- Metagenomic analysis reveals the novel role of vaginal Lactobacillus iners in Chinese healthy pregnant women
- An atlas of robust microbiome associations with phenotypic traits based on large-scale cohorts from two continents
- A self-knowledge distillation-driven CNN-LSTM model for predicting disease outcomes using longitudinal microbiome data
- Microbial biomarker discovery in Parkinson’s disease through a network-based approach
- LLMs Can Learn the Language of the Microbiome
- Self-Supervised Representation Learning for Microbiome Improves Downstream Prediction in Data-Limited Settings and Cross-Cohort Generalizability
- DeMa: Dual-Path Delay-Aware Mamba for Efficient Multivariate Time Series Analysis
- Data Augmentation for Compositional Data: Advancing Predictive Models of the Microbiome
- A tree-based model for addressing sparsity and taxa covariance in microbiome compositional count data
- Chunked TabPFN: Exact Training-Free In-Context Learning for Long-Context Tabular Data
- The gut microbiome in atherosclerotic cardiovascular disease