Internalizing Classifier-Free Guidance for Single-Pass Inference

32 concepts21 papers1 proposal

Classifier-Free Guidance (CFG) is the cornerstone of modern conditional generation. By trading off sample variety for prompt adherence, CFG allows diffusion and flow-matching models to generate images and videos that closely align with complex textual descriptions.

However, CFG comes with a severe computational penalty. At each denoising step, the model must evaluate two separate pathways: a conditional path (using the text prompt) and an unconditional path (using a null token). As noted in a comprehensive survey by Hui Shen et al., this dual-evaluation requirement effectively doubles the computational cost of inference. This overhead creates a fundamental bottleneck for real-time applications and conflicts directly with the goals of few-step or one-step generative modeling.

To resolve this tension, a new paradigm has emerged: guidance internalization (or guidance distillation). Instead of computing the difference between conditional and unconditional paths at runtime, these techniques bake the guidance logic directly into the model's weights during training or post-training. The result is a single-pass model capable of high-fidelity, prompt-aligned generation at twice the speed.


The Intuition: Modeling the Shifted Distribution

To understand why guidance internalization works, we must look at what CFG actually does to the score or velocity field. Standard conditional training teaches a model to approximate the score function of the data distribution, $\nabla_x \log p(x|c)$. At inference time, CFG extrapolates away from the unconditional score:

$$\epsilon_{\text{CFG}} = \epsilon(x_t, \emptyset) + w \cdot \big(\epsilon(x_t, c) - \epsilon(x_t, \emptyset)\big)$$

Where $w$ is the guidance scale. This formula creates a modified, "sharpened" vector field that pushes the generation trajectory toward regions of high conditional density.

Standard inference requires two forward passes because the model only knows how to compute $\epsilon(x_t, c)$ and $\epsilon(x_t, \emptyset)$ individually. However, neural networks are powerful function approximators. If we know the desired guidance scale $w$ ahead of time, we can redefine the model's target distribution during training to be the already-guided distribution. By training the network directly on this modified target, a single forward pass can natively output the guided trajectory.


Training-Integrated Guidance

One way to internalize guidance is to modify the training objective from scratch, bypassing the need for an explicit multi-pass teacher model.

Standard CFG (Inference-Time):
[Prompt c] ----> Model Pass 1 \
                               ===> Linear Combination ===> Guided Step
[Null ∅]   ----> Model Pass 2 /

Internalized Guidance (Training-Time Integrated):
[Prompt c] ----> Guided Model Weights ===> Guided Step (Single Pass)

In this category, Zhicong Tang et al. propose Model-Guidance (MG), which modifies the noise prediction target during training to include the difference between conditional and unconditional estimates. This allows the model to learn the guided distribution directly, cutting inference time in half and accelerating training convergence. Similarly, Huayu Chen et al. introduce Guidance-Free Training (GFT), demonstrating that a single model can successfully represent the shifted distribution typically produced by CFG without dual-path runtime evaluations.

This approach is particularly vital for one-step generative models, where performing multiple forward passes defeats the purpose of minimizing function evaluations. As Tianze Luo et al. observe in their work on Solution Flow Models (SoFlow), standard CFG creates a fundamental conflict for single-step generation. By blending conditional and unconditional velocity field estimates directly within the loss function, the authors enable their model to internalize conditional trajectories and produce guided samples in a single step. In a parallel vein, Zhengyang Geng et al. prove mathematically that CFG can be integrated directly into an average velocity field, enabling high-quality, single-evaluation conditional generation from scratch.


Post-Training and Knowledge Distillation

For large-scale, pre-trained models where retraining from scratch is prohibitively expensive, researchers use knowledge distillation to transfer guided behavior from a multi-pass "teacher" to a single-pass "student."

The student model is explicitly trained to minimize the discrepancy between its single forward pass and the combined CFG output of the teacher. For example, Clément Chadebec et al. introduce Flash Diffusion, which trains a student to predict outputs that incorporate the teacher's CFG effects, shrinking generation down to 1–4 steps without dual-inference overhead. To prevent the mode-collapse and sample-homogeneity common in distillation, Geoffrey Cideron et al. incorporate diversity rewards into the distillation objective, ensuring the single-pass student retains the visual variety of the teacher configuration.

This distillation framework is highly effective for specialized downstream tasks:

  • Fine-Tuning: Yara Bahram et al. inject domain-aware guidance signals directly into the fine-tuning loss function of their DogFit method, preserving high image fidelity and controllability in a single pass.
  • Interactive Video: In latency-critical applications like interactive video generation, Joonghyuk Shin et al. distill CFG directly into a student model's weights during the distillation phase, enabling real-time, steered video generation at high frame rates.

Guidance as an Implicit Reward

A distinct and mathematically elegant perspective treats CFG not merely as a vector field modification, but as an implicit reward function for alignment.

In text-to-image synthesis, maximizing prompt adherence can be viewed as a reinforcement learning problem where the prompt acts as the instruction. Weijian Luo et al. demonstrate that CFG mathematically functions as an implicit form of reinforcement learning from human feedback (RLHF), pushing the model toward higher prompt compliance. By treating this implicit reward as a training objective, the authors optimize small, one-step models to match or exceed the prompt-following capabilities of massive multi-step models (Weijian Luo et al.).

This reward-centric view extends naturally to other alignment frameworks:

  • Reinforcement Learning: Kaiwen Zheng et al. integrate guidance signals directly into model weights during online reinforcement learning, embedding conditional alignment into the base parameters.
  • Preference Optimization: Kaiwen Zheng et al. utilize Direct Discriminative Optimization (DDO) to integrate inference-time sharpening directly into model weights via a GAN-like discriminative objective.
  • Vision-Language Grounding: To mitigate hallucinations in Large Vision-Language Models (LVLMs), Yuxi Xie et al. embed a vision-specific guidance term directly into a preference learning loss, forcing the model to ground its responses in visual features without increasing decoding latency.

Decoupled Sidecars and Alternative Guidance

While full internalization bakes the guidance entirely into the primary model weights, an alternative school of thought utilizes lightweight architectural modifications or external signals to achieve single-pass efficiency.

Instead of evaluating the massive base model twice, one can offload the unconditional or negative prompt computation to a smaller network. Weilong Chai et al. introduce SpeedUpNet, a decoupled sidecar network that predicts the difference between positive and negative prompts in a single forward pass. Similarly, Yi-Ting Hsiao et al. replace the standard unconditional pass with a lightweight external "guide model" containing only 1% of the base model's parameters, cutting computational operations by up to 50%.

Decoupled Sidecar Guidance:
[Prompt c] ----> Base Model (99% parameters)  \
                                                ===> Single-Pass Combination
[Negative] ----> Sidecar Model (1% parameters) /

This strategy of isolating guidance logic is also applicable outside of diffusion models. For Generative Adversarial Networks, Yifei Zhang et al. perform conditional guidance within a lightweight mapping network, avoiding dual-pass architectures entirely while maintaining high sampling throughput. Alternatively, Nicola Dall'Asen et al. bypass the unconditional evaluation by using external reference exemplars to provide a single-pass semantic steering signal.

Finally, it is worth noting that the necessity of unconditional training itself is being re-evaluated. Seyedmorteza Sadat et al. propose allocating the entire training budget exclusively to conditional data, showing that models can still perform guidance at inference time by using unrelated or random labels to approximate the unconditional score function, thereby maximizing training efficiency.

Key Foundational Work

DogFit: Domain-guided Fine-tuning for Efficient Transfer Learning of Diffusion Models (2025) — contributed 2 concept elements to this direction.
Diffusion Models without Classifier-free Guidance (2025) — contributed 2 concept elements to this direction.
Visual Generation Without Guidance (2025) — contributed 2 concept elements to this direction.
History & citationVersion 1 · 2026-10-04

Current · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_guidance_distillation_2019d63f,
  title = {guidance distillation},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/guidance-distillation/rdr_2019d63ff15241aaaed28fceac725802},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-23},
}

This exact version (version 1, frozen text):

@misc{lacuna_guidance_distillation_2019d63f_v1,
  title = {guidance distillation},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/guidance-distillation/rdr_2019d63ff15241aaaed28fceac725802/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-23},
}
About

These directions overlap with this one through shared papers.

See something wrong? Report a mistake