Hugging Face Papers ↗ · 2026-11-21
Single-Transformer Latent Diffusion
Media reports Hugging Face Papers Source language: Chinese
UNIFIED unifies encoding, generation and decoding in one transformer, achieving 2.08 gFID on ImageNet‑1K with only reconstruction and flow‑matching losses.
Full text
Single-Transformer Latent Diffusion
Hao-Yu Hsu Shenlong Wang & Alexander G. Schwing Affiliation: University of Illinois Urbana-Champaign Affiliation: {haoyuyh3, shenlong, aschwing}@illinois.edu Affiliation: https://haoyuhsu.github.io/Unified-LDM/
Abstract
Latent generative models typically rely on three separate networks: an encoder that tokenizes pixels, a generator that models the latent distribution, and a decoder that maps latents back to pixels. UNITE recently merged the first two into a single generative encoder trained in one stage, but its decoder remains a separate network. We ask whether this last network can be folded in too, so that one diffusion transformer encodes, generates, and decodes. Simply letting the shared backbone decode does not help. What makes it work is to cast all three modes as position-aligned sequence maps over one fully shared backbone, distinguished only by a mode token and the timestep. The resulting model, UNIFIED, is simple: one network trained from scratch in a single stage with only reconstruction and flow-matching losses, without adversarial losses or pretrained encoders (e.g., DINO). On ImageNet-1K 256×256256\times 256 at matched parameters, UNIFIED improves gFID over UNITE at three sizes (∼60{\sim}60M, ∼115{\sim}115M, and ∼215{\sim}215M) and reaches 2.082.08 with 215215M parameters, the lowest among compared models under 250250M parameters. On text-to-image generation, UNIFIED-B (218218M) reaches a GenEval score of 0.870.87 at 512×512512\times 512, exceeding single-stage pixel diffusion models with around one billion parameters. Full unification of latent diffusion is thus not merely feasible but beneficial.
1 Introduction

Figure 1: (Left) Selected samples from UNIFIED on ImageNet-1K 256×256256\times 256 (CFG scale 4.04.0). (Right) Full unification is not merely feasible but beneficial. gFID (↓\downarrow) at three sizes; bar labels give the total trainable parameters. UNIFIED improves on UNITE at every size, and Tiny UNIFIED nearly matches Small UNITE with about half the parameters (2.782.78 at 6262M vs. 2.762.76 at 117117M). Separate is a standard three-network pipeline (Figure 2a), trained at Small and Base. UNITE and UNIFIED: mean over five evaluation seeds (Table 14).
Latent diffusion models (Rombach et al., 2022; Peebles & Xie, 2023; Ma et al., 2024) rely on three trainable networks: an encoder that maps pixels to latents, a generator that models the latent distribution, and a decoder that maps latents back to pixels. They are usually trained in stages: the autoencoder is first trained for reconstruction, and then frozen while the generator is fit to its latents. This recipe fixes the representation before the model that must sample from it is trained. It also forces a choice of how much capacity each network receives, and the effect of that choice on generation is hard to predict (Hansen-Estruch et al., 2025).
We ask whether this pipeline can collapse into a single diffusion transformer (DiT) whose every block is shared by encoding, denoising, and decoding, trained in a single stage with only a reconstruction loss and a flow-matching loss, with no pretrained encoders such as DINO (Oquab et al., 2024). Most single-stage training methods keep the tokenizer and generator as separate networks (Vahdat et al., 2021; Leng et al., 2025; Zhao et al., 2026; Zheng et al., 2026b; Heek et al., 2026), while the few that use a single network still reserve parts of it for individual modes: LDM-is-AE (Zhang et al., 2026) splits one DiT by depth into encoding and decoding blocks, which turns the allocation choice above into a choice of split depth, and DSD (Wang & Zhang, 2025) adds a dedicated diffusion head and relies on DINO alignment.
UNITE (Duggal et al., 2026) is the closest step in this direction. It treats tokenization and generation as the same latent-inference problem and solves both with one generative encoder, trained in a single stage with only reconstruction and flow-matching losses, but it still decodes pixels with a separate network (Figure 2b). A natural baseline is to let UNITE’s backbone decode as well. We call this extension UNITE++ (Figure 2c): it shares every weight across the three modes and selects the mode with a learned mode token. Like UNITE, it reads its outputs from readout tokens, which are extra input tokens whose outputs are taken as the latent or as pixels. UNITE++ does not improve upon UNITE: at ∼215{\sim}215M parameters it reaches a gFID of 2.242.24 vs. UNITE’s 2.232.23 and reconstructs markedly worse (rFID 2.202.20 vs. 1.411.41). We attribute this to the readout design: there is no direct mapping between latent tokens and image locations, so to decode, every image location must gather its content from the latent tokens through attention.
We therefore propose UNIFIED (Figure 2d), a single DiT that maps images to latents, latents to latents, and latents to images as position-aligned sequence maps: a given sequence index refers to the same image location whether it holds a pixel patch, a latent, or a noisy latent. The backbone is fully shared, and each mode is selected by a learned mode token and lightweight input and output heads. Relative to UNITE, UNIFIED changes only the sequence layout, the timesteps for encoding and decoding, and the mode tokens, and replaces the standalone decoder with a lightweight pixel output head. The training recipe is unchanged.
The remaining design choice is the timestep that conditions encoding and decoding. Both are noiseless maps, so the natural choice is the clean endpoint (t=1t=1). This improves gFID over UNITE (2.152.15 vs. 2.232.23 at ∼215{\sim}215M). At t=1t=1, however, three modes disagree on what to output: encoding and generation both produce the clean latent, whereas decoding produces pixels. Sharing t=1t=1 thus forces the last block to serve two output spaces, and the conflict is sharpest near the clean endpoint at the end of the layers (Section 4.3). We therefore give decoding its own learned timestep embedding, denoted tdec=−1t_{\mathrm{dec}}=-1 (a label outside [0,1][0,1]), which leaves t=1t=1 to the two modes whose target is the clean latent. This further lowers gFID to 2.082.08 and restores the alignment between the two passes near the clean endpoint (Figure 3).
On ImageNet-1K ×256256\!\times\!256 at matched parameter counts, UNIFIED improves gFID over UNITE at all three sizes (∼60{\sim}60M, ∼115{\sim}115M, and ∼215{\sim}215M). Tiny UNIFIED nearly matches Small UNITE on gFID with about half the parameters, suggesting that a standalone decoder uses capacity less efficiently than the shared backbone. Against published models, UNIFIED-B reaches a gFID of 2.082.08 with 215215M parameters, the lowest among compared models with at most 250250M parameters, without a pretrained autoencoder or vision foundation model (Section 4.2). On text-to-image generation at 256×256256\times 256, UNIFIED-L (554554M) outperforms both the pixel-space JiT (Li & He, 2026) (615615M) and DiTDH-XL (Zheng et al., 2026a) with a pretrained FLUX-VAE (959959M) on GenEval, DPG-Bench, and GenAI-Bench. At 512×512512\times 512, UNIFIED-B (218218M) reaches 0.870.87 on GenEval and 0.8270.827 on DPG-Bench, exceeding single-stage pixel diffusion models with around one billion parameters (Section 4.5).
Our contributions are:
•
We propose UNIFIED, a single DiT that encodes, generates, and decodes with every backbone weight shared, trained from scratch in a single stage with only reconstruction and flow-matching losses, without adversarial losses or pretrained encoders (e.g., DINO).
•
We analyze how shared weights keep the three modes apart. We show that position alignment restores the reconstruction lost by naive full sharing, that the encoding timestep must match what the encoder reads, and that a learned decoding timestep removes the conflict between decoding and generation at the clean endpoint, leading to better performance.
•
At matched parameter counts on ImageNet, UNIFIED improves over UNITE at three parameter scales and attains the lowest gFID among compared models with at most 250250M parameters. It also extends to text-to-image generation: at 512×512512\times 512, UNIFIED-B (218218M) exceeds single-stage pixel diffusion models with around one billion parameters.
2 Related Work
Autoencoders and latent diffusion. Latent generative models typically follow a two-stage recipe: an autoencoder is trained for reconstruction and frozen, and a separate generator is then fit to its latents. The tokenizer is usually a KL-regularized VAE (Kingma & Welling, 2014; Rezende et al., 2014) for latent diffusion (Rombach et al., 2022; Podell et al., 2024) or a vector-quantized autoencoder (van den Oord et al., 2017; Razavi et al., 2019) for discrete generation, in both cases trained with the perceptual (Zhang et al., 2018) and adversarial losses popularized by VQGAN (Esser et al., 2021). Because the two stages are decoupled, progress has largely come one network at a time: generators have moved to transformer backbones (Peebles & Xie, 2023; Zheng et al., 2024; Gao et al., 2023; Ma et al., 2024; Wang et al., 2026b) and flow-based objectives (Lipman et al., 2023; Liu et al., 2023), while tokenizers have improved latent quantization (Mentzer et al., 2024; Yu et al., 2024a) and compactness (Yu et al., 2024b; Chen et al., 2025b). This decoupling has a cost, however. The two stages optimize different objectives, which creates an optimization dilemma: a latent that favors reconstruction can degrade generation. VA-VAE (Yao et al., 2025) addresses this dilemma by aligning the VAE latent with a pretrained vision encoder (Caron et al., 2021; Oquab et al., 2024). Such encoders also serve as an alignment target for the generator (Yu et al., 2025), or even replace the tokenizer’s encoder in the latent diffusion pipeline (Zheng et al., 2026a; Shi et al., 2026). We instead revisit the recipe itself: a single backbone serves as encoder, decoder, and generator, and is trained in a single stage without relying on a pretrained vision encoder.

Figure 2: From three networks to one shared transformer. (a) Separate: the standard latent-diffusion pipeline trains an encoder EθE_{\theta}, a generator GψG_{\psi}, and a decoder DϕD_{\phi}. (b) UNITE shares one backbone between encoding and generation; the encoding pass appends 𝒩(0,I)\mathcal{N}(0,I) readout tokens to the image patches and takes the latent zz from their outputs, but a standalone decoder DϕD_{\phi} remains. (c) UNITE++ folds decoding into the same backbone as a third mode, selected by a mode token, but keeps readout tokens for encoding (latent readouts) and decoding (pixel readouts). (d) UNIFIED (ours) removes all readout tokens: every pass maps a same-length, position-aligned sequence (image xx, noisy latent ztz_{t}, or latent zz) after a mode token at position 00, and encodes clean images at tenc=1t_{\mathrm{enc}}=1 rather than 00. Bottom right: each model’s encoding and decoding timesteps.
End-to-end tokenization and generation. Closer to our setting, several methods train the tokenizer and generator jointly (Leng et al., 2025; Duggal et al., 2026). The central difficulty is latent collapse: once the generation loss can shape the latent, the generator can lower its loss by making the latent trivial rather than modeling it (Leng et al., 2025; Wang & Zhang, 2025; Zheng et al., 2026b). Existing methods differ mainly in how they prevent this. Likelihood-based approaches keep a variational bound whose KL or entropy terms hold the latent in place, and train a score-based (Vahdat et al., 2021), normalizing-flow (Zhao et al., 2026), or diffusion (Zheng et al., 2026b; Heek et al., 2026) prior jointly with the autoencoder. REPA-E (Leng et al., 2025) instead anchors the latent to an external representation, backpropagating a representation-alignment loss, rather than the diffusion loss, into the VAE. Other approaches stop the gradient through the denoising target and predict clean latents (Duggal et al., 2026; Wang & Zhang, 2025; Zhang et al., 2026); this needs neither a variational bound nor an external encoder, and we adopt it. Closest to our work, three methods built on this recipe also share weights. UNITE (Duggal et al., 2026) merges the encoder and generator but keeps a standalone decoder; LDM-is-AE (Zhang et al., 2026) splits one DiT by depth into encoding and decoding blocks, which requires manually choosing the split depth and the feature-mixing schedule; and DSD (Wang & Zhang, 2025) uses a single ViT for all three modes with lightweight blocks for diffusion, but reintroduces an external alignment loss. UNIFIED instead shares every block of a single DiT backbone across all three roles, with no role-specific blocks or alignment loss.
Pixel diffusion. A more direct way to avoid the two-stage recipe is to drop the latent and run diffusion on pixels. Early pixel-space models handle the high dimensionality with U-Net designs, adjusted noise schedules, and loss weightings (Dhariwal & Nichol, 2021; Hoogeboom et al., 2023; Kingma & Gao, 2023; Hoogeboom et al., 2025), adaptive computation over a small set of latent tokens (Jabri et al., 2023), or cascades across resolutions (Chen et al., 2025c). JiT (Li & He, 2026; Starodubcev et al., 2026) shows that a plain ViT on large patches suffices when it predicts the clean image. Follow-up works improve details with dedicated pixel-level modules (Yu et al., 2026; Wang et al., 2026a; Ma et al., 2026a) or U-shaped skip connections (Guo et al., 2026), or draws on a pretrained vision encoder for representation alignment (Shin et al., 2026), perceptual losses (Ma et al., 2026b), or denoising its features first (Baade et al., 2026). Likewise, UNIFIED trains one network in a single stage, but keeps a learned latent that the same backbone encodes and decodes.
One transformer, many tasks. A single transformer can serve many tasks when the task is specified through its input. The most common way is the input format: a text prefix or prompt (Raffel et al., 2020; Chen et al., 2022; Lu et al., 2023; Lu et al., 2024a), the choice of input and target modalities (Mizrahi et al., 2023), in-context example pairs (Wang et al., 2023), or a multimodal instruction (Xiao et al., 2025). Unified multimodal models (Chameleon Team, 2024; Zhou et al., 2025; Xie et al., 2025; Wu et al., 2025; Deng et al., 2025) extend this to understanding and generation in one backbone. Another way is the corruption level of each input, set by per-modality or per-token timesteps (Bao et al., 2023; Chen et al., 2024; Le et al., 2025) or by masking ratios (Li et al., 2023; Hansen-Estruch et al., 2024): clean inputs act as conditions and heavily corrupted ones are generated, so one network can switch among conditional, joint, and marginal generation, or between representation learning and generation. In this paper, we use a learned mode token and a mode-specific timestep to direct a single DiT backbone between tokenization and generation.
3 Method
UNIFIED replaces the encoder, generator, and decoder of latent diffusion with a single diffusion transformer TθT_{\theta} that operates in three modes: encoding, generation, and decoding. Each training step runs one pass per mode, and every pass is a position-aligned sequence map, in which index ii refers to the same image location whether it holds a pixel patch, a latent token, or a noised latent token. The backbone weights are fully shared; the modes differ only in lightweight input and output heads, in a learned mode token prepended to the sequence, and in the AdaLN conditioning, namely the timestep and a class label that is null outside generation (Table 1).
3.1 Preliminaries: latent diffusion and UNITE
Let x∈ℝH×W×3x\in\mathbb{R}^{H\times W\times 3} denote an image, which a transformer reads as N=HW/p2N=HW/p^{2} patches of size p×pp\times p, and let z∈ℝK×dz\in\mathbb{R}^{K\times d} denote its latent, a sequence of KK tokens of width dd. t∈[0,1]t\in[0,1] is the noise level, with t=1t=1 corresponding to clean data and t=0t=0 to Gaussian noise, and cc is the class label, with ∅\emptyset denoting the null label. A noised latent is formed by the rectified-flow interpolation (Lipman et al., 2023)
zt=tz+(1−t)ϵ,ϵ∼𝒩(0,I),t∼𝒰[0,1],z_{t}=t\,z+(1-t)\,\epsilon,\qquad\epsilon\sim\mathcal{N}(0,I),\quad t\sim\mathcal{U}[0,1], (1)
so that z1=zz_{1}=z is the clean latent and z0z_{0} is pure noise.
Latent diffusion. The standard pipeline (Figure 2a) trains three networks: an encoder EθE_{\theta} that maps an image to its latent, a generator GψG_{\psi} that recovers the clean latent from a noised one, and a decoder DϕD_{\phi} that maps latents back to pixels (Rombach et al., 2022; Peebles & Xie, 2023). The encoder and decoder are trained first under a reconstruction objective and then frozen, so generative gradients cannot shape the latent space that the generator must later model.
UNITE. UNITE (Duggal et al., 2026) observes that tokenization and generation are the same latent-inference problem under different conditioning: tokenization infers the latent from a fully observed image, and generation infers it from a noised latent. It therefore implements the encoding and generation modes with one network, the generative encoder, trained in a single stage (Figure 2b). Its encoding pass reads the image patches alongside KK tokens drawn from 𝒩(0,I)\mathcal{N}(0,I) and returns their outputs as the latent, and its generation pass places ztz_{t} at the same positions. UNITE calls these tokens registers; we call them latent readouts, since unlike the registers of Darcet et al. (2024), whose outputs are discarded, their outputs are the latent. We apply a stop-gradient to the encoder output zz in the generation loss, so the loss treats the latent as a constant. The same detached latent serves as the clean target and, once noised, as the generator’s input. Because no gradient from the generation loss reaches zz, this loss cannot push the latent toward a trivial solution. The reconstruction and generation losses still jointly update the shared weights. Writing each pipeline in terms of the three functions it learns, gives
LDM: z=Eθ(x),\displaystyle z=E_{\theta}(x),\quad z^=Gψ(zt,t,c),\displaystyle\hat{z}=G_{\psi}(z_{t},t,c),\quad x^=Dϕ(z),\displaystyle\hat{x}=D_{\phi}(z), (2)
UNITE: z=Eθ(x),\displaystyle z=E_{\theta}(x),\quad z^=Gθ(zt,t,c),\displaystyle\hat{z}=G_{\theta}(z_{t},t,c),\quad x^=Dϕ(z),\displaystyle\hat{x}=D_{\phi}(z), (3)
UNIFIED: z=Eθ(x),\displaystyle z=E_{\theta}(x),\quad z^=Gθ(zt,t,c),\displaystyle\hat{z}=G_{\theta}(z_{t},t,c),\quad x^=Dθ(z).\displaystyle\hat{x}=D_{\theta}(z). (4)
Table 1: What each pass receives in the shared backbone TθT_{\theta}. r∼𝒩(0,I)r\sim\mathcal{N}(0,I): latent readouts; xreadoutx_{\mathrm{readout}}: pixel readouts. UNIFIED decodes either at the clean endpoint (t=1t=1) or with the learned decoding timestep (t=−1t=-1).
Model Mode Input sequence Output tt cc Length
UNITE++ Encode [qenc;r;Pxin(x)][q_{\mathrm{enc}};r;P_{x}^{\mathrm{in}}(x)] PzoutP_{z}^{\mathrm{out}} at the KK latent readouts 00 ∅\emptyset 1+K+N1+K+N
Generate [qgen;Pzin(zt)][q_{\mathrm{gen}};P_{z}^{\mathrm{in}}(z_{t})] PzoutP_{z}^{\mathrm{out}} at positions 1:K1{:}K tt cc 1+K1+K
Decode [qdec;Pzin(z);xreadout][q_{\mathrm{dec}};P_{z}^{\mathrm{in}}(z);x_{\mathrm{readout}}] PxoutP_{x}^{\mathrm{out}} at the NN pixel readouts 11 ∅\emptyset 1+K+N1+K+N
UNIFIED Encode [qenc;Pxin(x)][q_{\mathrm{enc}};P_{x}^{\mathrm{in}}(x)] PzoutP_{z}^{\mathrm{out}} at positions 1:N1{:}N 11 ∅\emptyset N+1N+1
Generate [qgen;Pzin(zt)][q_{\mathrm{gen}};P_{z}^{\mathrm{in}}(z_{t})] PzoutP_{z}^{\mathrm{out}} at positions 1:N1{:}N tt cc N+1N+1
Decode [qdec;Pzin(z)][q_{\mathrm{dec}};P_{z}^{\mathrm{in}}(z)] PxoutP_{x}^{\mathrm{out}} at positions 1:N1{:}N 1/−11/{-1} ∅\emptyset N+1N+1
Functions with a common subscript share every backbone weight; they differ only in lightweight input and output heads and, in UNIFIED, a learned mode token (Section 3.2).
A naive full-sharing baseline: UNITE++. UNITE reduces three networks to two, but the decoder DϕD_{\phi} remains a standalone network. The interface in Equation 4 does not by itself determine how the three passes are laid out. Its most direct realization keeps UNITE’s readout layout and lets the generative encoder decode as well; we call this baseline UNITE++ (Figure 2c). Its encoding pass is UNITE’s, reading the image patches alongside KK latent readouts at tenc=0t_{\mathrm{enc}}=0; its decoding pass reads the latent alongside NN pixel readouts at tdec=1t_{\mathrm{dec}}=1 and returns pixels from them; and a learned mode token selects the mode (Table 1). UNITE++ thus shares every backbone weight, the mode tokens, and the training objective with UNIFIED, and differs only in the sequence layout and the encoding and decoding timesteps. Section 3.3 motivates each of these two choices, and Section 4.3 isolates their effects.
3.2 UNIFIED: one backbone, three modes
UNIFIED computes all three functions in Equation 4 with one backbone TθT_{\theta}, a stack of DiT blocks (Peebles & Xie, 2023) with RoPE (Su et al., 2024), in which the timestep and class label reach every block through AdaLN. The backbone takes a token sequence together with (t,c)(t,c) and returns a sequence of the same length. Four lightweight heads translate between values and the backbone width: PxinP_{x}^{\mathrm{in}} and PxoutP_{x}^{\mathrm{out}} for pixel patches, and PzinP_{z}^{\mathrm{in}} and PzoutP_{z}^{\mathrm{out}} for latent tokens. Three of the four heads, PxinP_{x}^{\mathrm{in}}, PzinP_{z}^{\mathrm{in}}, and PzoutP_{z}^{\mathrm{out}}, are those of UNITE’s generative encoder and are used unchanged. The fourth, PxoutP_{x}^{\mathrm{out}}, is the only head that UNIFIED adds: it lets the backbone itself return pixel patches and thereby replaces UNITE’s standalone decoder. A learned mode token, qencq_{\mathrm{enc}}, qgenq_{\mathrm{gen}}, or qdecq_{\mathrm{dec}}, is prepended at position 00 to select the mode. The three passes are
Eθ(x)\displaystyle E_{\theta}(x) =PzoutTθ([qenc;Pxin(x)],tenc,∅),\displaystyle=P_{z}^{\mathrm{out}}\,T_{\theta}\!\left([q_{\mathrm{enc}};P_{x}^{\mathrm{in}}(x)],\,t_{\mathrm{enc}},\,\emptyset\right), (5)
Gθ(zt,t,c)\displaystyle G_{\theta}(z_{t},t,c) =PzoutTθ([qgen;Pzin(zt)],t,c),\displaystyle=P_{z}^{\mathrm{out}}\,T_{\theta}\!\left([q_{\mathrm{gen}};P_{z}^{\mathrm{in}}(z_{t})],\,t,\,c\right), (6)
Dθ(z)\displaystyle D_{\theta}(z) =PxoutTθ([qdec;Pzin(z)],tdec,∅),\displaystyle=P_{x}^{\mathrm{out}}\,T_{\theta}\!\left([q_{\mathrm{dec}};P_{z}^{\mathrm{in}}(z)],\,t_{\mathrm{dec}},\,\emptyset\right), (7)
where [⋅;⋅][\,\cdot\,;\,\cdot\,] denotes concatenation along the sequence dimension and the output at the mode-token position is discarded before the output head. The latent has one token per patch, K=NK=N, so every pass has length N+1N+1; the encoding and decoding timesteps tenct_{\mathrm{enc}} and tdect_{\mathrm{dec}} are discussed in Section 3.3. Every backbone parameter is shared across Equations 5–7; the only mode-specific parameters are the four heads, the three mode tokens, and the learned decoding timestep (Section 3.3), which together make up 1.63%1.63\% of the parameters at Base (∼215{\sim}215M). Because the generation and decoding passes read latents through the same head PzinP_{z}^{\mathrm{in}}, the two differ only in their mode token, their conditioning, and their output head. Table 1 lists what each pass receives.
3.3 Specifying modes in shared weights
With every backbone weight shared, the three passes differ only in what enters the backbone: the values supplied by the input heads, the layout of the sequence, the mode token, and the conditioning (t,c)(t,c). The class label is null in both encoding and decoding, so the layout, the mode token, and the timestep must keep the modes apart. We set each by a single principle.
Position alignment. In UNITE and UNITE++, the latent occupies its own group of readout tokens (Table 1), so pixels and latents interact only through attention: encoding must route the content of every image location into latent readouts with no fixed spatial correspondence, and in UNITE++ decoding must route it back out to the pixel readouts. The backbone thus learns this routing on top of encoding and decoding themselves. UNIFIED instead aligns the sequences of all three modes: the pixel patch, latent token, and noised latent token share one sequence index and one RoPE position. This leaves attention to model context rather than to move content between pixels and latents. Alignment comes at a cost. Readouts decouple the latent length KK from the number of patches, as in Perceiver-style readouts (Jaegle et al., 2022), while alignment ties K=NK=N. In exchange, each encoding or decoding pass has length N+1N+1 instead of 1+K+N1+K+N.
Encoding timestep. The timestep is the backbone’s explicit signal of how much of the content at its output positions is observed: t=0t=0 marks pure noise and t=1t=1 a clean latent. We set it in every mode to match that content. The generation pass reads ztz_{t} and uses the sampled tt. For the encoding pass, what the output positions hold depends on the layout. In UNITE and UNITE++, they hold 𝒩(0,I)\mathcal{N}(0,I) latent readouts, the same input from which sampling starts, so the matched choice is the noisy endpoint, tenc=0t_{\mathrm{enc}}=0: encoding is generation from noise, conditioned on the image through attention. Under position alignment, the same positions hold the observed image patches, so the matched choice becomes the clean endpoint, tenc=1t_{\mathrm{enc}}=1.
Decoding timestep. Decoding reads a clean latent, so the principle above would set tdec=1t_{\mathrm{dec}}=1. At the clean endpoint, however, the modes disagree on what to output: encoding and generation return the clean latent, whereas decoding returns pixels. The conflict is sharpest at the end of sampling. There the generation input zt≈zz_{t}\approx z enters through the same head PzinP_{z}^{\mathrm{in}} as the decoding input, and in the unconditional branch of classifier-free guidance both passes also carry the null label, so their AdaLN conditioning is identical and only the mode token, acting through attention, tells them apart. The conflict surfaces in the last blocks near t=1t=1, where the two passes must diverge into different output spaces. We resolve it by conditioning decoding on its own learned embedding in place of the timestep embedding, denoted as tdec=−1t_{\mathrm{dec}}=-1 for timestep outside the flow interval.
Mode token. A learned mode token at position 00 tells the backbone which pass it is running. It enters as a prefix token rather than through AdaLN or mode-specific blocks, so it adds no per-block parameters and every block stays fully shared.
3.4 Single-stage training and inference
Each training step runs the three passes of Section 3.2 on a batch of images. The encoding pass produces z=Eθ(x)z=E_{\theta}(x). The latent is perturbed before reconstruction, z~=z+σrecϵr\tilde{z}=z+\sigma_{\mathrm{rec}}\epsilon_{r} with ϵr∼𝒩(0,I)\epsilon_{r}\sim\mathcal{N}(0,I), which makes the decoding mode robust. The decoding pass reconstructs x^=Dθ(z~)\hat{x}=D_{\theta}(\tilde{z}) under
ℒrec=𝔼x,ϵr[∥x^−x∥1+λpercLPIPS(x^,x)],\mathcal{L}_{\mathrm{rec}}=\mathbb{E}_{x,\epsilon_{r}}\!\left[\lVert\hat{x}-x\rVert_{1}+\lambda_{\mathrm{perc}}\,\mathrm{LPIPS}(\hat{x},x)\right], (8)
where LPIPS is the perceptual distance (Zhang et al., 2018). The generation pass predicts the clean latent directly from the noised latent ztz_{t}:
ℒgen=𝔼x,t,ϵ[‖Gθ(sg(zt),t,c)−sg(z)‖22],\mathcal{L}_{\mathrm{gen}}=\mathbb{E}_{x,t,\epsilon}\left[\left\lVert G_{\theta}\!\left(\operatorname{sg}(z_{t}),\,t,\,c\right)-\operatorname{sg}(z)\right\rVert_{2}^{2}\right], (9)
where sg(⋅)\operatorname{sg}(\cdot) is the stop-gradient operator, which treats its argument as a constant during backpropagation. The complete objective is
ℒ=λrecℒrec+λgenℒgen.\mathcal{L}=\lambda_{\mathrm{rec}}\mathcal{L}_{\mathrm{rec}}+\lambda_{\mathrm{gen}}\mathcal{L}_{\mathrm{gen}}. (10)
Gradient flow. As in UNITE, the stop-gradient keeps the generation loss from reaching the encoding pass through its target, but all three passes run through TθT_{\theta}, so both losses update the same weights.
Inference. Generation starts from Gaussian noise at t=0t=0 and integrates the learned flow over the full interval t∈[0,1]t\in[0,1] with repeated generation passes; classifier-free guidance is applied only for t∈[0.1,1]t\in[0.1,1]. A single decoding pass then maps the final latent to pixels. Every step runs the same network, switching only the mode token and conditioning. Appendix B gives the solver, time grid, and guidance settings of every experiment.
Table 2: Separate, UNITE, and UNIFIED at matched sizes on ImageNet-1K 256×256256\times 256, with best CFG. UNITE uses its best allocation at Tiny. tdec=1t_{\mathrm{dec}}{=}1: decoding at clean endpoint; tdec=−1t_{\mathrm{dec}}{=}{-1}: learned decoding timestep. gFID and IS: mean over five evaluation seeds (Table 14); †: single run. Full results in Table 13.
Size Method gFID ↓\downarrow IS ↑\uparrow rFID ↓\downarrow
Tiny UNITE (2:12{:}1) 3.00 272.4 1.27
UNIFIED (tdec=1t_{\mathrm{dec}}{=}1) 2.75 282.0 1.30
UNIFIED (tdec=−1t_{\mathrm{dec}}{=}{-1}) 2.78 280.1 1.75
Small Separate† 5.17 244.8 1.64
UNITE 2.76 283.9 1.13
UNIFIED (tdec=1t_{\mathrm{dec}}{=}1) 2.41 287.4 0.95
UNIFIED (tdec=−1t_{\mathrm{dec}}{=}{-1}) 2.43 295.9 1.04
Base Separate† 3.96 267.7 1.38
UNITE 2.23 282.1 1.41
UNIFIED (tdec=1t_{\mathrm{dec}}{=}1) 2.15 312.8 0.97
UNIFIED (tdec=−1t_{\mathrm{dec}}{=}{-1}) 2.08 314.4 0.95
Table 3: Timestep conditioning of encoding and decoding (Base, with CFG). tenct_{\mathrm{enc}}, tdect_{\mathrm{dec}}: timesteps of the encoding and decoding passes; tdec=−1t_{\mathrm{dec}}{=}{-1}: learned decoding timestep; –: not applicable. gFID and IS: mean over five evaluation seeds (Table 14); †: single run. Full results in Table 12.
Method tenct_{\mathrm{enc}} tdect_{\mathrm{dec}} gFID ↓\downarrow IS ↑\uparrow rFID ↓\downarrow
UNITE 00 – 2.23 282.1 1.41
UNITE++ 00 11 2.24 327.1 2.20
UNIFIED† 00 11 2.31 300.0 1.39
UNIFIED 11 11 2.15 312.8 0.97
UNIFIED 11 −1-1 2.08 314.4 0.95
4 Experiments
All ImageNet-1K ×256256\!\times\!256 models are trained for 200200 epochs, and each optimizer step combines one reconstruction step and 1212 flow-matching steps on the same batch into a single gradient update. Otherwise, we follow the training setup of UNITE (Duggal et al., 2026), and refer to Appendices A and B for more training and evaluation details.
4.1 Full unification improves generation at matched size
Table 3 compares three ways of spending a fixed parameter budget: separate networks, a shared generative encoder with a standalone decoder (UNITE), and one fully shared backbone (UNIFIED). Both UNIFIED variants improve gFID over UNITE at every size. The gain is largest when capacity is scarce (0.220.22 and 0.330.33 at Tiny and Small vs. 0.150.15 at Base), and Tiny UNIFIED nearly matches Small UNITE with about half the parameters (2.782.78 at 6262M vs. 2.762.76 at 117117M). This suggests that the shared backbone is more parameter-efficient than separate networks.
4.2 Comparison with pixel-space and latent diffusion models
Table 4: Class-conditional generation on ImageNet-1K 256×256256\times 256 with at most 250250M parameters. Models: generator (Gen.), pretrained autoencoder (AE), pretrained vision foundation model (VFM), or standalone decoder trained jointly with the generator (Dec.). No Aux. Info.: ✓ if training uses no auxiliary pretrained representation (e.g., DINOv2 features). Repr.: the space in which diffusion runs, namely a frozen pretrained latent (Fixed), pixels (Pixel), or a latent learned jointly with the generator (Dynamic). Params counts all networks used. ∗: UNITE trained under our protocol. UNITE∗ and UNIFIED: mean over five evaluation seeds. Larger models and all baselines: Table 10.
Scale Method Models
No Aux.
Info.
Repr. Epoch Params gFID ↓\downarrow IS ↑\uparrow
UNITE-T∗ Gen.+Dec. ✓ Dynamic 200 61M 3.00 272.4
≤{\leq}100M UNIFIED-T (Ours) Gen. ✓ Dynamic 200 62M 2.78 280.1
JiT-B/16 Gen. ✓ Pixel 600 131M 3.66 275.1
PixelREPA-B/16 Gen.+VFM Pixel 600 131M 3.17 284.6
JiT-B/16 + RG Gen. ✓ Pixel 600 131M 2.96 251.1
UNITE-S∗ Gen.+Dec. ✓ Dynamic 200 117M 2.76 283.9
100–150M UNIFIED-S (Ours) Gen. ✓ Dynamic 200 116M 2.43 295.9
PixelU-B/16 Gen.+VFM Pixel 600 164M 3.40 276.0
DSD Gen.+VFM Dynamic 50 205M 3.35 255.0
REPA-B Gen.+AE+VFM Fixed – 214M 2.15 268.3
UNITE-B∗ Gen.+Dec. ✓ Dynamic 200 217M 2.23 282.1
150–250M UNIFIED-B (Ours) Gen. ✓ Dynamic 200 215M 2.08 314.4
Table 4 compares UNIFIED with published class-conditional generators of at most 250250M parameters on ImageNet-1K 256×256256\times 256. Appendix D describes all baselines and extends the comparison to larger models (Table 10). In every parameter range, UNIFIED attains the lowest gFID without relying on a pretrained autoencoder or vision foundation model, although it is trained for only 200200 epochs, against 600600 for the pixel-space baselines. Even UNIFIED-T (6262M, 2.782.78) improves on every pixel-space baseline of 131131–164164M (2.962.96–3.663.66), including PixelREPA-B/16 and PixelU-B/16, which align to a pretrained vision encoder. At 100100–150150M, UNIFIED-S (116116M) reaches 2.432.43, against 2.962.96 for the best pixel-space model, JiT-B/16 with register guidance (RG). At 150150–250250M, UNIFIED-B (215215M) reaches 2.082.08 and the highest IS in the table (314.4314.4), improving on the end-to-end latent model DSD (3.353.35) and on two-stage REPA-B (2.152.15), which uses both a pretrained autoencoder and a vision foundation model. In the full comparison, every model with a lower gFID than UNIFIED-B uses at least 545545M parameters.
4.3 How are three tasks kept apart in shared weights?
Table 3 traces the model design path from UNITE to UNIFIED at Base level. Each step changes one factor: where the decoder lives, the sequence layout, the encoding timestep, and the decoding timestep.
Readout tokens. UNITE encodes from 𝒩(0,I)\mathcal{N}(0,I) readout tokens at tenc=0t_{\mathrm{enc}}=0. The natural way to fold its decoder into the backbone is UNITE++, which adds learnable readout tokens for the image and decodes at the clean endpoint, tdec=1t_{\mathrm{dec}}=1. UNITE++ generates on par with UNITE but reconstructs worst of all models (rFID 2.202.20 vs. 1.411.41). We attribute this to the readout design: every image location must be recovered by attending from readout tokens to latents that have no fixed spatial correspondence to it, an indirect route for dense decoding. UNITE++ keeps tenc=0t_{\mathrm{enc}}=0 because its encoder still reads 𝒩(0,I)\mathcal{N}(0,I) readouts: tenc=1t_{\mathrm{enc}}=1 would label pure noise as clean, so the encoding timestep can be varied only once the encoder reads image patches.
Position alignment. UNIFIED removes this detour by placing each pixel patch, latent, and noisy latent at the same sequence index. With the same timesteps as UNITE++ (tenc=0t_{\mathrm{enc}}=0, tdec=1t_{\mathrm{dec}}=1) and the same fully shared backbone, the layout is the only change: it improves rFID from 2.202.20 to 1.391.39, but its gFID is worse (2.312.31). We attribute this to a mismatch between the encoder’s input and its timestep. The timestep tells the backbone how much of its input is observed: t=0t=0 means pure noise. In UNITE++, the encoder reads 𝒩(0,I)\mathcal{N}(0,I) readout tokens, so tenc=0t_{\mathrm{enc}}=0 describes its input correctly. In UNIFIED, the encoder instead reads clean image patches, yet tenc=0t_{\mathrm{enc}}=0 still labels them as pure noise, so the backbone receives the same conditioning for a fully observed image as for the pure-noise input at the start of generation.
Clean endpoint for encoding. Encoding and decoding are both deterministic maps from fully observed inputs, so both naturally belong at the clean endpoint. Changing only the encoding timestep to tenc=1t_{\mathrm{enc}}=1, with the layout and tdec=1t_{\mathrm{dec}}=1 fixed, improves gFID from 2.312.31 to 2.152.15 and rFID from 1.391.39 to 0.970.97, now better than UNITE on both.
Figure 3: Layer-wise CKA between the encoding and generation passes. Following UNITE (Duggal et al., 2026), we record each block’s activations while encoding an image and while running the generation pass on its encoded latent corrupted to level tt (t=1t=1 clean); each panel reports CKA (Kornblith et al., 2019) at one tt.
CKA analysis. Following UNITE, we compare what the shared backbone computes when encoding and when generating with layer-wise CKA (Figure 3). Section 3.3 predicts that position alignment lets the encoding pass track the generation pass from the early blocks, and the CKA is consistent with this: both UNIFIED variants reach 0.480.48–0.720.72 in blocks 11–55 at every tt, whereas UNITE and UNITE++ stay at or below 0.150.15. Their encoders start from 𝒩(0,I)\mathcal{N}(0,I) readout tokens, which carry no image information until attention writes it in, so they align only in the last blocks (0.840.84–0.920.92 for UNITE). The one exception is the last block near the clean endpoint. At t=0.995t=0.995, its CKA drops in both models that decode at t=1t=1, whatever their layout (0.370.37 for UNIFIED with tenc=tdec=1t_{\mathrm{enc}}=t_{\mathrm{dec}}=1 and 0.580.58 for UNITE++), but stays at 0.920.92 for UNITE, whose decoder is a separate network. We attribute this to the output conflict at the shared endpoint: encoding and generation output the clean latent, whereas decoding outputs pixel features, and near t=1t=1 the generation input is nearly identical to the decoding input, so the last block must serve both output spaces. We use CKA only to locate where the two passes diverge, while the effect of each design choice on generation is measured by the ablations in Table 3.
Learned decoding timestep. We therefore condition decoding on its own learned timestep, tdec=−1t_{\mathrm{dec}}=-1. This removes the drop, keeping the last-block CKA at 0.920.92–0.930.93 from t=0.9t=0.9 to 0.9950.995, on par with UNITE, and gives the best gFID and rFID at Base (2.082.08 and 0.950.95).
4.4 Generation quality across training and sampling budgets
Figure 4: Generation quality across training and sampling budgets. Base models (∼215{\sim}215M) on ImageNet-1K 256×256256\times 256, with CFG. Training budget: adaptive dopri5 solver over [0,1][0,1], epoch-4040 to 200200 checkpoints; epoch 200200 (five evaluation seeds) and the UNIFIED (tdec=−1t_{\mathrm{dec}}{=}{-1}) checkpoints of Table 9 are means over multiple evaluation seeds, other checkpoints are single runs. Sampling budget: epoch-200200 checkpoints, fixed-step Euler solver over [0,1][0,1] on the shifted time grid of Appendix B; sampling FLOPs per image == NFE ×\times one flow-matching forward pass. Small and Tiny: Figure 6.
Figure 4 varies the training and sampling budgets at Base. UNIFIED (tdec=−1t_{\mathrm{dec}}{=}{-1}) has a lower gFID than UNITE at every training checkpoint (2.082.08 vs. 2.232.23 at epoch 200200), as it does at Small and Tiny (Figure 6). Per training FLOP, UNITE is ahead early, but UNIFIED at 120120 epochs already matches UNITE’s final gFID (2.222.22 vs. 2.232.23) with about 10%10\% less compute (Table 9). At sampling time, UNIFIED improves on both UNITE and UNITE++ from 3232 NFE to 256256 NFE, whereas UNITE++ is best at 1616 NFE, suggesting that its separate readout pathway may help under coarser steps. UNIFIED at 6464 NFE (2.232.23) already surpasses both at 256256 NFE (2.282.28 for both), with fewer sampling FLOPs (5.25.2 vs. 12.812.8 TFLOPs per image for UNITE). More generally, at matched quality, UNIFIED needs fewer sampling FLOPs than UNITE for any target gFID of 2.502.50 or better; UNITE is cheaper
Images from the source





