Table of Contents
Fetching ...

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.

Logic-Guided Vector Fields for Constrained Generative Modeling

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}\mathcal{L}_{LGVF} = \mathcal{L}_{FM} + \mathbb{E}_{t,x_0,x_1}[ \lambda(t)\ell_{logic}(x_t) ]\tilde{v}(x_t,t) = v_\theta(x_t,t) - \eta(t)\nabla_x \ell_{logic}(x_t)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.
Paper Structure (20 sections, 5 theorems, 13 equations, 6 figures, 1 table, 2 algorithms)

This paper contains 20 sections, 5 theorems, 13 equations, 6 figures, 1 table, 2 algorithms.

Key Result

lemma 1

For almost every $t$ along a solution of eq:ode_adjusted,

Figures (6)

  • Figure 1: LGVF learns constraint-aware vector fields. While standard flow matching follows straight-line paths (dashed) that may traverse forbidden regions, LGVF combines flow matching loss $\mathcal{L}_{\text{FM}}$ with logic guidance $\mathcal{L}_{\text{logic}}$ to learn vector fields that route trajectories around constraint violations. The logic loss penalizes violations at intermediate states $\mathbf{x}_t$, encouraging the model to discover valid paths from base distribution $p_0$ to target $p_{\text{data}}$.
  • Figure 2: Case Study 1: Linear half-plane constraint$(x_1 + x_2 \geq 0)$. (a) Target distribution with two Gaussian modes in the valid region. (b) Flow Matching: 2.2% violations near the diagonal boundary. (c) LGVF: slight improvement to 2.0%. (d) LGVF + Adjusted: 0.4% violations (82% reduction). Red crosses indicate violations; blue dots are valid samples.
  • Figure 3: Case Study 2: Nonlinear ring constraint$(1.5 \leq \|x\| \leq 2.8)$. The valid region is the white annulus; inner disk and outer region are forbidden. Flow Matching produces 5.65% violations in both regions. LGVF reduces this to 3.45%, and LGVF + Adjusted achieves 1.20% (79% reduction), with violations nearly eliminated at both boundaries.
  • Figure 4: Case Study 3: Multi-obstacle avoidance. Three circular obstacles (pink) block direct paths to target modes (green in panel a). Flow Matching: 1.7% violations. LGVF alone increases violations to 2.5% due to complex non-convex geometry, but LGVF + Adjusted recovers to 0.7% (59% improvement), demonstrating the robustness of inference-time correction.
  • Figure 5: Case Study 4: Scaling to high dimensions. Flow Matching violations increase with dimension, while LGVF + Adjusted maintains near-zero violations.
  • ...and 1 more figures

Theorems & Definitions (11)

  • lemma 1: Instantaneous violation rate under adjusted dynamics
  • proof : Proof sketch
  • proposition 1: Sufficient condition for monotone violation decrease
  • proof : Proof sketch
  • proposition 2: One-step upper bound on violation
  • proof : Proof sketch
  • proposition 3: Trajectory deviation under late-time adjustment
  • proof : Proof sketch
  • proposition 4: Infeasible mass precludes zero MMD
  • proof : Proof sketch
  • ...and 1 more