Contrastive Gradient Guidance for Test-Time Multi-Preference Alignment of Diffusion Models
Organizations: National Taiwan University · New York University · Harvard University · University of Washington
Abstract
Aligning pre-trained diffusion models with multiple context-dependent preferences requires adapting generation at test time rather than relying on offline fine-tuning, which requires hyperparameter tuning and a new training run for each preference trade-off. Existing approaches compress diverse preferences into a single scalar reward objective for fine-tuning or test-time guidance rather than directly reusing existing generative experts released for different purposes and obtained through different fine-tuning methods. In this work, we propose Contrastive Gradient Guidance (CGG), a test-time compositional generative framework that reformulates multi-preference alignment as a composition of distributions. CGG represents each preference as a contrastive preference pair of favored experts and unfavored anti-experts, whose score difference forms a contrastive gradient guidance signal that combines denoising directions (gradients) from off-the-shelf diffusion models during sampling. Experiments show that CGG reuses pre-trained and fine-tuned models as favored experts or anti-experts to control output style and safety, and that it can be combined with existing sampling-based reward guidance. With a single fixed scale per pair, CGG composes five preferences at once and gives a more balanced trade-off across text-image preference, concept control, photographic fidelity, and safety than offline fine-tuning, weight-space merging, and reward steering.
Figures & tables
| Type | Method | PickScore | Safety | ImageReward | RedScore | Realness |
| Base | Base model | 22.114 | 0.958 | 0.857 | 5.912 | 3.504 |
| Fine-tuned | DPO on Pick-a-Pic | 22.405 | 0.932 | 0.871 | 5.581 | 3.063 |
| MaPO on Pick-Safety | 22.017 | 0.990 | 0.975 | 5.901 | 0.232 | |
| DPO on ImageReward-DB | 22.079 | 0.956 | 0.834 | 5.737 | 3.065 | |
| SFT on RedScore | 21.954 | 0.968 | 0.778 | 7.321 | 2.789 | |
| RealVisXL V4.0 | 22.681 | 0.930 | 1.140 | 5.588 | 5.725 |
| Contrast source | Methods | Guidance form | Locked vs. free components |
| Conditioning | CFG [ 16 ] | Pair one network under two conditions; negation must pass through the prompt channel | |
| Conditioning, multi-concept | Composable Diffusion [ 30 ] | All roles one network under different conditions; signed ; anchor is a conditional or unconditional branch of the same network | |
| Training lineage | Autoguidance [ 23 ] , RLG [ 22 ] , Diffusion Blend [ 3 ] | fixed to ’s own reference or degraded twin; anchor ; amplify-only | |
| Training lineage, paired modules | cPGD [ 21 ] | , trained on the two sides of one preference dataset; anchor base; one pair | |
| Free checkpoint, language models | DExperts [ 29 ] , Model Arithmetic [ 6 ] | on next-token logits | Roles decoupled; exact per-token conditionals, so no noisy-marginal approximation; autoregressive only |
| Free checkpoint, diffusion | CGG (ours) | Anchor, , all decoupled; signed ; simultaneous pairs; sampling approximate (Eq. 11 ) |
| Class / Method | PickScore ( ) | HPSv2 ( ) | CLIP ( ) |
| Pre-trained | |||
| 22.11 | 0.29 | 36.99 | |
| Fine-tuned | |||
| 22.41 | 0.30 | 37.78 | |
| 22.34 | 0.31 | 37.20 | |
| Test-time steering | |||
| Style / Method | Style removed ( ) | Photo margin |
| Studio Ghibli | ||
| Base | 0.000 | -1.78 |
| + negative prompt | 0.090 ⋄ | +1.92 |
| + CGG ( ) | 0.090 ⋄ | -2.10 |
| + CGG ( ) | 0.159 | -2.20 |
| van Gogh | ||
| PickScore | RedScore | |
| 22.11 | 5.91 | |
| FK(Pick) | 22.21 | 5.61 |
| CGG: Red –NonRed | 21.85 | 6.80 |
| CGG-FK: Red –NonRed + Pick | 22.26 | 7.02 |
Appendix figures & tables24 assets
Supplementary material from the paper’s appendix.
Appendix
| Method | PickScore ( ) | RedScore ( ) | ImageReward ( ) | Safety ( ) | Realness ( ) | |
| TA, scale | 200 | 22.467 | 5.755 | 1.043 | 0.923 | 3.630 † |
| TA, scale | 200 | 22.574 † | 5.808 | 1.132 | 0.931 | 3.544 |
| TA, scale | 200 | 22.562 | 5.921 | 1.174 † | 0.921 | 3.370 |
| TA, scale | 200 | 22.132 | 6.478 | 1.131 | 0.928 | 2.233 |
| CGG (same prompts) | 200 | 22.593 | 6.444 † | 1.148 | 0.940 † | 2.577 |
| CGG (all prompts) | 500 | 22.475 | 5.938 | 1.210 | 0.974 | 4.117 |
| Method | Safety | Realness |
| Base model | .958 .018 | 3.50 .39 |
| DPO on Pick-a-Pic | .932 .022 | 3.06 .39 |
| MaPO on Pick-Safety | .990 .009 | .23 .34 |
| DPO on ImageReward-DB | .956 .018 | 3.06 .39 |
| SFT on RedScore | .968 .015 | 2.79 .38 |
| RealVisXL V4.0 | .930 .022 | 5.72 .33 |
| Metric | FK Steering | CGG | |
| PickScore | 22.258 | 22.475 | +0.217 |
| ImageReward | 1.056 | 1.210 | +0.154 |
| RedScore | 5.875 | 5.938 | +0.063 |
| Realness | 3.764 | 4.117 | +0.353 |
| Safety | 0.958 | 0.974 | +0.016 |
| Figure 3 | Diff. models | RedScore | BlueScore | CLIP |
| Top-left | s_{{\color[rgb]{0.4375,0.1875,0.6289}\mathrm{Purple}}}+s_{\mathrm{NonRed}} | 2.98 | 7.34 | 32.85 |
| Top | s_{{\color[rgb]{0.4375,0.1875,0.6289}\mathrm{Purple}}} | 4.96 | 9.55 | 34.17 |
| Top-right | s_{{\color[rgb]{0.4375,0.1875,0.6289}\mathrm{Purple}}}+s_{{\color[rgb]{1,0,0}\mathrm{Red}}} | 8.93 | 8.26 | 33.68 |
| Middle-left | 2.12 | 4.43 | 33.99 | |
| Middle | 5.81 | 4.28 | 37.12 | |
| Middle-right | s_{{\color[rgb]{1,0,0}\mathrm{Red}}} | 9.39 | 4.50 | 34.53 |
| PickScore | HPSv2 | CLIP | |
| 22.11 | 0.29 | 36.99 | |
| 22.41 | 0.30 | 37.78 | |
| 22.48 | 0.31 | 37.98 |
| PickScore ( ) | HPSv2 ( ) | CLIP ( ) | |
| 22.11 | 0.29 | 36.99 | |
| 22.02 | 0.30 | 37.14 | |
| 22.15 | 0.30 | 37.28 |
| Metric | PPBS | CGG | |
| PickScore | 22.114 | 22.095 | 22.153 |
| Aesthetic | 6.481 | 6.462 | 6.348 |
| HPSv2 | 0.292 | 0.309 | 0.304 |
| CLIP | 36.994 | 36.705 | 37.483 |
| ImageReward | 0.857 | 1.052 | 1.039 |
| PickScore | 20.529 | 21.072 | 21.072 |
| Aesthetic | 5.739 | 6.145 | 6.145 |
| HPSv2 | 0.259 | 0.291 | 0.291 |
| CLIP | 33.382 | 34.252 | 34.252 |
| ImageReward | 0.064 | 0.631 | 0.631 |
| Base | Diff.-DPO | MaPO | |||
| Model | Pre-trained | Fine-tuned | CGG | Fine-tuned | CGG |
| SDXL | 0.910 | 1.040 | 1.030 (+0.120) | N/A | N/A |
| Metric | Base | DPO | CGG | |
| Pre-trained | Pick-a-Pic | ImageReward | (ours) | |
| PickScore ( ) | 22.114 | 22.405 | 22.079 | 22.395 |
| ImageReward ( ) | 0.857 | 0.871 | 0.834 | 1.070 |
| Metric | Base | CGG | Win-rate | ||
| PickScore | 22.030 | 22.451 | 73.0% | ||
| Safety | 0.956 | 0.962 | – | ||
| ImageReward | 0.696 | 1.160 | 79.2% | ||
| RedScore | 5.824 | 5.930 | 54.8% | ||
| Realness | 3.513 | 3.816 | 53.0% |
| Method | sec/img ( ) | Peak VRAM (GB, ) |
| Base | 3.18 0.02 | 11.5 |
| DPO | 3.21 0.01 | 11.5 |
| CGG 2-pair | 12.53 0.03 | 26.2 |
| CGG 5-pair | 24.93 0.05 | 45.7 |
| FK Steering | 43.58 0.40 | 29.5 |
Diffusion Model Alignment
Diffusion model alignment steers generated content and internal representations toward prompts, human preferences, safety goals, and task constraints.
See all 202 papers