Vision foundation model Aligned Variational AutoEncode

1. Vision foundation model Aligned Variational AutoEncode (VA-VAE)

As visual tokenizers become more sophisticated with higher-dimensional latent spaces to improve reconstruction quality, they paradoxically become harder for diffusion models to work with, leading to poor generation performance.

FigureΒ 1: Optimization dilemma within latent diffusion models. In latent diffusion models, increasing the dimension of the visual tokenizer enhances detail reconstruction but significantly reduces generation quality.

To resolve this dilemma, the research introduces a Vision Foundation Model Aligned Variational AutoEncoder (VA-VAE) that uses a novel Vision Foundation Model Alignment Loss (VF Loss). This approach leverages the structured, semantically meaningful representations learned by pre-trained vision foundation models to guide the tokenizer's latent space toward being more "generation-friendly."

FigureΒ 2: Vision foundation models are used to guide the training of high-dimensional visual tokenizers, effectively mitigating the optimization dilemma and improve generation performance.

Relationship to REPA: REPA aims to employ vision foundation models to constrain DiT, thereby enhancing the convergence speed of generative models. In contrast, our work takes into account both the reconstruction and generative capabilities within the latent diffusion model, with the objective of leveraging foundation models to regulate the highdimensional latent space of the tokenizer, thereby resolving the optimization conflict between the tokenizer and the generative model.

1.1. Align VAE with Vision Foundation Models

Vision Foundation model alignment loss (VF loss) consists of two components: marginal cosine similarity loss and marginal distance matrix similarity loss.

1.1.1. Marginal Cosine Similarity Loss

We project the image latents 𝑍 to match the dimensionality of foundational visual representations 𝐹 using a linear transformation π‘Š, producing 𝑍′=π‘Šπ‘.

The Marginal Cosine Similarity Loss enforces element-wise alignment between the VAE's latent features and foundation model features, focusing alignment on less similar pairs:

β„’mcosΒ =1β„ŽΓ—π‘€βˆ‘π‘–=1β„Žβˆ‘π‘—=1𝑀max(0,π‘š1βˆ’cos(𝑧𝑖𝑗′,𝑓𝑖𝑗))

1.1.2. Marginal Distance Matrix Similarity Loss

Complementary to 𝐿mcos, which enforces point-to-point absolute alignment, we also aim for the relative distribution distance matrices within the features to be as similar as possible. The Marginal Distance Matrix Similarity Loss aligns the internal structure and relationships within the latent space:

β„’mdmsΒ =1𝑁2βˆ‘π‘–π‘—max(0,|cos(𝑧𝑖′,𝑧𝑗′)βˆ’cos(𝑓𝑖,𝑓𝑗)|=π‘š2)

Here, 𝑁=β„ŽΓ—π‘€ represents the total number of elements in each flattened feature map.

1.1.3. Adaptive Weighting

𝐿vfΒ =𝑀 hyper ⋅𝑀 adaptiveΒ (β„’mcosΒ +β„’Β mdms)

The adaptive weighting function 𝑀adaptive is defined as β€–βˆ‡β„’Β recβ€–β€–βˆ‡β„’Β vfβ€– to ensure β„’vf and β„’rec have similar impacts on model optimization.

References

  1. Reconstruction vs. Generation: Taming Optimization Dilemma in Latent Diffusion Models