arXiv:2610.39316cs.LGOct 2026

Manuscript Offprint

arXiv:2610.39316

TaxoMFM: A Taxonomy-Aware Foundation Model for the Human Gut Microbiome

Haochen Xue, Anastasia Godneva, Yulong Li, Qi Cao, Zhaodong Wu, Kaiyu Liang, Jionglong Su, Eran Segal, Imran Razzak

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Existing gut microbiome foundation models typically use flat taxon representations, limiting their ability to exploit known taxonomic hierarchies. We introduce TaxoMFM, a microbiome foundation model that integrates taxonomic structure into self-supervised learning. TaxoMFM jointly learns abundance patterns across taxonomic ranks and relative proportions within groups through taxonomy-aware encoding and hierarchical compositional reconstruction. We further construct TaxoGut-HPP, comprising 100,806 gut microbiome profiles from 231 source cohorts and covering 40 classification and 8 regression tasks. TaxoMFM achieves competitive performance across disease, gut health, host trait, and liver ultrasound phenotype prediction. In cross-cohort zero-shot transfer, where target cohorts are excluded from both pretraining and downstream adaptation, TaxoMFM achieves AUROCs of 0.838, 0.736, and 0.722 for colorectal cancer, type 2 diabetes, and inflammatory bowel disease, respectively. Further analyses show that TaxoMFM recovers community changes across taxonomic scales, while preserving community information and producing consistent representations under database updates and species-vocabulary shifts. Our Code is available on GitHub.

1 INTRODUCTION

Foundation models learn general representations from large unlabeled datasets and transfer them to a wide range of downstream tasks (Bommasani et al., 2021). This approach is well suited to gut microbiome data. Gut microbiome profiles are high-dimensional and sparse (Oh & Zhang, 2020). Recent gut microbiome foundation models combine multiple public cohorts for self-supervised pretraining and transfer the learned representations to disease prediction tasks (Pope et al., 2025; Medearis et al., 2026; Karwowska et al., 2026). These studies show the potential of pretraining for microbiome modeling across tasks.

However, microbial signals associated with diseases and host phenotypes can occur at several taxonomic scales. Changes may involve a single species, an entire genus, or a family. For example, a genus can increase in total relative abundance, or maintain the same total while its species proportions change. The taxonomic hierarchy shows how abundant each group is in the community and how its members contribute to that abundance. Current gut microbiome foundation models generally use flat taxon representations that do not explicitly encode these relationships. Previous statistical and machine learning studies have shown that taxonomic or phylogenetic information can help characterize community differences and support downstream prediction (Silverman et al., 2017; Reiman et al., 2020; Jiang et al., 2025). We ask how self-supervised pretraining can use this hierarchy to preserve both abundance distributions across taxonomic scales and composition within lineages.

Existing evaluations largely focus on case-control classification in public disease cohorts. Gut symptoms, such as abdominal pain and bloating, and continuous physiological traits receive less attention. This narrow scope leaves it unclear whether the learned representations capture variation in gut health and host physiology beyond disease status.

Figure

Figure 1: Conceptual comparison of flat and taxonomy-aware microbiome foundation models. Both approaches use the same species-level abundance profile. Existing models represent species as a flat set, whereas TaxoMFM aggregates their abundances along known taxonomic lineages and jointly models species, genus, family, and order nodes to learn a structure-aware representation.

To address the modeling limitation, we introduce TaxoMFM, a foundation model that explicitly incorporates the taxonomic hierarchy into both encoding and reconstruction. Its encoder uses relation-biased self-attention to jointly model species, genus, family, and order. Its decoder predicts child proportions within each parent and reconstructs abundances along the taxonomy, ensuring that child abundances sum to their parent's abundance. Pretraining combines multiscale composition reconstruction with hierarchical composition learning, allowing the model to learn both group abundances and the relative proportions of their members. Together, these components provide a way to learn representations from compositional data with a known hierarchy. Fig. 1 contrasts this approach with flat species-level pretraining.

To broaden the data and evaluation coverage, we construct TaxoGut-HPP, comprising 100,806 gut microbiome profiles from 231 source cohorts. It covers 40 classification and 8 regression tasks spanning disease, gut health, host traits, and continuous clinical phenotypes. This coverage extends evaluation beyond disease classification to gut symptoms and quantitative physiological measurements. Table 1 compares its scale and phenotype coverage with existing pretraining resources. Using TaxoGut-HPP, we evaluate TaxoMFM through downstream prediction, cross-cohort transfer, ablations, and analyses of multiscale recovery and consistency across taxonomic vocabularies.

Our main contributions are as follows:

  1. We introduce TaxoMFM, combining taxonomy-aware encoding and hierarchical compositional decoding to learn transferable microbiome representations through joint reconstruction of multiscale abundances and within-lineage proportions.

  2. We construct TaxoGut-HPP with 100,806 profiles from 231 source cohorts, expanding pre-training data and evaluation across disease, gut health, host traits, and continuous clinical phenotypes.

  3. TaxoMFM outperforms existing foundation models and conventional machine learning methods across a broad range of downstream tasks. Ablations and structural analyses assess the contributions of taxonomy and hierarchical composition learning.

References (34)