Logic-Guided Vector Fields for Constrained Generative Modeling
Ali Baheri
TL;DR
Problem: standard flow-based generative models lack robust mechanisms to enforce feasibility constraints during generation. Approach: LGVF introduces a differentiable constraint relaxation $\ $ell_{logic}$ and enforces it along the transport with a training-time logic loss plus an inference-time gradient adjustment to the vector field, forming $\mathcal{L}_{LGVF} = \mathcal{L}_{FM} + \mathbb{E}_{t,x_0,x_1}[ \lambda(t)\ell_{logic}(x_t) ]$ and $\tilde{v}(x_t,t) = v_\theta(x_t,t) - \eta(t)\nabla_x \ell_{logic}(x_t)$, respectively. Key contributions include the two-stage constraint enforcement, demonstration of 59–82% reductions in constraint violations across linear, nonlinear, and multi-region constraints, and scalable performance up to $d=100$ with emergent obstacle-avoidance in learned dynamics. Significance: LGVF enables reliable, constraint-aware generation in neuro-symbolic settings while preserving distributional fidelity, broadening applicability in safety- and feasibility-critical domains.
Abstract
Neuro-symbolic systems aim to combine the expressive structure of symbolic logic with the flexibility of neural learning; yet, generative models typically lack mechanisms to enforce declarative constraints at generation time. We propose Logic-Guided Vector Fields (LGVF), a neuro-symbolic framework that injects symbolic knowledge, specified as differentiable relaxations of logical constraints, into flow matching generative models. LGVF couples two complementary mechanisms: (1) a training-time logic loss that penalizes constraint violations along continuous flow trajectories, with weights that emphasize correctness near the target distribution; and (2) an inference-time adjustment that steers sampling using constraint gradients, acting as a lightweight, logic-informed correction to the learned dynamics. We evaluate LGVF on three constrained generation case studies spanning linear, nonlinear, and multi-region feasibility constraints. Across all settings, LGVF reduces constraint violations by 59-82% compared to standard flow matching and achieves the lowest violation rates in each case. In the linear and ring settings, LGVF also improves distributional fidelity as measured by MMD, while in the multi-obstacle setting, we observe a satisfaction-fidelity trade-off, with improved feasibility but increased MMD. Beyond quantitative gains, LGVF yields constraint-aware vector fields exhibiting emergent obstacle-avoidance behavior, routing samples around forbidden regions without explicit path planning.
