Flow Autoencoders are Effective Protein Tokenizers

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

Abstract

Protein structure tokenizers enable the creation of multimodal models of protein structure, sequence, and function. Current approaches to protein structure tokenization rely on bespoke components that are invariant to spatial symmetries, but that are challenging to optimize and scale. We present Kanzi, a flow-based tokenizer for tokenization and generation of protein structures. Kanzi consists of a diffusion autoencoder trained with a flow matching loss. We show that this approach simplifies several aspects of protein structure tokenizers: frame-based representations can be replaced with global coordinates, complex losses are replaced with a single flow matching loss, and SE(3)-invariant attention operations can be replaced with standard attention. We find that these changes stabilize the training of parameter-efficient models that outperform existing tokenizers on reconstruction metrics at a fraction of the model size and training cost. An autoregressive model trained with Kanzi outperforms similar generative models that operate over tokens, although it does not yet match the performance of state-of-the-art continuous diffusion models.

Introduction

The development of Large Language Models (LLMs) for biology necessitates a robust method for discretizing continuous 3D protein structures into tokens. Traditional methodologies have emphasized the necessity of SE(3)-invariance—ensuring tokens remain constant regardless of the protein's spatial orientation. However, achieving this invariance typically requires complex, "bespoke" architectural components such as local coordinate frames and specialized geometric attention mechanisms. These constraints often hinder scalability and generalizability to other molecular types. In this work, we introduce Kanzi, a simplified diffusion-based autoencoder that challenges the necessity of explicit geometric inductive biases in protein tokenization.

The Kanzi Architecture

Kanzi re-imagines protein tokenization as a generative task using a diffusion autoencoder framework. The model consists of three primary components:

  1. Encoder: A lightweight transformer utilizing a sliding-window attention mechanism. Unlike previous models, it operates on raw 3D coordinates without requiring equivariant layers, mapping them to a continuous latent space.
  2. Quantization: The continuous latents are discretized using Finite Scalar Quantization (FSQ), creating a fixed codebook of structural tokens.
  3. Decoder: A Diffusion Transformer (DiT) serves as the generative core. It is trained using a flow matching loss to reconstruct the original protein structure from a noise distribution, conditioned on the discrete tokens.
The Kanzi architecture includes (a) a training pipeline with diffusion loss, (b) a DiT-based decoder, and (c) a sliding-window attention encoder.

By utilizing global coordinates and a unified flow matching objective, Kanzi eliminates the need for the complex, multi-component loss functions (e.g., FAPE, dRMSD) characteristic of prior state-of-the-art models like ESM3 or FoldToken.

Experimental Results

Kanzi was trained on a filtered subset of the AlphaFold Structure Database (AFDB) and evaluated against several benchmark datasets, including CAMEO and CASP.

Performance and Efficiency

Despite its modest size (30M parameters), Kanzi outperforms significantly larger models. For instance, it surpasses the 648M parameter ESM3 tokenizer in reconstruction metrics such as RMSD and TM-score while utilizing 400x less training data. This efficiency suggests that a powerful decoder can effectively compensate for a simplified, non-invariant encoder.

Kanzi occupies a superior position in the model landscape, achieving lower scRMSD with less data and a simplified loss objective.

Generative Capabilities

Beyond reconstruction, we evaluated Kanzi's utility in protein design. An autoregressive model trained on Kanzi's tokens (Kanzi-AR) successfully generated novel, "designable" proteins. These generated structures could be folded back into their intended shapes with high confidence (scRMSD < 2.0Å), demonstrating the high information density of the learned tokens.

Discussion and Insights

Our findings suggest that explicit SE(3)-invariance may be an unnecessary constraint for protein tokenizers. Much like the transition from specialized vision models to general Transformers, a sufficiently expressive non-invariant model can learn spatial relationships more efficiently. Furthermore, the use of diffusion as a "super-loss" provides a robust signal for physical plausibility, replacing the need for hand-tuned geometric penalties.

While Kanzi currently faces limitations—such as a bias toward alpha helices due to its training data and a maximum sequence length of 256 residues—it represents a significant step toward more scalable and generalizable multimodal biological 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