Probabilistic Transformers for Generative Models

Computer Vision Laboratory, Seoul National University
ProbFormer propagates token-level uncertainty without additional training to refine images and videos and generate diverse images.

Abstract

Transformers process information through deterministic token representations, leaving their associated uncertainty implicit. We introduce Probabilistic Transformers (ProbFormer), which explicitly represent and propagate token-level uncertainty without additional training. Each probabilistic token is modeled as a Gaussian centered at its original deterministic representation, with variance characterizing its uncertainty. We then analytically propagate this uncertainty through pretrained Transformer blocks as an auxiliary state while preserving the original deterministic operations. In visual generation, this propagated uncertainty enables fine-grained control across three tasks: image refinement, video refinement, and image diversification. Empirically, we observe that high-uncertainty regions closely align with visible artifacts, suggesting that token-level uncertainty faithfully captures localized instability. ProbFormer consistently outperforms state-of-the-art baselines across diverse benchmarks, confirming that its propagated uncertainty provides informative signals beyond deterministic features.

Introduction

  • A standard Transformer represents each token with a single feature vector, leaving uncertainty about that token’s response implicit.
  • ProbFormer represents each token as a Gaussian centered on its original feature and propagates its variance through the pretrained Transformer without additional training.
  • In visual generation, we use this uncertainty to refine unstable regions in images and videos and to generate diverse images from the same prompt.

Method

  • Initialize. Add independent noise to several copies of the current clean estimate and run them through the first few blocks. The variance across the resulting features gives each token its initial uncertainty.
  • Propagate. A first-order approximation carries diagonal variances through attention, normalization, and other operations. Each input variance contributes in proportion to the squared local derivative. The pretrained forward pass still supplies the Gaussian means.
  • Refine images or videos. Select the patches with the highest uncertainty. Add fresh noise to the clean estimate and denoise it again. Use the difference between the two estimates to correct only the selected patches, then resume sampling.
  • Diversify images. At a later block, sample a new feature for each token from its Gaussian distribution. Feature dimensions with higher uncertainty can vary more. The remaining blocks use these sampled features to generate the image.

Experimental Results

Image refinement

Image refinement aims to improve prompt adherence through corrections during generation. We refine Stable Diffusion 3 Medium (SD3) on OAO-AttackBench and WHOOPS! benchmark. The columns compare base SD3, IR-Guidance, BayesDiff, the uncertainty estimator of Jazbec et al., and ProbFormer.

Video refinement

Video refinement targets motion and physical interactions as a scene unfolds. We compare the original Wan2.2-T2V-A14B with CFG-Zero*, FlowMo, P&P, and ProbFormer. The paper evaluates 81-frame clips at 832 × 480 and 16 fps on Dynamic-bench.

Additional results

Base (Wan)
ProbFormer (Ours)
“A knife slices through a ripe tomato, separating a slice that falls flat onto the cutting board while juice spreads.”
Base (Wan)
ProbFormer (Ours)
“A diver performs a reverse 2.5 somersault from the 10-meter platform, entering the water with minimal splash.”
Base (Wan)
ProbFormer (Ours)
“A rubber ball bounces on a trampoline, depressing the surface deeply and launching higher with every bounce.”
Base (Wan)
ProbFormer (Ours)
“A hand tips a small jug and pours water into a clear glass on a table, then sets the jug down. A continuous close-up shot from a fixed camera.”

Image diversification

Image diversification aims to generate varied images that match the same prompt. We generate eight images per GenEval prompt with FLUX.1-dev and compare against base FLUX, Particle Guidance, SPELL, CNO, Group Inference, DAVE, Bhat et al., and BayesDiff.

Red boxes mark images that do not clearly depict the object named in the prompt.

Ablation study

Three image refinement variants isolate how the choice of uncertainty signal affects the correction mask.

  • Constant Initialization removes candidate-based uncertainty initialization, replacing the estimated variances in Eq. (10) with a fixed value while retaining uncertainty propagation.
  • Boundary Uncertainty removes uncertainty propagation and instead constructs refinement scores directly from the initialized token variances at the boundary Transformer block.
  • Empirical Output removes analytical uncertainty propagation and instead runs each re-noised candidate through the Transformer, estimating uncertainty from the variance across their output predictions.

Selected References

  1. Bhat et al., "Don't Settle at the Mode! Mitigating Diversity Collapse in Pretrained Flow Models via Feature Self-Guidance", ECCV 2026.
  2. Bitton-Guetta et al., "Breaking Common Sense: WHOOPS! A Vision-and-Language Benchmark of Synthetic and Compositional Images", ICCV 2023.
  3. Corso et al., "Particle Guidance: Non-I.I.D. Diverse Sampling with Diffusion Models", ICLR 2024.
  4. Esser et al., "Scaling Rectified Flow Transformers for High-Resolution Image Synthesis", ICML 2024.
  5. Fan et al., "CFG-Zero*: Improved Classifier-Free Guidance for Flow Matching Models", arXiv:2503.18886, 2025.
  6. Ghosh et al., "GenEval: An Object-Focused Framework for Evaluating Text-to-Image Alignment", NeurIPS Datasets and Benchmarks, 2023.
  7. Jang et al., "Self-Refining Video Sampling", ICML 2026.
  8. Jazbec et al., "Generative Uncertainty in Diffusion Models", UAI 2025.
  9. Kim et al., "Diverse Text-to-Image Generation via Contrastive Noise Optimization", ICLR 2026.
  10. Kirchhof et al., "Shielded Diffusion: Generating Novel and Diverse Images Using Sparse Repellency", ICML 2025.
  11. Kou et al., "BayesDiff: Estimating Pixel-wise Uncertainty in Diffusion via Bayesian Inference", ICLR 2024.
  12. Kwon et al., "Breaking the Lock-in: Diversifying Text-to-Image Generation via Representation Modulation", ICML 2026.
  13. Black Forest Labs, "FLUX", 2024.
  14. Oehlert, "A Note on the Delta Method", The American Statistician, 1992.
  15. Parmar et al., "Scaling Group Inference for Diverse and High-Quality Generation", ICLR 2026.
  16. Shaulov et al., "FlowMo: Variance-Based Flow Guidance for Coherent Motion in Video Generation", NeurIPS 2025.
  17. Team Wan et al., "Wan: Open and Advanced Large-Scale Video Generative Models", arXiv:2503.20314, 2025.
  18. Won et al., "Intermediate Text Representation Guided Text-to-Image Generation for Enhancing One-and-Only Alignment", ECCV 2026.