Specificity-Aware Diffusion Steering via Variance-Reduced Sequential Monte Carlo

Luran Wang, Linrui Ma, Hannes Stark, Regina BarzilayNeurIPS 2026

TL;DR

Telling a diffusion model what not to generate often breaks what you do want to generate, especially when the desired and undesired concepts overlap. This paper solves that "collateral damage" problem by mathematically defining a surgical target distribution—preserving positive traits only where they clearly outweigh negative ones—and building a stabilized Sequential Monte Carlo (SMC) sampler to reliably navigate toward it at inference time without retraining. From removing specific classes in images to designing ultra-selective protein binders that distinguish between targets differing by a single amino acid, this method steers generation with precision rather than brute-force repulsion.

What Problem Does This Paper Address?

One of the superpowers of diffusion models is inference-time steering: guiding a pretrained model toward new constraints on the fly without expensive retraining. Often, we need specificity—satisfying a positive prompt while strictly avoiding a negative one. Think of asking an image model for a "medieval feast" without "banquet tables," or designing a therapeutic protein that binds to a diseased cell marker while ignoring a nearly identical healthy one.

Standard tools like negative prompting or repulsive guidance work like a blunt magnet: they push the generation trajectory away from the undesired distribution ($p^B$). However, when the desired distribution ($p^A$) and undesired distribution overlap, this blind repulsion erodes valid modes of $p^A$ or shoves samples into weird, distorted territory (a phenomenon called mode shift). Existing methods define heuristic steering rules rather than an explicit target distribution, leaving us with a fundamental question: how do we suppress unwanted regions while leaving the valid parts of our desired distribution intact?

Comparison of target distributions showing how the proposed method cleanly carves out undesired overlap without shifting valid desired modes, unlike DNG or Negative Prompting.

Methods

The authors tackle this in two distinct stages: designing the right target, and sampling from it without crashing.

  1. Likelihood-Ratio Target Design (New): Instead of ad-hoc repulsion, the authors formulate an overlap-minimization objective. The resulting optimal target distribution acts like a gatekeeper: it keeps $p^A$ intact only where the likelihood ratio $p^A(x) / p^B(x)$ exceeds a threshold $\gamma$, and zeroes it out elsewhere. For smooth diffusion across time $t$, they relax this hard cutoff into a differentiable, temperature-controlled sigmoid "gate."
  2. Variance-Minimized Local SMC Proposal (New): Having a time-dependent target path is great, and Sequential Monte Carlo (SMC)—which evolves a cloud of "particles" via propagation, reweighting, and resampling—is a standard, principled way to sample from it. However, SMC notoriously suffers from weight degeneracy: particle weights wildly diverge, causing all particles to collapse onto a single sample. Using a forward–backward Gaussian kernel-ratio view, the authors design a two-field forward proposal paired with a matched backward drift that cancels out leading-order stochastic fluctuations in the particle weights.
  3. Fixed-Noise JVP Optimization (New): Evaluating candidate proposals naively requires expensive neural network passes. The authors introduce a clever fixed-noise trick that reuses a single Jacobian–vector product (JVP) per reference model, allowing them to dynamically pick step parameters that maximize Effective Sample Size (ESS) on the fly.

Datasets

Because the method operates entirely at inference time, no training datasets are used by the authors; instead, they evaluate pretrained models across four domains:

  • 40-Component Gaussian Mixture (40-MoG): A standard 2D synthetic benchmark divided into $A$-only, $B$-only, and overlapping $A \cap B$ modes.
  • CIFAR-10: Used with pretrained DDPMs for single-class removal (forgetting airplanes or automobiles) and overlapping multiclass selection (e.g., keeping classes $\{0,1,2\}$ from generators trained on $\{0,1,2,3,4\}$ and $\{3,4,5,6,7\}$).
  • DNG Text-to-Image Suite: Evaluates Stable Diffusion v1.4 on 10 prompt pairs featuring both semantically related and unrelated negative prompts.
  • pMHC Protein Binder Design: A structural biology testbed (using BoltzGen and Boltz-2) targeting an HLA-A*02:01 scaffold presenting the peptide NLVPMVATV while avoiding an off-target peptide NLVFMVATV (differing by just one Proline-to-Phenylalanine mutation at position 4).

Key Insights and Ideas

  • Relative Evidence Beats Absolute Density: Baselines like Safe Denoiser repel wherever the negative density $p^B$ is high, accidentally wiping out valid $p^A$ modes sitting nearby. Gating via the ratio $p^B/p^A$ ensures repulsion only fires when the negative hypothesis actually outcompetes the positive one.
  • Steering Needs Explicit Targets, Not Just Forces: Heuristic negative guidance shifts probability mass globally, distorting non-overlapping regions. Carving out an explicit target distribution keeps non-overlapping positive modes untouched.
  • Proposal Optimization Saves SMC from Visual Collapse: Feeding the exact same target distribution into naive SMC causes severe visual artifacts due to weight collapse. Locally minimizing relative weight variance is what makes principled distributional steering work in high dimensions like Stable Diffusion.

Key Results

  • CIFAR-10 Specificity: On 10,240 generated images per setting, the method achieves better low-leakage trade-offs (lower FID and lower KL divergence on retained classes, plus higher distributional coverage) than Composition, Safe Latent Diffusion, Dynamic Negative Guidance (DNG), and Safe Denoiser.
CIFAR-10 class-1 removal showing FID vs. Forget-class leak, where the proposed method achieves lower FID at near-zero leakage rates.
  • Text-to-Image Generation: Averaged across the DNG benchmark, the method achieves the highest overall CLIP similarity margin (0.1666). On challenging related negatives, it yields the lowest negative-prompt leakage (0.1413) and beats the second-best baseline (DriftLite, 0.1228 margin) by 6.6% (0.1309 margin).
  • pMHC Binder Design: Across 64 designed 80-residue proteins, the method achieves the highest mean (0.1856), median (0.1822), and 75th-percentile (0.3337) structural specificity margins (binder–peptide iPTM difference), improving over target-only BoltzGen by 3.9%, 14.8%, and 16.6%, respectively—successfully docking onto the target peptide while steering clear of the single-residue mutant.

Limitations and Future Work

The framework currently relies on stochastic SDE sampling and local one-step Gaussian approximations; extending it to fast deterministic ODE solvers, EDM parameterizations, and finite-time flow maps remains open. Maintaining a particle cloud across two reference models with JVP calculations also adds inference compute and introduces domain-specific hyperparameters. Finally, the authors note the lack of large-scale text-to-image specificity benchmarks, and emphasize that their pMHC protein designs were evaluated via in silico structural confidence (Boltz-2 iPTM) on a single peptide pair—requiring wet-lab binding affinity assays for true biological validation.

Summary updated

Abstract

Inference-time steering enables pretrained diffusion models to satisfy new constraints without full retraining. However, specificity-aware generation is difficult: repelling samples from a negative reference distribution can also erode the positive distribution where the two overlap. The key challenge is to suppress negative mass while minimally distorting the positive distribution. We address this problem by formulating specificity-aware steering as a target-design problem and deriving a target distribution from an overlap-based objective. The resulting target keeps the desired reference distribution only in regions where it is sufficiently preferred over the undesired reference distribution, giving a likelihood-ratio interpretation of specificity. To sample from the corresponding time-dependent target path, we develop a Sequential Monte Carlo sampler with a variance-minimized local proposal. We further introduce a practical fixed-noise optimization procedure using Jacobian–vector products of the desired and undesired score fields. Experiments on synthetic tasks, CIFAR-10 class removal and multiclass selection, text-to-image generation, and peptide–MHC (pMHC) binder design show that the proposed method suppresses undesired regions more effectively, reduces mode shift, and improves sampling stability by decreasing the SMC weight collapse compared with negative-guidance baselines. Code is available at: https://github.com/WangLuran/Specificity-Aware-Diffusion-Steering
BibTeX
@inproceedings{wang2026specificity,
  author = {Luran Wang and Linrui Ma and Hannes Stark and Regina Barzilay},
  title = {{Specificity-Aware Diffusion Steering via Variance-Reduced Sequential Monte Carlo}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=oIBOJ76wYl},
}
Figure