Flow Autoencoders are Effective Protein Tokenizers

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

Introduction

To build multimodal AI models for biology—systems capable of simultaneously "reading" and "writing" protein sequences, structures, and functions—researchers rely on tokenizers. These algorithms convert continuous 3D protein structures into a sequence of discrete tokens, much like words in a sentence, allowing standard language models to process them.

Since the advent of AlphaFold2, the gold standard for protein machine learning has been to use SE(3)-invariant architectures. These models are mathematically constrained to recognize that a protein remains the exact same object regardless of its rotation or translation in 3D space. However, baking this physics into a neural network requires bespoke components and complex loss functions (like FAPE). These architectures are notoriously difficult to optimize, hard to scale, and challenging to adapt to other biological molecules.

This paper asks a fundamental question: Do we really need to hardcode these spatial symmetries, or can a simpler, standard architecture learn them if trained correctly? The authors introduce Kanzi, a highly efficient protein structure tokenizer that ditches complex 3D symmetry-preserving architectures in favor of a simple flow-matching autoencoder.

The Kanzi Architecture

Kanzi is an asymmetric flow autoencoder that completely drops SE(3)-invariant constraints.

Kanzi Architecture
  • Encoder: Kanzi takes the raw, mean-centered 3D coordinates of a protein and passes them through a lightweight encoder using standard sliding-window attention.
  • Quantization: The continuous representations are discretized into tokens using Finite Scalar Quantization (FSQ).
  • Decoder & Loss: The tokens are fed into a deep Diffusion Transformer (DiT) decoder. Instead of relying on complex structural loss functions, the entire system is trained end-to-end using a single flow matching loss (a modern variant of diffusion).
  • Generation: Once the tokenizer is trained, a standard autoregressive language model can be trained on the discrete tokens to generate entirely new protein structures.

Key Insights and Results

By dropping SE(3) invariance and complex frame-based math, the authors found that training actually stabilizes. Standard attention works remarkably well for 3D coordinates when supervised by a flow matching loss. Furthermore, they discovered that local pooling (via sliding window attention) in the encoder is essential; simple point-wise encoders fail to create a meaningful "language" of structure for downstream generation.

David vs. Goliath in Reconstruction

Kanzi achieves state-of-the-art reconstruction while being significantly smaller and easier to train than existing models. At just 30M parameters, Kanzi matches or outperforms massive models like the ESM3 tokenizer (648M parameters) and DPLM2 (118M) on reconstruction metrics like RMSD and TM-score. Remarkably, it achieves this despite being 20x smaller and trained on 400x less data.

Structure Tokenizer Model Landscape

Strong Generative Performance

An autoregressive model trained on Kanzi tokens (250M parameters) achieved a designability score of 0.617 and an scRMSD of 3.655 Å (using Best-of-N sampling). This outperforms similarly sized autoregressive models trained on ESM3 and DPLM2 tokens. To better evaluate this, the authors introduced the reconstruction Fréchet Protein Structure Distance (rFPSD), which measures how well the tokenizer captures the statistical distribution of real proteins—a stronger proxy for downstream generative performance than standard per-protein RMSD.

Unlocking Spatial Conditioning

Because Kanzi doesn't force rotational invariance, it can be conditioned on inherently spatial data. The authors demonstrated this by conditioning the model on 3D voxel maps from Cryo-Electron Tomography (cryoET). Standard invariant tokenizers immediately fail at this task because they cannot anchor the generated protein to the specific pose required by the 3D image. In a proof-of-concept, Kanzi successfully generated protein structures conditioned on simulated cryoET voxel maps, achieving < 3Å RMSD agreement with ground truth structures.

Limitations and Future Work

While Kanzi represents a significant step forward in simplifying protein tokenization, it has limitations:

  • Synthetic Data Bias: Trained heavily on a Foldseek-clustered subset of the AlphaFold Database (~498,900 synthetic structures), Kanzi tends to overpredict alpha helices, a known bias of synthetic structural data.
  • Scale Limits: Due to compute constraints, the models are relatively small and were only trained on proteins shorter than 256 residues.
  • The Generative Gap: While Kanzi beats other tokenized autoregressive models, it does not yet match the sheer generative quality of state-of-the-art continuous diffusion models (like RFdiffusion or Chroma).

Future work will focus on scaling up model size, training on larger proteins, and extending the generative models from $C\alpha$-only to full-atom backbones to close the performance gap with continuous diffusion models.

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