Papers
Topics
Authors
Recent
Search
2000 character limit reached

Dynamic Negative Guidance (DNG)

Updated 3 April 2026
  • Dynamic Negative Guidance (DNG) is a technique that dynamically adapts repulsive signals in generative models to minimize unwanted outputs and enhance content fidelity.
  • It employs adaptive context selection, state- and time-dependent scaling, and external feedback integration to refine guidance based on model uncertainty.
  • Deployed in diffusion and language models as well as engineering design generators, DNG improves constraint satisfaction and sample quality with minimal runtime overhead.

Dynamic Negative Guidance (DNG) is a class of techniques for generative models that dynamically adapts the repulsive signal steering the model away from unwanted outputs, artifacts, or constraint-violating regions. Unlike standard negative guidance or negative prompting—which employ static, globally applied negative signals—DNG modulates guidance strength or target content adaptively at each generation step based on state, time, local uncertainty, or external feedback. DNG methods have been adopted across masked diffusion LLMs, text-to-image diffusion, few-step flow-matching architectures, engineering design generators, and artifact-mitigation pipelines, offering improved safety, fidelity, controllability, and sample quality relative to static baselines.

1. Core Principles and Definitions

Dynamic Negative Guidance builds upon conventional classifier-free guidance (CFG), which linearly interpolates conditional (desired) and unconditional (neutral/negative) model branches for controllable sampling. DNG enhances this by introducing dynamism to the negative branch, including:

  • Adaptive context selection: Rather than a fixed unconditional input (e.g., a null prompt or blank mask), DNG selects a partial or state-specific negative context at each generation step—commonly focusing repulsion where the model is least certain or where unwanted artifacts are detected (Li et al., 26 May 2025).
  • State- and time-dependent scaling: The strength of negative guidance is modulated as a function of the generative trajectory (e.g., denoising steps, attention activations, or posterior estimates), ensuring stronger repulsion in ambiguous or risky regions and tapering off where the model is certain (Koulischer et al., 2024, Guo et al., 11 Aug 2025).
  • External signal integration: DNG may interleave reward models, classifiers, or vision-LLM (VLM) queries to dynamically discover which features/concepts to repel, based on real-time feedback (Li et al., 2024, Chang et al., 30 Oct 2025).

Standard CFG, NASA, and NAG utilize static guidance. In contrast, DNG's dynamic, context-aware negative signal yields targeted constraint enforcement and improved sample quality.

2. Mathematical Formulations and Algorithms

DNG methods adopt distinct formulations depending on model class and domain. Principal variants include:

  • Adaptive Classifier-Free Guidance via Dynamic Low-Confidence Masking: For masked diffusion LLMs, DNG constructs the unconditional branch by selectively remasking low-confidence tokens at each generation step, defining a binary mask MtM_t over filled positions with lowest softmax confidence. The guidance update becomes xt1=xt+αt(fθ(xty)fθ(xtU))x_{t-1} = x_t + \alpha_t (f_\theta(x_t|y) - f_\theta(x_t^U)) where xtUx_t^U is the masked input (Li et al., 26 May 2025).
  • Posterior-weighted Dynamic Scaling: In diffusion models, the negative guidance term λ(t,xt)\lambda(t,x_t) is adjusted at every denoising timestep according to the estimated posterior probability of the forbidden class, using recursive Bayes updates along the discrete Markov chain. The effective score is sDNG(xt,t)=sθ(xt,t)λ(t,xt)[sθ,Red(xt,t)sθ(xt,t)]s_{DNG}(x_t, t) = s_\theta(x_t, t) - \lambda(t, x_t)[s_{\theta,Red}(x_t, t) - s_\theta(x_t, t)] (Koulischer et al., 2024).
  • Attention-space Value Sign Flip (VSF): In few-step image or video diffusion, negative prompt value vectors are dynamically sign-flipped in attention computations, scaling by actual image-to-negative-token attention weights. The update at each layer is ZVSF=A+V+αAVZ_{VSF} = A^+ V^+ - \alpha A^- V^- (adaptive per step and location) (Guo et al., 11 Aug 2025).
  • Learned Dynamic Negative Embeddings: Reward-guided learning frameworks (e.g., ReNeg) optimize a negative embedding vector in the CLIP text encoder space—globally or per-prompt—by gradient feedback from a scalar reward model, updating nn to maximize the expected downstream human-alignment reward for generated images (Li et al., 2024).
  • VLM-Queried Dynamic Negative Prompting: At specified denoising steps, DNG samples the intermediate image, queries a VLM for context-specific negative prompts, and uses these dynamically for negative guidance during subsequent steps (Chang et al., 30 Oct 2025).
  • Score sharpening along artifact directions: In artifact mitigation, DNG subtracts out score components along directions identified as leading to hallucinations, sDNG(x,t)=sθ(x,t)λ(t)sθ(x,t),u^u^s_{DNG}(x,t) = s_\theta(x,t) - \lambda(t)\langle s_\theta(x,t), \hat u\rangle\hat u (Triaridis et al., 6 Oct 2025).

These approaches share a general form: at each generative step, determine the negative signal to apply (by mask, scaling, projection, or external model) based on the instantaneous state.

3. Model Classes and Integration Strategies

DNG is instantiated in a range of architectures:

Notably, DNG introduces minimal runtime increase (typically <10%) and does not require retraining in most variants.

4. Empirical Benchmarks and Performance

DNG methods consistently outperform static negative guidance and unconditioned sampling on metrics such as safety, diversity, constraint satisfaction, alignment, and image quality.

Selected results:

Model/Dataset Baseline Static Guidance DNG / Dynamic Improvement
LLaDA-8B (GPQA) 26.1% 29.4% 33.3% +3.9 pts over CFG (Li et al., 26 May 2025)
LLaDA-8B (Sudoku) 35.0% 34.0% 42.0% +8.0 pts
Stable Diffusion 3.5 NegScore ~0.19–0.38 VSF: 0.545 +0.2–0.4 vs NASA/NAG (Guo et al., 11 Aug 2025)
MNIST (class removal) DNG: <1% rate Best KL/FID at high safety (Koulischer et al., 2024)
HPSv2 (ReNeg global) null-text baseline +4–6 points Superior human-alignment (Li et al., 2024)
TopologyGAN v.f. error 10.4% DNG: 8.8% –15% error (Regenwetter et al., 2023)
ImageNet-1k (DNG) IS=34.24 IS=83.19 IS=88.49 Highest IS/precision (Triaridis et al., 6 Oct 2025)
Ring-a-Bell/P4D (ASR) ASR↓ to ~0.01 Maintains FID/CLIP under VLM-DNP (Chang et al., 30 Oct 2025)

DNG's ability to sharpen repulsive signals along “risky” features or regions and adaptively tune guidance yields better Pareto frontiers for safety-vs-fidelity and constraint-vs-diversity, narrowing the gap to strong autoregressive or supervised baselines.

5. Identifying and Targeting Undesirable Features

Central to DNG is the identification of where and how to apply negative guidance:

  • Model uncertainty: Low softmax confidence identifies ambiguous tokens for targeted corrective masking (Li et al., 26 May 2025).
  • Class/posterior tracking: Recursive Bayes filtering provides state-aware strength for concept suppression (Koulischer et al., 2024).
  • Artifact direction discovery: PCA, classifier-based separation, or domain heuristics select vectors to “sharpen” out hallucination-prone semantics (Triaridis et al., 6 Oct 2025).
  • Reward feedback: Human-preference reward models optimize negative embeddings for perceptual alignment (Li et al., 2024).
  • Vision-language feedback: Dynamic visual inspection yields context-aware negative prompts, reducing collateral suppression (Chang et al., 30 Oct 2025).
  • Attention weights: Image-to-negative attention dynamic in transformer layers guides where negative values exert most impact (Guo et al., 11 Aug 2025).

A plausible implication is that DNG’s adaptability enables fine-grained constraint enforcement, making it robust to concept drift, mode collapse, and distribution shifts.

6. Limitations, Hyperparameters, and Extensions

DNG introduces new design choices, including mask fraction (ρ), guidance scale (α or λ), query intervals, and thresholds. Empirical studies find:

  • Optimal ρ ≈ 0.7 for masking low-confidence tokens; too low yields static guidance, too high degrades context (Li et al., 26 May 2025).
  • Guidance scales must be moderate; large values harm fluency or recall (Li et al., 26 May 2025, Guo et al., 11 Aug 2025).
  • In posterior-tracked methods, hyperparameters such as temperature (τ) and offset (δ) require tuning for each domain (Koulischer et al., 2024).
  • In artifact-mitigation DNG, artifact direction u^\hat u must be well-chosen to avoid unintended diversity loss (Triaridis et al., 6 Oct 2025).
  • VLM-based DNG induces runtime overhead due to repeated queries, but this is offset by sharply improved safety-fidelity trade-offs (Chang et al., 30 Oct 2025).
  • All DNG approaches require access to appropriate negative data, attribute directions, or feedback signals.

Future extensions include multi-vector (multi-artifact) DNG, joint positive/negative dynamic schedules, adaptive guidance scaling, and tighter theoretical analysis of convergence and approximation error. Applicability to non-diffusion models, hybrid architectures, and reinforcement learning remains an open direction.

7. Domain-Specific and Theoretical Insights

DNG’s impact is robust across language, vision, and design domains:

  • Engineering design: DNG/NDGM methods use negative data as explicit repellent, dramatically reducing constraint violations (e.g., by 97% in synthetic problems) while retaining mode coverage (Regenwetter et al., 2023).
  • Language generation: DNG localizes corrective guidance to uncertain tokens, outperforming static CFG in logical reasoning and planning tasks (Li et al., 26 May 2025).
  • Image and video generative diffusion: DNG achieves higher safety at maintained image fidelity, prevents over-correction, and enables context-specific, fine-grained artifact removal (Koulischer et al., 2024, Guo et al., 11 Aug 2025, Chang et al., 30 Oct 2025).
  • Hallucination suppression: DNG “sharpens” the score field specifically in low-density, high-risk regions, unlike global variance filtering or static classifier guidance (Triaridis et al., 6 Oct 2025).

The theoretical underpinning of DNG is minimizing (or dynamically modulating) mass in invalid/out-of-support regions, via explicit divergence terms, dynamic conditional guidance, or directionally targeted score adjustment. This framework generalizes naturally to settings where negative examples or artifact signals can be flexibly defined and leveraged within the generative process.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Dynamic Negative Guidance (DNG).