bioRxiv · 10.64898/2026.06.06.730618
TaxoFormer: Hierarchical Transformer for Predicting the Full Taxonomic Lineage of Protein Sequences
Abstract
Predicting labels in massive, hierarchically structured output spaces is a core challenge in machine learning. In this work, we use the problem of predicting the full taxonomic lineage of a protein from its sequence as a case study for this challenge. We introduce TaxoFormer, an architecture whose primary contribution is a structured tokenization scheme that losslessly represents the entire NCBI phylogenetic tree, a graph with over 1.3 million nodes using a compact vocabulary of just 15,000 tokens. By coupling a pre-trained ESM-2 model with an autoregressive decoder and training with a standard cross-entropy objective, we test the hypothesis that a simple generative objective is sufficient to learn complex, latent structure when the output space is explicitly modeled. We show that this approach is highly effective: on a dataset of 188 million proteins, the model not only achieves accurate lineage prediction but also implicitly learns a continuous, phylogenetically-structured latent space. This work provides a scalable, alignment-free method for taxonomic annotation and demonstrates that explicitly modeling the structure of a complex output space is a powerful mechanism for learning meaningful representations.2
Explore related subjects
Keep this discovery
Explore connections, maps & timelines
Parsa, M., Azimian, K., Wei, K. Y.. 2026-06-09. TaxoFormer: Hierarchical Transformer for Predicting the Full Taxonomic Lineage of Protein Sequences. https://doi.org/10.64898/2026.06.06.730618
Cite the original work for its findings. Save a collection to share your selection of sources.