MetagenBERT: a Transformer-based Architecture using Foundational genomic Large Language Models for novel Metagenome Representation
Gaspar Roy, Eugeni Belda, Baptiste Hennecart, Yann Chevaleyre, Edi Prifti, Jean-Daniel Zucker
TL;DR
MetagenBERT tackles the bottleneck of annotation-dependent metagenome representations by directly embedding raw reads with genomic LLMs and then aggregating these embeddings into fixed-length metagenome vectors via a global FAISS-accelerated K-Means clustering framework. The approach yields annotation-free cluster-abundance representations that, alone or concatenated with species abundances, achieve competitive disease-prediction performance across five gut-related datasets and demonstrate transferability through a MetaCardis-based foundation-model variant. Key contributions include demonstrating end-to-end metagenome embeddings from raw reads, evaluating read embedders DNABERT-2 and DNABERT-MS, and showing that a large, diverse pretraining corpus can support cross-cohort generalization. The work highlights substantial computational costs but also substantial gains in scalability and robustness, pointing toward practical foundation-model-like representations for heterogeneous metagenomic data across sequencing technologies.
Abstract
Metagenomic disease prediction commonly relies on species abundance tables derived from large, incomplete reference catalogs, constraining resolution and discarding valuable information contained in DNA reads. To overcome these limitations, we introduce MetagenBERT, a Transformer based framework that produces end to end metagenome embeddings directly from raw DNA sequences, without taxonomic or functional annotations. Reads are embedded using foundational genomic language models (DNABERT2 and the microbiome specialized DNABERTMS), then aggregated through a scalable clustering strategy based on FAISS accelerated KMeans. Each metagenome is represented as a cluster abundance vector summarizing the distribution of its embedded reads. We evaluate this approach on five benchmark gut microbiome datasets (Cirrhosis, T2D, Obesity, IBD, CRC). MetagenBERT achieves competitive or superior AUC performance relative to species abundance baselines across most tasks. Concatenating both representations further improves prediction, demonstrating complementarity between taxonomic and embedding derived signals. Clustering remains robust when applied to as little as 10% of reads, highlighting substantial redundancy in metagenomes and enabling major computational gains. We additionally introduce MetagenBERT Glob Mcardis, a cross cohort variant trained on the large, phenotypically diverse MetaCardis cohort and transferred to other datasets, retaining predictive signal including for unseen phenotypes, indicating the feasibility of a foundation model for metagenome representation. Robustness analyses (PERMANOVA, PERMDISP, entropy) show consistent separation of different states across subsamples. Overall, MetagenBERT provides a scalable, annotation free representation of metagenomes pointing toward future phenotype aware generalization across heterogeneous cohorts and sequencing technologies.
