Single-Transformer Latent Diffusion
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 256x256 at matched parameters, UNIFIED improves gFID over UNITE at three sizes (~60M, ~115M, and ~215M) and reaches 2.08 with 215M parameters, the lowest among compared models under 250M parameters. On text-to-image generation, UNIFIED-B (218M) reaches a GenEval score of 0.87 at 512x512, exceeding single-stage pixel diffusion models with around one billion parameters. Full unification of latent diffusion is thus not merely feasible but beneficial.
Paper Prompts
Sign up for free to create and run prompts on this paper.
Explain it Like I'm 14
1. What is this paper about?
This paper introduces UNIFIED, an artificial intelligence system that can create images using only one main neural network, called a transformer.
Most image-generation systems use three separate networks:
- An encoder, which turns an image into a smaller, simpler description called a latent.
- A generator, which creates or improves latent descriptions from random noise.
- A decoder, which turns the latent description back into a normal image.
The researchers ask whether all three jobs can be done by the same transformer. Their answer is yes—but only if the transformer is carefully designed so that it knows which job it is doing.
2. What questions did the researchers study?
The main questions were:
- Can one network successfully understand images, generate new images, and turn internal representations back into pictures?
- Can this single network perform as well as or better than systems using several networks?
- What design helps the network avoid confusing its different jobs?
- Can the model create good images without using a pretrained image encoder or a separately trained autoencoder?
- Can the same idea work for text-to-image generation, where a written description is turned into a picture?
The researchers especially focused on how the network should organize information so that it does not mix up pixels and latent values.
3. How did they do it?
Latents: smaller descriptions of images
An image contains a huge amount of information. Instead of working directly with every pixel, the system changes the image into a shorter description called a latent representation.
You can think of a latent as a compressed recipe for an image. It does not look like a picture to us, but it contains enough information to rebuild one.
Diffusion and flow matching
The model learns to create images by starting with random noise and gradually turning it into meaningful information.
This is similar to watching a blurry, noisy picture slowly become clear. In this paper, the model learns a path from random noise to a clean latent. This process is called flow matching.
During training, the researchers:
- Give the model a real image and ask it to encode the image into a latent.
- Add different amounts of noise to the latent and ask the model to recover the clean latent.
- Give the model the latent and ask it to reconstruct the original image.
The model is trained using two main goals:
- Reconstruction loss: make the rebuilt image look like the original.
- Generation loss: make the predicted clean latent match the correct latent.
The researchers also use a technique called stop-gradient. In everyday terms, this means that one part of the learning process is temporarily prevented from changing another part in an unhelpful way. This helps stop the model from taking an easy shortcut in which all images receive nearly meaningless latent descriptions.
Giving the network different modes
Although the same transformer is used for all three tasks, it needs to know which task it should perform. UNIFIED tells it this in two ways:
- A special mode token says whether it should encode, generate, or decode.
- A timestep tells it how noisy or clean the input is.
This is like giving the same student three different instructions:
- “Summarize this picture.”
- “Turn this noisy description into a clear one.”
- “Draw the picture described by this code.”
Position alignment
A particularly important idea is called position alignment.
The image is divided into patches, or small squares. UNIFIED makes sure that a particular position in the sequence always refers to the same area of the image:
- An image patch at one position becomes the latent for that same position.
- During generation, the noisy latent at that position still represents the same image area.
- During decoding, that latent becomes the pixels for that area again.
This is like putting labels on boxes. If the box labeled “top-left corner” always contains information about the top-left corner, the model does not need to spend extra effort figuring out where the information belongs.
A special setting for decoding
The researchers found that decoding caused a problem. Near the end of generation, the model has to use similar information for two different purposes:
- Producing a clean latent.
- Producing pixels.
To separate these jobs, they gave decoding its own learned timestep, written as . This is not a real noise level; it is simply a special signal meaning “you are decoding now.”
4. What did they find?
UNIFIED produced better images than earlier shared models
The researchers compared UNIFIED with:
- Traditional systems using separate networks.
- UNITE, which combines the encoder and generator but still uses a separate decoder.
- UNITE++, a straightforward attempt to share all three jobs without changing the data layout.
UNIFIED performed better than UNITE at three different model sizes. On ImageNet images sized , the largest UNIFIED model achieved a gFID of 2.08 with about 215 million parameters.
The gFID score measures how similar generated images are to real images. Lower is better.
For comparison:
- UNITE at a similar size achieved a gFID of 2.23.
- UNIFIED was also better than many larger pixel-based models.
- A small UNIFIED model with about 62 million parameters nearly matched a UNITE model with about 117 million parameters.
This suggests that sharing the main transformer uses the available parameters more efficiently.
The design details mattered
Simply forcing one network to perform all three tasks did not work well. The UNITE++ version had weaker reconstruction quality.
The experiments showed that performance improved when the researchers:
- Matched the positions of image patches and latent tokens.
- Used a clean timestep for encoding clean images.
- Gave decoding its own special timestep.
The model’s improvement was therefore not just because it had fewer networks. Its success depended on carefully explaining to the shared network what each input and output meant.
Strong text-to-image results
The researchers also tested UNIFIED on text-to-image generation.
For example, a text prompt might ask for:
“A panda bear wearing aviator glasses.”
At resolution, a UNIFIED model with about 218 million parameters achieved a GenEval score of 0.87.
GenEval measures how well an image follows the objects and relationships described in a text prompt. Higher is better.
The paper reports that this result was better than several single-stage pixel-based models with around one billion parameters. This suggests that working in a learned latent space can make image generation more efficient.
5. Why is this important?
The paper suggests that image-generation systems do not necessarily need three large networks trained in separate stages. Instead, one shared transformer may be able to do everything:
- Understand an image.
- Represent it in a compact form.
- Generate new representations from noise.
- Turn those representations into pictures.
This could make future systems:
- Smaller, because fewer separate networks are needed.
- Simpler to train, because the model can be trained in one stage.
- More efficient, because most parameters are shared.
- Less dependent on outside tools, such as pretrained image encoders or autoencoders.
The work also teaches a broader lesson: when one AI model performs several tasks, it is not enough to simply share all its weights. The model must receive clear signals about which task it is performing, and related information should be kept in matching positions.
Simple conclusion
UNIFIED is like a single highly trained artist who can read a picture, imagine a new one, and draw the final result. Earlier systems gave each of these jobs to a different specialist. This paper shows that one specialist can do all three jobs—and sometimes do them better—if the instructions and organization are designed carefully.
The results could lead to image generators that use fewer resources while still producing high-quality images from pictures, labels, or written descriptions.
Practical Applications
Immediate Applications
The paper’s results support near-term use of UNIFIED-like architectures as efficient image-generation and image-reconstruction components, especially where reducing model count, memory use, or deployment complexity is valuable. These applications assume access to the model implementation, suitable training data, and validation beyond the reported ImageNet and text-to-image benchmarks.
- Compact text-to-image generation for creative software (software, media, design)
Deploy a UNIFIED-B–scale model as an image-generation engine for thumbnails, concept art, advertising drafts, social-media graphics, game assets, and presentation illustrations. Its reported
218Mparameters and strong512×512GenEval result (0.87) suggest that useful text-to-image generation may be possible with substantially less model capacity than approximately billion-parameter pixel-diffusion systems. Dependencies: access to a text encoder or equivalent conditioning mechanism, sufficient GPU/accelerator memory, an efficient flow solver, content-safety filtering, and licensing-compliant training data. - On-device or edge image generation (mobile computing, laptops, embedded systems) Quantized or distilled variants could provide offline image synthesis on workstations, creative laptops, mobile devices, or edge servers. The shared backbone reduces the need to store and execute separate encoder, generator, and decoder networks, potentially simplifying memory management and model packaging. Dependencies: quantization must preserve reconstruction and generation quality; inference latency, energy consumption, and performance on non-GPU hardware were not evaluated in the paper.
- Unified image compression and generative reconstruction (imaging, cloud storage, telecommunications) Use the encoding mode to convert an image into a compact latent representation and the decoding mode to reconstruct it. This could support learned image codecs, thumbnail generation, bandwidth-aware image delivery, or cloud-side reconstruction. The position-aligned latent representation is particularly compatible with patch-based image transmission and spatially localized processing. Dependencies: the paper demonstrates reconstruction quality rather than rate–distortion performance. A practical codec would require explicit bitrate control, entropy coding, robustness to packet loss, and evaluation on diverse image types.
- Single-model image editing and variation workflows (design tools, photography, e-commerce) The latent space could serve as an intermediate representation for image variations, conditional editing, inpainting-like workflows, style changes, or controlled generation. A product could encode an existing image, modify or interpolate its latent, and decode the result using the same backbone. Dependencies: the paper does not directly demonstrate editing, semantic latent control, inversion accuracy, or preservation of identity and fine details. Editing interfaces would require additional conditioning, masking, or optimization procedures.
- Efficient class-conditional synthetic-data generation (academia, computer vision, robotics, retail analytics) Organizations could generate labeled image datasets for prototyping classifiers, object-recognition systems, or visual inspection pipelines. The ImageNet experiments indicate that the architecture can generate class-conditioned images efficiently at moderate parameter counts. Dependencies: synthetic images must be checked for diversity, label correctness, bias, and distribution shift. Generated data should not automatically be treated as a substitute for real-world samples.
- Simplified generative-model training pipelines (ML engineering, research infrastructure) Engineering teams can replace a conventional three-network latent-diffusion stack with one shared transformer plus lightweight mode-specific heads. This may reduce checkpoint management, synchronization overhead, deployment interfaces, and capacity-allocation decisions between autoencoder and generator networks. Dependencies: the method requires careful implementation of position alignment, mode tokens, mode-specific input/output heads, stop-gradient targets, and separate encoding and decoding timestep conditioning. Naive weight sharing, such as the reported UNITE++ configuration, may substantially degrade reconstruction.
- Lower-cost academic experimentation with latent diffusion (academic research and teaching) Researchers can use UNIFIED as a baseline for studying jointly learned latent spaces, flow matching, multi-mode transformers, and representation sharing without pretrained autoencoders or vision foundation models. Its single-stage objective also makes ablations easier to interpret than a pipeline with separately pretrained components. Dependencies: results were primarily reported on ImageNet-1K and selected text-to-image datasets. Independent reproduction is needed to establish performance across resolutions, domains, and training scales.
- Policy and public-sector prototyping of generative imaging systems (government, education, public communication) Public institutions could use smaller models for internal prototyping of maps, educational illustrations, museum visualizations, or scenario images without depending on externally hosted billion-parameter services. Local deployment may improve data governance for sensitive prompts and source images. Dependencies: local deployment does not eliminate risks of misinformation, copyright infringement, demographic bias, or unsafe content. Procurement would require provenance tracking, auditing, and human review.
- Reduced operational complexity in production inference (cloud services, MLOps)
A unified model can expose a consistent inference service with three operations:
encode(image),generate(noise, condition), anddecode(latent). This supports shared batching, common accelerator kernels, and simpler versioning compared with separate networks. Dependencies: the practical savings depend on whether inference workloads actually share hardware and whether the backbone’s repeated diffusion passes dominate total cost. The paper does not provide comprehensive latency, throughput, or serving-cost measurements.
Long-Term Applications
The following applications are plausible extensions of the paper’s findings but require additional research, scaling, or product development before dependable deployment.
- General-purpose multimodal generation and understanding (AI assistants, education, enterprise software) The mode-token principle could be extended beyond image encoding, generation, and decoding to a single model handling images, text, video, audio, and structured data. A future system might accept an image for analysis, produce a latent representation, generate a revised image, and explain the changes through text. Dependencies: modality-specific alignment, tokenization, conditioning, safety controls, and training objectives are still required. Sharing one backbone may create conflicts between modalities analogous to the encoding–decoding conflict observed in the paper.
- Video generation and video compression (film, gaming, robotics, telepresence) Position-aligned latent tokens could be extended across spatial and temporal coordinates, enabling a shared model for video encoding, temporal generation, and frame decoding. Potential products include low-bandwidth video communication, synthetic training videos, and interactive scene generation. Dependencies: temporal consistency, much higher compute and memory requirements, controllable motion, long-context modeling, and reliable rate–distortion optimization must be addressed. Image-level results do not establish video quality.
- Robotics perception-to-imagination pipelines (robotics, autonomous systems) A unified transformer could encode camera observations into compact latents, model likely future visual states, and decode predicted states for planning or simulation. This could support visual world models, imitation learning, and synthetic robot-training environments. Dependencies: the current work uses static images and class/text conditioning, not actions, depth, force, or proprioception. Safety-critical robotics would require calibrated uncertainty, real-time inference, closed-loop evaluation, and resistance to distribution shift.
- Medical-image reconstruction and synthesis (healthcare) The architecture could be adapted for modalities such as MRI, CT, ultrasound, pathology, or radiography to provide compressed representations, missing-scan reconstruction, synthetic training data, or image-quality enhancement. A shared encoder–generator–decoder could potentially learn a representation jointly optimized for reconstruction and generative plausibility. Dependencies: clinical validation, patient privacy, modality-specific physics, uncertainty estimation, artifact detection, regulatory approval, and safeguards against hallucinated anatomy are essential. The paper provides no medical-domain evidence.
- Scientific and industrial imaging workflows (energy, manufacturing, climate science) Future versions could encode satellite imagery, microscopy, materials scans, or industrial inspection images, then generate plausible completions or augment scarce datasets. Shared latent representations may reduce the cost of domain-specific generative systems. Dependencies: scientific fidelity is stricter than perceptual similarity. Models must preserve measurements, support uncertainty quantification, and avoid generating physically impossible structures.
- Interactive 3D and game-content generation (gaming, simulation, virtual reality) Spatially aligned latent modeling could be generalized to multi-view images, depth maps, or 3D tokens. A single transformer might encode assets, generate new scenes, and decode views or textures, supporting rapid content creation and simulation. Dependencies: enforcing geometric consistency across views, integrating meshes and materials, and meeting real-time rendering requirements require substantial architectural development.
- Energy-efficient foundation models for generative imaging (green computing, data centers) The reported parameter efficiency and lower sampling cost at matched quality suggest a pathway toward reducing training and inference energy. A production system could combine shared weights with distillation, fewer-step flow solvers, sparsity, and accelerator-specific kernels. Dependencies: the energy advantage remains an inference from parameter and sampling comparisons, not a complete carbon or power analysis. End-to-end measurements must include training, memory traffic, text encoding, and hardware utilization.
- Adaptive latent representations for downstream vision tasks (computer vision, finance, retail, security) Because the latent is learned jointly with reconstruction and generation, future studies could test whether it is useful for classification, retrieval, anomaly detection, forecasting, or image-based risk assessment. One model might generate samples while also supplying representations for downstream analytics. Dependencies: generative usefulness does not guarantee discriminative usefulness. Task-specific evaluation, privacy analysis, fairness testing, and resistance to adversarial or out-of-distribution inputs are necessary.
- Privacy-preserving image transformation and local inference (healthcare, finance, personal computing) An encoder could convert sensitive images into a compact representation for local processing or controlled transmission, while a decoder reconstructs them only in an authorized environment. This may reduce exposure of raw images in cloud workflows. Dependencies: latent representations may retain personally identifiable or sensitive information and should not be assumed private. Formal privacy guarantees, leakage testing, access control, and secure deployment are required.
- Policy standards for efficient and auditable generative models (AI governance and regulation) The architecture provides a concrete case for evaluating whether smaller unified models can meet quality targets with lower compute and fewer external dependencies. Policymakers and standards bodies could require reporting of parameter count, training data, auxiliary pretrained models, sampling cost, reconstruction fidelity, and safety performance. Dependencies: benchmarks such as gFID and GenEval do not measure factuality, provenance, bias, or social impact. Broader standardized evaluations would be needed before using the results to guide procurement or regulation.
- Autonomous model allocation and continual adaptation (enterprise AI, personalized systems) The single-backbone design may eventually support dynamically allocating capacity among encoding, generation, and decoding based on workload—for example, prioritizing reconstruction for an imaging application or generation for a design application. Continual fine-tuning could adapt all three modes jointly to a new domain. Dependencies: joint adaptation may cause catastrophic interference between modes. Robust continual-learning methods, modular adapters, domain-specific safeguards, and monitoring would be required.
Glossary
- AdaLN (Adaptive Layer Normalization): A normalization method whose parameters are conditioned on external signals such as timestep and class label. “the timestep and class label reach every block through AdaLN”
- Adversarial loss: A loss produced by a discriminator to encourage generated outputs to resemble real data. “without adversarial losses”
- Autoencoder: A model that encodes data into a representation and decodes it back for reconstruction. “an autoencoder is first trained for reconstruction”
- Classifier-free guidance (CFG): A sampling technique that strengthens conditional generation by combining conditional and unconditional predictions. “classifier-free guidance is applied only for ”
- CKA (Centered Kernel Alignment): A similarity measure used to compare internal representations or activations of neural networks. “we compare what the shared backbone computes when encoding and when generating with layer-wise CKA”
- DINO: A self-supervised vision representation-learning model used as a pretrained visual encoder. “without adversarial losses or pretrained encoders (e.g., DINO)”
- Diffusion transformer (DiT): A transformer architecture adapted to predict or model diffusion processes. “a single diffusion transformer ”
- DPG-Bench: A benchmark for evaluating the alignment of text-to-image generation with detailed prompts. “UNIFIED-B ($218$M) reaches $0.87$ on GenEval and $0.827$ on DPG-Bench”
- EMA (Exponential Moving Average): A parameter-averaging technique commonly used to stabilize neural-network evaluation. “including the learning rate schedule, optimizer, EMA decay, gradient clipping, and sampler”
- Flow matching: A generative-training objective that learns a vector field connecting noise and data distributions. “with only reconstruction and flow-matching losses”
- gFID (generative Fréchet Inception Distance): A distributional metric for measuring the similarity between generated and real images; lower is better. “UNIFIED improves gFID over UNITE at every size”
- GenAI-Bench: A benchmark for assessing the quality of generated images from text prompts. “UNIFIED-L ($554$M) improves on pixel-space JiT ($615$M) on all three benchmarks”
- GenEval: An evaluation benchmark measuring text-to-image generation quality and prompt adherence. “UNIFIED-B ($218$M) reaches a GenEval score of $0.87$”
- Gradient clipping: A technique that limits gradient magnitudes to improve optimization stability. “including the learning rate schedule, optimizer, EMA decay, gradient clipping, and sampler”
- Gradient flow: The propagation of derivatives through a computational graph during backpropagation. “The stop-gradient keeps the generation loss from reaching the encoding pass through its target”
- Latent collapse: A failure mode in which a learned latent representation becomes trivial and carries insufficient information. “The central difficulty is latent collapse”
- Latent diffusion: Diffusion modeling performed in a learned lower-dimensional representation rather than directly in pixel space. “Latent diffusion models~\citep{rombach2022high,peebles2023scalable,ma2024sit}”
- Latent readout: An auxiliary token whose output is used as a latent representation. “we call them latent readouts, since unlike the registers of~\citet{darcet2024vision}, whose outputs are discarded, their outputs are the latent”
- LPIPS (Learned Perceptual Image Patch Similarity): A learned perceptual metric for estimating visual similarity between images. “where LPIPS is the perceptual distance”
- Mode token: A learned token that indicates which function a shared network should perform. “A learned mode token at position~$0$ tells the backbone which pass it is running”
- Normalizing flow: An invertible neural transformation used to model complex probability distributions. “a score-based~\citep{vahdat2021score}, normalizing-flow~\citep{zhao2026simflow}, or diffusion”
- Perceptual loss: A loss comparing high-level visual features rather than only individual pixels. “The tokenizer is usually a KL-regularized VAE~\citep{kingma2013auto,rezende2014stochastic} for latent diffusion~\citep{rombach2022high,podell2024sdxl} or a vector-quantized autoencoder”
- Position alignment: A sequence-layout strategy in which corresponding pixels and latent tokens occupy the same sequence positions. “UNIFIED instead aligns the sequences of all three modes”
- Rectified flow: A flow-based generative formulation that interpolates between noise and data along a prescribed path. “a noised latent is formed by the rectified-flow interpolation”
- Register token: An auxiliary transformer token used to provide a location for information aggregation or processing. “UNITE calls these tokens registers”
- rFID (reconstruction Fréchet Inception Distance): A Fréchet Inception Distance computed between reconstructed and original images. “reconstructs markedly worse (rFID $2.20$ vs.\ $1.41$)”
- RoPE (Rotary Position Embedding): A positional encoding method that incorporates token positions by rotating query and key representations. “with RoPE~\citep{su2024roformer}”
- Score-based model: A generative model that estimates the score, or gradient of the log density, of a data distribution. “a score-based~\citep{vahdat2021score}, normalizing-flow~\citep{zhao2026simflow}, or diffusion”
- Self-supervised learning: Representation learning that creates training signals from the data itself rather than requiring manually labeled targets. “a pretrained vision encoder”
- Stop-gradient: An operator that prevents gradients from propagating through a specified tensor during backpropagation. “where is the stop-gradient operator, which treats its argument as a constant during backpropagation”
- Timestep embedding: A learned representation of the diffusion time or noise level used to condition a generative model. “which leaves to the two modes whose target is the clean latent”
- Tokenization: The conversion of an image or other input into a sequence of learned tokens. “It treats tokenization and generation as the same latent-inference problem”
- Variational bound: An optimization objective, often an evidence lower bound, used to train latent-variable probabilistic models. “Likelihood-based approaches keep a variational bound whose KL or entropy terms hold the latent in place”
- VAE (Variational Autoencoder): A probabilistic autoencoder that learns a distribution over latent representations, typically regularized with a KL-divergence term. “The tokenizer is usually a KL-regularized VAE”
- Vector-quantized autoencoder: An autoencoder whose continuous representations are mapped to entries in a discrete codebook. “or a vector-quantized autoencoder”
- Vision foundation model (VFM): A large pretrained vision model intended to provide general-purpose visual representations. “without a pretrained autoencoder or vision foundation model”
- VQGAN: A generative model combining vector quantization with adversarial and perceptual training objectives. “the perceptual~\citep{zhang2018unreasonable} and adversarial losses popularized by VQGAN”









