Efficient Weighted Sampling via Score-based Generative Models

Heasung Kim, Taekyun Lee, Hyeji Kim, Gustavo De Veciana

TL;DR

The paper introduces LAGS (Lightweight Approximation with uncertainty-adaptive Guidance Scheduling), a training-free framework that enables highly efficient weighted sampling from pretrained diffusion models. By replacing costly second-order Hessian calculations with a smart first-order finite-difference approximation and dynamically scheduling guidance based on time-dependent uncertainty, LAGS achieves up to a $4.7\times$ speedup over state-of-the-art methods while matching or improving generation quality.

What Problem Does This Paper Address?

In generative AI, we often want to sample from a distribution modified by a specific objective—a process known as weighted sampling. For example, we might want to steer a text-to-image model to prioritize images with high human preference scores, correct for demographic biases, or focus on specific data features. Mathematically, this means sampling from a target distribution $q(x) \propto w(x)p(x)$, where $p(x)$ is the base model's distribution and $w(x)$ is a task-specific weight function.

While fine-tuning or retraining massive score-based generative models (SGMs) for every new weight function is practically impossible, current "inference-time guidance" techniques have a major catch: they are computationally brutal. They typically require calculating complex second-order derivatives (Hessian matrices) of the score function or running expensive particle-based resampling filters during generation. This makes real-time deployment slow and resource-intensive.

The authors tackle this bottleneck, seeking a method that provides accurate, stable guided sampling without retraining, Hessians, or heavy resampling overhead.

Methods

The authors introduce LAGS, which relies on two core innovations to bypass traditional computational hurdles:

  1. Lightweight First-Order Approximation: Instead of computing exact, expensive second-order derivatives to determine the guidance direction, the authors use a first-order Taylor expansion around the conditional mean of the initial state (derived via Tweedie’s formula). To avoid the remaining Hessian-vector multiplications, they implement a highly efficient directional finite-difference approximation. This requires just one extra inference step of the base score model, completely eliminating the need for second-order backpropagation.

  2. Uncertainty-Adaptive Guidance Scheduling: The authors mathematically prove that the approximation error of their guidance term is time-dependent. During the early stages of the reverse diffusion process (when noise is high), the guidance estimate is highly uncertain and unstable. As the process nears completion ($t \to 0$), the variance drops, and the guidance becomes highly accurate. LAGS introduces a single-parameter dynamic scheduler $\gamma(t)$ that automatically dampens the guidance strength when uncertainty is high and dials it up as the generation stabilizes.

Datasets

The method was validated across both synthetic and large-scale generative tasks:

  • Synthetic 2D Multimodal Density: A complex mixture of 25 Gaussians where the target weight function concentrates samples along a heart-shaped manifold.
  • High-Dimensional Text-to-Image Alignment: Evaluated using standard prompt benchmarks on Stable Diffusion (SD) and Stable Diffusion XL (SDXL), using PickScore (a dataset/metric trained on human preferences) as the target weight function $w(x)$.

Key Insights and Ideas

  • Hessian-Free Steering is Viable: You don't need exact second-order geometry to guide a diffusion trajectory. A directional finite-difference step combined with Tweedie's denoising mean acts as an incredibly cheap yet accurate surrogate.
  • Embrace, Don't Fix, Early-Stage Chaos: Previous methods used expensive "time-travel" resampling loops to fix instability in the early steps of generation. The authors realize it's much more efficient to simply turn down the "volume" of the guidance early on when it's untrustworthy, and rely on it fully only when the generation path becomes clear.

Key Results

Synthetic 2D Manifold

LAGS accurately captured the complex heart-shaped target distribution while maintaining the lowest error and fastest execution time among all tested guidance baselines.

Figure 1. Left to Right: Base distribution, target distribution, and estimated sample densities. Wasserstein Distance and runtime (in seconds) are reported for DPS, FreeDoM, DAS, and LAGS (ours). Our method achieves the lowest Wasserstein Distance (WD) and fastest runtime.

Text-to-Image Alignment

When deployed on large-scale models like Stable Diffusion XL, LAGS broke the typical trade-off between alignment quality and computational speed:

  • Speedups: LAGS achieved a $4.7\times$ speedup over the state-of-the-art particle-filter baseline (DAS) on SDXL, taking only 85 seconds per image compared to DAS's nearly 7 minutes.
  • Performance: Despite being significantly faster, LAGS consistently achieved the highest PickScore and Human Preference Score (HPS), demonstrating superior alignment with human text preferences.

Limitations and Future Work

The authors note that their experimental scope is strictly focused on training-free guidance with an explicit target weight function. It does not directly cover alternative alignment paradigms like text-embedding manipulation or direct model fine-tuning (e.g., DPO/RLHF).

For future work, the authors highlight promising downstream applications enabled by LAGS's efficiency, such as real-time sampling for fairness (using classifier outputs as weights to mitigate demographic bias) and prompt-free controllable generation (e.g., color- or frequency-sensitive image sampling).

Summary updated

BibTeX
@inproceedings{kim2026efficient,
  author = {Heasung Kim and Taekyun Lee and Hyeji Kim and Gustavo De Veciana},
  title = {{Efficient Weighted Sampling via Score-based Generative Models}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2026},
  url = {https://openreview.net/forum?id=x5WAOpRmVW},
}
Figure