Manuscript Offprint

arXiv:2608.29335

GenFirst: Generation Before Reconstruction for Stable End-to-End Latent Generative Modeling

Guangting Zheng, Yiyuan Zhang, Tao Yang, Yunpeng Chen, Rui Zhu, Jiajun Deng, Yanyong Zhang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Latent generative models typically follow a two-stage pipeline, training a variational autoencoder for reconstruction and then a generative model on the frozen latent space. Since reconstruction-optimized latents are not necessarily generation-friendly, jointly training both models is an appealing alternative. However, direct end-to-end training remains challenging, as it is prone to latent collapse and faces an generation–reconstruction conflict. In this work, we revisit this problem by analyzing how different objectives shape the latent space and identify two key insights. First, the entropy term in the Kullback-Leibler divergence (KL) objective is essential for preventing collapse: reconstruction and prior fitting both tend to shrink the posterior, while entropy preserves non-degenerate latent uncertainty. Second, reconstruction and generation exhibit asymmetric learning dynamics: reconstruction is fast and strongly supervised, whereas generation is slower and harder to optimize. Motivated by these insights, we achieve the first direct end-to-end training without latent collapse and further propose GenFirst, a simple generation-before-reconstruction strategy. The generative objective first shapes the latent space under weak reconstruction pressure, after which reconstruction is progressively strengthened to recover visual details. We validate this strategy using both continuous autoregressive priors with exact likelihoods and SiT priors with implicit likelihoods. With our end-to-end objective and GenFirst, SiT achieves a gFID of 0.97 with CFG and 1.45 without CFG on ImageNet 256×256256 \times 256, while MMDiT reaches a GenEval score of 0.90 on text-to-image generation. Beyond image generation, we further extend the framework to shared visual latents for generation and representation learning, and to continuous unified text–image generation. These results demonstrate the generality of stable end-to-end latent learning across generative priors and modalities.

Date: September 1, 2026

Contact: zgt@mail.ustc.edu.cn

Project Page: https://tom-zgt.github.io/GenFirst/

1 Introduction

Latent generative models [2, 25, 44, 47, 53, 59, 63, 66, 74, 94] have become a dominant paradigm for high-resolution image generation. Instead of modeling images directly in pixel space, they first use a variational autoencoder (VAE) [38] or visual tokenizer to compress raw pixels into a low-dimensional latent space and then train a generative model on this latent distribution. Such a two-stage pipeline greatly reduces modeling

Figure

× Fixed reconstruction-

optimized latent space is

suboptimal for generation

Figure

× Generation loss causes the latent space collapse

(a) Conventional Latent Training

(b) Naïve End-to-End Training

Figure

× Generation loss does not directly shape the latent space

(c) REPA-E

Figure

✓ Prior loss shapes latent space

Entropy term prevents collapse

(d) Stable End-to-End Training (Ours)

Figure 1 Comparison of latent generative modeling paradigms. (a) Conventional two-stage methods train generative models on a fixed, reconstruction-optimized latent space that may be suboptimal for generation. (b) Naïve end-to-end training allows the generative loss to update the encoder but causes latent collapse. (c) REPA-E avoids collapse by stopping generative gradients and reshaping the latent space through an external representation-alignment loss, preventing the generative objective from directly shaping the latent space. (d) Our method enables direct end-to-end training: the prior loss shapes a generation-friendly latent space, while the entropy term prevents collapse.

complexity and has enabled huge progress in image generation. However, recent works [42, 83, 85, 90, 91] show that a VAE latent space optimized for reconstruction is not necessarily optimal for generation. Reconstruction tends to preserve instance-level details, making the latent distribution overly dispersed and harder for generative models to fit and sample from. This mismatch between reconstruction and generation has motivated diverse approaches, including improved autoencoders [83], representation alignment [85], pixel-space generation [5, 43, 49, 86, 93], and end-to-end training [14, 42, 90]. Despite their different designs, these approaches all address a shared question: what representation is best suited for generative modeling?

A natural solution is to jointly train the VAE and generative model, allowing the generative objective to directly shape the latent space. JetFormer [69] and FARMER [93] use invertible normalizing flows [20, 87] instead of VAEs, while SimFlow [90] jointly trains a VAE and normalizing flow with fixed VAE variance. REPA-E [42] jointly trains diffusion models with a VAE, but observes severe latent collapse when gradients from the generative model are propagated to the VAE. It therefore stops the diffusion gradient and instead uses representation alignment for indirect supervision. Together, these designs highlight the promise of end-to-end latent generative modeling, while leaving its feasibility and optimization mechanism unclear.

In this paper, we therefore ask the first fundamental question: Is direct end-to-end training of VAEs and generative models feasible? REPA-E [42] observed that naively propagating the generative loss through the VAE causes latent collapse. To answer this question, we revisit end-to-end training from the perspective of the VAE objective and identify a previously overlooked prior-entropy imbalance ( §3.1\S3.1). LDM [59] established a practical VAE training recipe widely adopted by modern latent generative models, where a small KL weight weakly regularizes the latent space. The KL regularizer in the VAE objective consists of a prior-fitting term and a negative posterior-entropy term. The former encourages latent samples to match the Gaussian prior, whereas the latter preserves posterior uncertainty and prevents degeneracy. In naive end-to-end training, the added generative objective introduces a strong prior-fitting force, while posterior entropy remains suppressed by the inherited small KL weight. This imbalance drives the posterior variance toward zero and the latent representations toward a nearly constant value, ultimately causing latent collapse ( §5.2\S5.2). Our analysis turns latent collapse from an empirical failure mode into a diagnosable and correctable imbalance in the objective: stable end-to-end training requires explicitly preserving posterior entropy and balancing it against prior fitting.

After resolving the collapse issue, end-to-end training still faces a generation–reconstruction conflict [83]: reconstruction favors preserving instance-specific details, whereas generation favors a smoother and more

Figure

Training steps →

Figure 2 Visualization of the asymmetric learning dynamics between reconstruction and generation. Reconstruction reaches good image fidelity within much fewer training steps, while generation requires a longer optimization process to learn a sampleable latent distribution.

modelable latent distribution, potentially discarding information needed for faithful reconstruction. This results in a generation–reconstruction trade-off, where improving one objective often degrades the other ( §3.2\S3.2).

Therefore, we ask a second fundamental question: How can we mitigate the generation–reconstruction conflict to learn a latent space better suited for generative modeling? As shown in figure 2, our experiments reveal asymmetric learning dynamics between reconstruction and generation ( §3.3\S3.3). Reconstruction improves rapidly under direct supervision, whereas generation requires longer optimization to learn a globally sampleable latent distribution. Strong reconstruction pressure early in training can therefore anchor the encoder to a reconstruction-oriented latent space that is difficult for the generative model to learn. Conversely, maintaining excessive generative pressure can limit the recovery of visual details needed for high-quality decoding. These observations suggest that the key is not only how the two objectives are weighted, but also when each objective shapes the latent space.

This observation motivates GenFirst, a simple generation-before-reconstruction strategy for our end-to-end training framework. Rather than first learning a reconstruction-oriented latent space and then forcing the generative model to chase it, GenFirst allows the generative objective to shape the latent distribution early, under weak reconstruction pressure and explicit entropy preservation. Once the latent distribution can be effectively modeled by the generative prior, reconstruction is progressively strengthened to recover visual details. This ordering aligns with the asymmetric learning dynamics of the two objectives: generation needs to shape the latent geometry early, while reconstruction, being faster and more directly supervised, can be strengthened later.

We instantiate GenFirst in two representative settings. First, we adopt a continuous autoregressive prior from FARMER [93], where exact likelihood is available and the prior–entropy balance can be directly analyzed. Second, we apply GenFirst to SiT [47], a flow-matching prior with an implicit likelihood, to evaluate whether the strategy generalizes beyond exact-likelihood models. Across class-to-image and text-to-image generation, GenFirst consistently improves the generation–reconstruction trade-off, providing a practical and reliable recipe for stable end-to-end latent generative modeling. Beyond image generation, we further extend our end-to-end formulation to shared visual latents that support generation, representation learning, and reconstruction. We also apply it to continuous unified text–image modeling, demonstrating its generality across modalities.

We summarize our contributions as follows:

  • We identify a prior–entropy imbalance as the key cause of latent collapse in direct end-to-end training and show that preserving posterior entropy is essential for preventing collapse.

  • We reveal the asymmetric learning dynamics of generation and reconstruction and propose a GenFirst strategy that first shapes a generation-friendly latent space and then progressively recovers visual details.

  • We validate GenFirst with both exact-likelihood continuous autoregressive priors and SiT-based flow-matching priors, achieving a FID of 0.97 on ImageNet and a GenEval score of 0.90 on text-to-image generation. We also validate its applicability across objectives and modalities by further experiments.

References (83)