Protein Structure Tokenization via Geometric Byte Pair Encoding

Michael Sun, Weize Yuan, Gang Liu, Wojciech Matusik, Marinka Zitnik

In the realm of Natural Language Processing (NLP), Byte Pair Encoding (BPE) revolutionized how models process text by breaking it down into meaningful, multi-scale sub-words. In protein biology, however, researchers have long struggled to find a comparable "alphabet" for 3D structure.

Existing Protein Structure Tokenizers (PSTs)—such as the VQ-VAEs used in models like ESM3—typically rely on fixed-size codebooks of continuous vectors. This approach suffers from three major flaws:

  1. Lack of Interpretability: A continuous vector in a latent space doesn't inherently represent a recognizable biological structure (like a helix or a binding loop) to a human expert.
  2. Fixed Resolution: They treat every part of the protein with the same "grain size," failing to capture the natural hierarchy of protein folds, which range from individual residues to complex motifs and domains.
  3. Geometric Drift: When continuous 3D coordinates are discretized (quantized), small errors accumulate. Over a long protein chain, these errors compound, causing the reconstructed structure to lose its global shape and resemble a tangled mess.

To solve this, researchers have introduced GeoBPE, a novel protein structure tokenizer that adapts the logic of BPE to 3D geometry. GeoBPE transforms continuous, noisy protein backbones into discrete, hierarchical "sentences" of geometry while enforcing global structural constraints.

Overview of the GeoBPE pipeline, illustrating the tokenization of protein structures into a hierarchical vocabulary for downstream modeling.

How GeoBPE Works

GeoBPE treats protein backbones as a series of geometric primitives. The process is iterative and directly analogous to text-based BPE, but applied to 3D space:

  1. Hierarchical Vocabulary Building: The algorithm starts at the individual residue level and iteratively merges the most frequent adjacent "Geo-Pairs." It uses k-medoids clustering to find representative "prototypes" for these merged segments.
  2. Adaptive Quantization: Instead of relying on a fixed codebook, the vocabulary grows dynamically. This allows the model to represent common structural motifs (like alpha-helices) with very few tokens while maintaining high fidelity across different scales.
  3. Differentiable Inverse Kinematics (IK): To solve the critical "geometric drift" problem, GeoBPE optimizes the "glue angles" between tokens. It employs a differentiable IK layer to ensure that when tokens are snapped to their discrete prototypes, the overall global fold remains consistent with the original structure.
  4. Architecture Agnosticism: The resulting tokens can be fed into a standard Transformer for generative tasks or processed via a Tree-LSTM (following the merge hierarchy) to create powerful multi-scale representations for downstream functional prediction.
The iterative GeoBPE process, showing how adjacent geometric pairs are clustered, quantized, and merged to build a hierarchical structural vocabulary.

Key Insights and Results

The researchers trained GeoBPE on ~48K non-redundant protein chains from the Protein Data Bank (PDB) and evaluated it across a rigorous suite of benchmarks, including CAMEO, CASP14, and 12 downstream functional tasks.

  • The "BPE for Geometry" Analogy Works: Just as BPE finds frequent sub-words in text, GeoBPE successfully identifies frequent sub-structures in nature, creating a symbolic language of protein folds. Notably, the tokens discovered by the algorithm align significantly with CATH functional families, meaning this machine-learned alphabet corresponds to known biological building blocks.
  • Massive Compression: GeoBPE achieves a >10x reduction in bits-per-residue compared to leading models like ProToken and ESM3, all while maintaining similar or better reconstruction distortion rates.
  • Unprecedented Data Efficiency: GeoBPE can learn a high-quality structural vocabulary using 10x less training data than VQ-VAE baselines. The inductive bias of grounding the model in actual geometry proves much stronger than learning from raw vectors.
  • Robust Generalization: The model shows almost no performance drop on unseen, out-of-distribution data (maintaining a test/train RMSD ratio of 1.0–1.1). In contrast, VQ-VAEs often see their error rates jump by over 6x on novel structures.
  • Downstream & Generative Performance: When used as a feature extractor, GeoBPE-induced representations outperformed leading PSTs across nearly all 12 functional tasks tested. Furthermore, when paired with a small Transformer (~7M parameters), it successfully generated novel, "designable" protein backbones, outperforming VQ-VAE-based language models.

Limitations and Future Directions

While GeoBPE represents a significant leap forward for protein tokenization, it currently only models the protein backbone ($N, C\alpha, C$ atoms) and does not yet incorporate side-chain geometry or the amino acid sequence itself. Future work will likely explore integrating sequence data—perhaps by taking the Cartesian product of the geometric vocabulary with amino acid types—and scaling the generative capabilities up to billion-parameter multimodal models.

By providing a discrete, interpretable, and hierarchically structured alphabet for 3D proteins, GeoBPE paves the way for more efficient and biologically grounded protein language models.

Source Code: https://github.com/shiningsunnyday/PT-BPE

Summary updated

BibTeX
@inproceedings{sun2026protein,
  author = {Michael Sun and Weize Yuan and Gang Liu and Wojciech Matusik and Marinka Zitnik},
  title = {{Protein Structure Tokenization via Geometric Byte Pair Encoding}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=55e5f3GVFc},
}
Figure