Zero-Shot Conditioning of Score-Based Diffusion Models by Neuro-Symbolic Constraints
Davide Scassola, Sebastiano Saccani, Ginevra Carbone, Luca Bortolussi
TL;DR
Score-based diffusion models enable conditional generation but typically rely on retraining a conditional model or classifier guidance. This work introduces a zero-shot conditioning method that reuses a pre-trained unconditional score-based model to sample from p(x|constraint) by modifying the score with differentiable soft constraints encoded via a neuro-symbolic framework. The key ideas are (i) constraint-based score guidance that perturbs the base score with the gradient of a soft constraint, (ii) approximations for the constrained score including multi-instance constraints and Langevin corrections, and (iii) a neuro-symbolic logic LTN-based soft constraint language with atomic predicates and Boolean connectives. The method is demonstrated on tabular data, time series, and image tasks, showing improved approximation to the true conditional distribution compared to rejection sampling and universal guidance, particularly for tabular and time-series data.
Abstract
Score-based diffusion models have emerged as effective approaches for both conditional and unconditional generation. Still conditional generation is based on either a specific training of a conditional model or classifier guidance, which requires training a noise-dependent classifier, even when a classifier for uncorrupted data is given. We propose a method that, given a pre-trained unconditional score-based generative model, samples from the conditional distribution under arbitrary logical constraints, without requiring additional training. Differently from other zero-shot techniques, that rather aim at generating valid conditional samples, our method is designed for approximating the true conditional distribution. Firstly, we show how to manipulate the learned score in order to sample from an un-normalized distribution conditional on a user-defined constraint. Then, we define a flexible and numerically stable neuro-symbolic framework for encoding soft logical constraints. Combining these two ingredients we obtain a general, but approximate, conditional sampling algorithm. We further developed effective heuristics aimed at improving the approximation. Finally, we show the effectiveness of our approach in approximating conditional distributions for various types of constraints and data: tabular data, images and time series.
