arXiv:2610.22885cs.LGOct 2026

Manuscript Offprint

arXiv:2610.22885

Learning to Be Guided: Shaping Latent Geometry for Classifier-Free Guidance

Haoming Liu, Junhao Zhu, Shaoyi Zheng, Yuanhe Guo, Jinnuo Liu, Shenji Wan, Hongyi Wen

ABSTRACT

Classifier-free guidance (CFG) is a standard component of conditional diffusion models, and guided generation performance has become the de facto measure of state-of-the-art models. Recent work on latent diffusion models seeks to learn latent spaces that are easier to model with diffusion. However, under CFG, generation additionally depends on how conditions are arranged in the latent space. We study this arrangement under discrete class conditions, termed class geometry, and investigate what class geometry allows a latent space to work well with CFG. Under a Gaussian class model, we show that shifting variance from intra- to inter-class at fixed total variance makes classes more distinguishable under noise, and derive a noisy posterior objective whose per-sample descent direction is proportional to the oracle CFG correction. Based on the analysis, we propose Prototype Regularization (PR), a lightweight surrogate for the intractable noisy posterior objective, which applies a cosine prototype classifier to spatially pooled latents. With a controlled training budget (20 epochs for VAE, 80 epochs for DiT), adding PR to an LDM baseline reduces guided gFID on ImageNet from 3.31 to 2.28, surpassing a DINOv3-aligned VA-VAE (2.44) with negligible overhead. We further demonstrate that PR generalizes to pseudo-labels derived from clustering, continuous text-embedding conditions, and video latents. Together, our findings highlight class geometry as a critical factor in guided generation and take a first step toward CFG-compatible representation learning. Our project page is available at: https://maps-research.github.io/cfg-geometry/.

1 INTRODUCTION

Diffusion models (Ho et al., 2020; Song et al., 2021; Lipman et al., 2023) have become a predominant paradigm in generative modeling, with recent advances largely driven by conditional generation on auxiliary signals such as class labels and text (Rombach et al., 2022; Esser et al., 2024). Classifier-free guidance (CFG) (Ho & Salimans, 2021) is a standard technique for strengthening the conditioning: during sampling, a single model makes conditional and unconditional predictions, and their displacement (i.e., the CFG correction) is amplified by a guidance scale ω>1\omega > 1. CFG improves generation quality and has become a crucial component of state-of-the-art models: headline results are generally reported under CFG, usually with a large margin over unguided sampling. Consequently, guided performance has become the de facto measure of a conditional diffusion model.

In parallel, latent diffusion models (LDMs) (Rombach et al., 2022) have become the prevailing approach for generating high-dimensional data: an autoencoder first compresses data into a compact latent space, and a diffusion model is then trained in this latent space. A growing line of research designs latent spaces that are easier to model, either by aligning latents with pretrained representations (Yao et al., 2025; Leng et al., 2025) or by adopting pretrained representations directly as the latent space (Zheng et al., 2026; Shi et al., 2026), while another line of analysis studies which properties of a latent space make it easier for diffusion models to learn (Skorokhodov et al., 2025; Zhong et al., 2026; Liu et al., 2026). These efforts primarily approach latent design through the lens of diffusability, i.e., how easily a diffusion model learns the latent distribution. Under CFG,

*Equal contribution. Correspondence to: {haoming.liu, hongyi.wen}@nyu.edu.

however, the guided score for a condition cc takes the form ∇ztlog⁡pt(zt)+ω∇ztlog⁡pt(c∣zt)\nabla_{z_t} \log p_t(z_t) + \omega \nabla_{z_t} \log p_t(c \mid z_t), where the second term introduces a condition-dependent correction into the sampling dynamics. Hence, diffusability alone does not fully capture how a latent space interacts with guidance.

Intuitively, the correction term ∇ztlog⁡pt(c∣zt)\nabla_{z_t} \log p_t(c \mid z_t) pushes ztz_t toward regions where cc is more probable, and this push is shaped by how latents of different conditions are arranged relative to one another. More precisely, since pt(c∣zt)p_t(c \mid z_t) is evaluated on noisy latents, what matters is how distinguishable this arrangement remains under noise corruption. To characterize this arrangement more explicitly, we ground our analysis in discrete class conditions, where it reduces to the layout of classes, termed class geometry. We thus ask: what class geometry allows a latent space to work well with CFG?

We address this question by analyzing the CFG correction term through the lens of class geometry (Sec. 2). Specifically, under a Gaussian class model, we derive the oracle CFG correction in closed form: it contrasts the target class mean against competing class means, weighted by their noisy posteriors. We then show that, at fixed total variance, reallocating variance from intra-class to inter-class makes classes more distinguishable under noise, so the target class posterior concentrates earlier in denoising. Finally, we express this geometric preference as a cross-entropy objective on the noisy class posterior, whose per-sample descent direction is proportional to the oracle correction.

Guided by our analysis, we propose Prototype Regularization (PR), a tractable surrogate for the posterior objective on clean latents (Sec. 3). In practice, PR applies a cosine prototype classifier to spatially pooled latents, and we show that its gradient forms a target-versus-competitor contrast analogous to that in the oracle CFG correction. On ImageNet class-conditional generation, adding PR to an LDM baseline reduces guided gFID from 3.31 to 2.28, outperforming DINOv3-aligned (Siméoni et al., 2025) VA-VAE (2.44) (Yao et al., 2025) with negligible overhead (Sec. 4.2).

To isolate the source of this gain, we transplant PR class centers into LDM latents and recover most of PR's guided improvement, indicating that the gain stems largely from class geometry (Sec. 4.3). We further demonstrate the versatility of PR through extensions to pseudo-labels, video latents, and continuous text conditions (Sec. 4.4, 4.5, 4.6). Since PR relies only on discrete partitions to promote a cluster geometry, these results suggest that it applies beyond ground-truth labels whenever this geometry stays informative under noise. Together, our work highlights class geometry as a critical factor in guided generation and takes a first step toward CFG-compatible representation learning.

Our contributions are threefold:

• We analyze CFG through the lens of class geometry. Under a Gaussian class model, we derive the closed-form oracle correction, show that shifting variance from intra- to inter-class at fixed total variance improves class distinguishability under noise, and formulate a noisy posterior objective whose per-sample descent direction is proportional to this correction.

• We propose Prototype Regularization (PR), a lightweight surrogate for the noisy posterior objective that shapes class geometry. By classifying clean latents against prototypes, PR yields gradients analogous to the target-versus-competitor contrast in the oracle correction.

• We show that PR generalizes across label sources, modalities, and condition types, suggesting its effectiveness as a CFG-compatible geometry regularizer over discrete partitions.

References (47)