NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

PixelAsParam: A Gradient View on Diffusion Sampling with Guidance

AnhDung Dinh, Daochang Liu, Chang XuICML 2023

PixelAsParam reinterprets guided diffusion sampling as a pixel-level optimization problem where different mathematical terms act as competing "gradients." By identifying and resolving directional conflicts between denoising, guidance, and diversity terms using a simple projection method, the authors break the classic trade-off between image quality and diversity without requiring any model retraining.

The Guidance Trilemma

Diffusion models have become the gold standard for image generation, but controlling them effectively remains a challenge. To generate specific content (e.g., "a golden retriever"), researchers use guidance, which nudges the sampling process toward a target class or description.

However, current guidance techniques suffer from a frustrating "trilemma" trade-off:

  1. Diversity: Low guidance scales produce varied images but often ignore the specific prompt.
  2. Conditional Accuracy: High guidance scales follow the prompt strictly but result in "over-optimized," repetitive, or low-quality images (the "saturated" look).
  3. Image Quality: Finding the "sweet spot" is difficult and often requires extensive hyperparameter tuning.

The authors identify that this happens because the sampling process is essentially a tug-of-war. The mathematical terms responsible for making the image look "real" (denoising) often point in the opposite direction of the terms trying to make it look like a "dog" (classification guidance).

Proposed Method: The Gradient View

The core innovation of this paper is viewing the sampling process through a gradient lens. Instead of seeing sampling as just reversing a noise process, the authors treat image pixels as parameters ($x$) being optimized across multiple objectives.

1. Gradient Decomposition

They decompose the standard guided sampling equation into three distinct "update directions" (gradients):

  • Denoising Gradient ($g_{den}$): Pulls the image toward the predicted clean data distribution.
  • Classification Gradient ($g_{cls}$): Pushes the image to satisfy the external condition (the prompt).
  • Diversity Gradient ($g_{div}$): Derived from the random noise injected during sampling, which ensures the model doesn't collapse into generating the same image every time.

2. Conflict Projection (PxP)

Drawing inspiration from multi-task learning (specifically the PCGrad algorithm), the authors propose the PixelAsParams Denoising Process (PxP).

Conceptual overview of PixelAsParam. Left: Conflicting update directions cause trade-offs between diversity and condition satisfaction. Right: Gradient projection resolves these conflicts, yielding high-quality, diverse samples.

When two gradients conflict—meaning they point in opposite directions (an angle $> 90^\circ$)—the update becomes destructive. PxP detects these conflicts and projects the gradients onto the orthonormal plane of one another. This effectively "cancels out" the parts of the vectors that are fighting each other while keeping the components that contribute to the final goal.

By treating the random noise term as a "diversity gradient," they show that even randomness can be "surgically" preserved. Projecting the classification gradient so it doesn't fight the diversity term allows for high-fidelity images that remain varied.

Key Insights and Results

The authors evaluated their method on several standard benchmarks, including ImageNet (64x64, 128x128, and 256x256), CIFAR-10, and MS-COCO (for text-to-image guidance via GLIDE).

  • Empirical Conflict Discovery: The authors proved that $g_{cls}$ and $g_{den}$ maintain high directional conflict throughout the entire sampling process. This explains why simply increasing the guidance scale ($s$) eventually destroys image quality.
  • Zero Retraining: Unlike many methods that require fine-tuning or "adapter" layers, PxP is a pure inference-time modification. It works with any pre-trained diffusion model and classifier.
  • Quantitative Improvements: The PxP method consistently outperformed vanilla guidance (ADM-G) across multiple metrics. On ImageNet 64x64, it achieved an FID of 1.84 (lower is better) compared to 2.47 for standard guidance, while simultaneously increasing the Inception Score (IS) from 75.98 to 78.31.
  • Preserved Diversity: On ImageNet 256x256, PxP maintained significantly higher Recall values than standard guidance at high scales, proving that it successfully preserves diversity.
  • Qualitative Superiority: Visual results show that PxP avoids the "over-exposed" or "fried" look common in high-guidance diffusion, producing images with more natural textures and varied compositions.

Limitations and Future Work

While highly effective, the approach has a few limitations:

  • Hyperparameters: The method introduces four new "projection scale" hyperparameters ($\delta_1$ to $\delta_4$). While the authors provide robust defaults, optimal performance on new, niche datasets might require some tuning.
  • Computational Cost: While the projection math is simple, it adds a small amount of overhead to every sampling step. In high-throughput production environments, this might need optimization.
  • Complex Guidance: The paper focuses on classification and CLIP-based guidance. Future work could explore how these gradient projections handle more complex structural guidance, such as depth maps or Canny edges (e.g., ControlNet).

Summary updated

BibTeX
@inproceedings{dinh2023pixelasparam,
  author = {AnhDung Dinh and Daochang Liu and Chang Xu},
  title = {{PixelAsParam: A Gradient View on Diffusion Sampling with Guidance}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=1vA4rUDJQS},
}
Figure