Flow Autoencoders are Effective Protein Tokenizers

Rohit Dilip, Evan Zhang, Ayush Varshney, David Van Valen

TL;DR

The authors introduce Kanzi, a flow-based protein structure tokenizer that abandons complex, symmetry-invariant architectures in favor of a simple diffusion autoencoder trained with a single flow matching loss. Despite being 20x smaller and using 400x less training data than massive models like ESM3, Kanzi achieves state-of-the-art structure reconstruction and enables highly effective autoregressive protein generation.

What Problem Does This Paper Address?

To build multimodal foundation models for biology—capable of reasoning across protein sequence, structure, and function simultaneously—we need a way to convert continuous 3D protein structures into discrete "tokens," much like words in a language model.

Existing protein tokenizers (such as those in ESM3 or DPLM-2) rely heavily on the assumption that the network architecture must be explicitly invariant to 3D spatial symmetries (translations and rotations, known as $SE(3)$ invariance). To enforce this, researchers use complex, bespoke components like Invariant Point Attention (IPA) and intricate geometric loss functions (like Frame-Aligned Point Error, or FAPE). However, these specialized architectures are notoriously difficult to optimize, scale poorly, and are hard to extend to other biomolecules like RNA or DNA.

The authors of this paper ask a fundamental question: Can we drop these rigid geometric constraints and let a simpler, standard transformer architecture learn the underlying spatial relationships?

Methods

Kanzi replaces rigid geometric inductive biases with a flexible, asymmetric diffusion autoencoder framework trained via conditional flow matching.

Figure 2: Architectural overview of Kanzi. (a) Kanzi takes a clean structure as input, which is encoded and passed through a quantization bottleneck. The decoder is provided with the quantized latents as in-context conditioning, along with a noised version of the protein structure. The train- ing is supervised by a single diffusion loss that maximizes p(x|ˆc). No auxiliary losses are used. (b) Our decoder follows the standard diffusion transformer (DiT) presentation, with several notable deviations. We share adaLN conditioning across all blocks, and each DiT block is a transformer with pair-biased attention and optional self-conditioning. (c) Our encoder combines raw coordinate information with sequence positional information. Tokens are mixed using a small stack of trans- former layers with sliding window attention. Ablations on other encoder variants are described in Section 4.3 and Appendix E.

The architecture consists of three core components:

  1. Encoder: A lightweight, non-equivariant transformer that operates directly on raw, mean-centered 3D coordinates and sequence positions. It uses sliding window attention (SWA) to mix local structural information.
  2. Quantization Bottleneck: Uses Finite Scalar Quantization (FSQ) to map the continuous latent vectors from the encoder into a discrete sequence of tokens from a finite vocabulary.
  3. Decoder: A deep Diffusion Transformer (DiT) that reconstructs the clean protein structure from linearly interpolated noise. It is conditioned on the discrete tokens via in-context conditioning and utilizes standard attention mechanisms rather than geometric attention.

Crucially, the entire pipeline is trained end-to-end using a single, non-invariant flow matching loss, completely bypassing the need for complex combinations of auxiliary structural losses. For downstream structure generation, a standard autoregressive language model is trained directly on the discrete tokens learned by Kanzi.

Datasets

  • Training: The model was trained on a curated subset of the Foldseek-clustered AlphaFold Database ($D_{FS}$), filtering out low-confidence predictions (mean pLDDT < 80) and highly disordered regions, leaving approximately 498,900 structures.
  • Evaluation: To ensure rigorous testing without data leakage, Kanzi was evaluated on five strictly held-out test sets: CAMEO, CASP14, CASP15, CATH, and a held-out subset of $D_{FS}$.
  • New Benchmark Metric: The authors introduce rFPSD (reconstruction Fréchet Protein Structure Distance). By leveraging features from a pretrained CATH fold classifier, rFPSD provides a distribution-level metric for reconstruction quality, offering a more holistic evaluation than standard coordinate-based metrics like RMSD.

Key Insights and Ideas

  • Symmetry Can Be Learned: Explicitly engineering $SE(3)$ invariance into the network is not a strict requirement for high-fidelity tokenization. Standard attention mechanisms operating on raw coordinates can successfully learn global poses when paired with a powerful diffusion-based decoder.
  • The Pitfall of Mixed Invariance: Through careful ablations, the authors discovered that explicitly invariant encoders actually struggle to condition non-invariant decoders. Kanzi succeeds by keeping both the encoder and decoder non-invariant.
  • Token Mixing is Essential for Generation: While a simple pointwise MLP (without token mixing) is sufficient to achieve good reconstruction metrics, pooling local structural information via the encoder's attention layers is absolutely critical for downstream generative performance.
  • Emergent Codebook Utilization: Unlike standard vector quantization techniques that often suffer from codebook collapse early on, high codebook utilization in Kanzi is an emergent property that develops naturally after extended training as the model learns to decorrelate coordinate data.

Key Results

  • State-of-the-Art Reconstruction: Kanzi (30M parameters) matches or outperforms the reconstruction fidelity of ESM3 (648M parameters) and DPLM-2 (118M parameters) across the CAMEO and CASP test sets.
  • Extreme Data and Parameter Efficiency: Kanzi achieves these SOTA results despite being roughly 20x smaller than ESM3 and trained on a 400x smaller dataset.
Figure 4: Left: Scaling of protein structure tokenizer performance with dataset size and parameter count. We plot the reconstruction accuracy on the CAMEO test set versus the training dataset size. Circle area is the model parameter count. Kanzi is competitive with the ESM3 tokenizer, despite a 20-fold smaller parameter count and 400-fold smaller training dataset. Right: Kanzi simplifies the training pipeline, replacing collections of complex, invariant losses with a single, non-invariant flow matching loss.
  • High-Quality Generation: An autoregressive model trained on Kanzi tokens (Kanzi-AR, 250M parameters) achieved a designability score of 0.617 using best-of-2 sampling, significantly outperforming ESM3-AR (0.520) and DPLM2-AR (0.320) on standard generative benchmarks.

Limitations and Future Work

  • Synthetic Data Bias: Kanzi is trained primarily on AlphaFold2 predictions, causing the generative model to inherit synthetic biases, such as the overprediction of alpha helices.
  • Scale and Length Constraints: Due to compute limitations, the models evaluated are relatively small (<250M parameters) and restricted to proteins shorter than 256 residues.
  • The Generative Gap: While Kanzi-AR represents a massive leap forward for token-based structural models, it does not yet fully match the raw sample quality of state-of-the-art continuous diffusion models (like RFDiffusion).
  • Future Directions: The authors highlight extending the framework from $C_\alpha$-only representations to full-backbone and all-atom tokenization as a vital next step.

Summary updated

BibTeX
@inproceedings{dilip2026flow,
  author = {Rohit Dilip and Evan Zhang and Ayush Varshney and David Van Valen},
  title = {{Flow Autoencoders are Effective Protein Tokenizers}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=5p9uled7JM},
}
Figure