Papers
Topics
Authors
Recent
Search
2000 character limit reached

Logic-Guided Vector Fields (LGVF)

Updated 9 February 2026
  • LGVF is a neuro-symbolic framework that embeds differentiable logic constraints into continuous-time generative models for constraint-aware sampling.
  • It combines training-time penalty terms with inference-time gradient corrections to steer sample trajectories away from constraint violations.
  • Empirical evaluations in linear, nonlinear, and obstacle-avoidance settings show significant reductions in violation rates and improved distribution fidelity.

Logic-Guided Vector Fields (LGVF) are a neuro-symbolic framework for constrained generative modeling that incorporate symbolic, logic-based knowledge into continuous-time generative models, specifically flow matching architectures. LGVF injects differentiable relaxations of logical constraints into sample generation, coupling a training-time penalty for constraint violations with an inference-time corrective mechanism based on the gradients of those constraints. The method achieves substantial reductions in constraint-violation rates and can yield improved fidelity to the target distribution. LGVF establishes a scalable approach to constraint-aware sampling, evidenced by performance gains in linear, nonlinear, and obstacle-avoidance domains (Baheri, 2 Feb 2026).

1. Continuous-Time Generative Modeling and Constraints

Generative modeling by continuous-time flows frames sample generation as the solution to an ordinary differential equation (ODE) transporting points from a tractable base distribution p0p_0 to a complex target distribution pdatap_{\rm data}. In the flow-matching paradigm, the dynamics are parameterized by a vector field vθ(x,t)v_\theta(x, t), and the ODE

x˙(t)=vθ(x(t),t),t[0,1],x(0)p0\dot x(t) = v_\theta(x(t), t), \quad t \in [0, 1], \quad x(0) \sim p_0

transports samples from p0p_0 towards pdatap_{\rm data}. Standard flow matching optimizes vθv_\theta via the conditional flow matching loss: LFM(θ)=EtU[0,1],x0p0,x1pdatavθ(xt,t)(x1x0)2\mathcal{L}_{\rm FM}(\theta) = \mathbb{E}_{t \sim \mathcal{U}[0, 1],\, x_0 \sim p_0,\, x_1 \sim p_{\rm data}} \left\| v_\theta(x_t, t) - (x_1 - x_0) \right\|^2 where xt=(1t)x0+tx1x_t = (1-t) x_0 + t x_1.

Generative models of this class lack mechanisms for enforcing declarative (symbolic) constraints on xx during generation. LGVF addresses this by integrating logic-aware constraints directly into both training and inference phases.

2. Differentiable Relaxation of Logical Constraints

LGVF expresses symbolic constraints ϕ(x){True,False}\phi(x) \in \{\text{True}, \text{False}\} through differentiable surrogates logic(x)0\ell_{\rm logic}(x) \ge 0, where logic(x)=0\ell_{\rm logic}(x) = 0 iff ϕ(x)=True\phi(x) = \text{True}. The general form is: logic(x)=Φ(h(x))\ell_{\rm logic}(x) = \Phi(h(x)) with h:RdRkh: \mathbb{R}^d \to \mathbb{R}^k extracting features relevant to the constraint (e.g., h(x)=axbh(x) = a^\top x - b for a half-space), and Φ:RkR0\Phi: \mathbb{R}^k \to \mathbb{R}_{\ge 0} being a hinge-style relaxation such as Φ(u)=max(0,u)\Phi(u) = \max(0, -u).

A penalty term is added to the training objective, resulting in the total LGVF loss: LLGVF(θ)=LFM(θ)+Llogic(θ)\mathcal{L}_{\rm LGVF}(\theta) = \mathcal{L}_{\rm FM}(\theta) + \mathcal{L}_{\rm logic}(\theta) where the logic loss is a time-weighted trajectory integral: Llogic(θ)=Et,x0,x1[λ(t)logic(xt)]\mathcal{L}_{\rm logic}(\theta) = \mathbb{E}_{t, x_0, x_1} \left[ \lambda(t)\, \ell_{\rm logic}(x_t) \right] and the schedule λ(t)=λmaxtα\lambda(t) = \lambda_{\max} t^\alpha increases toward t=1t=1, where adherence to constraints becomes critical.

This approach shapes vθv_\theta to transport mass in a way that inherently avoids constraint violation, especially near the target distribution.

3. Inference-Time Logic Adjustment

Even with robust training-time penalties, inference-time violations can occur due to the complexity of the constraint surface and model limitations. LGVF employs an inference-time "steering" correction during numerical ODE integration: v~(x,t)=vθ(x,t)η(t)xlogic(x)\tilde v(x, t) = v_\theta(x, t) - \eta(t) \nabla_x \ell_{\rm logic}(x) where η(t)0\eta(t) \ge 0 is a schedule that becomes active at later times (e.g., η(t)=0\eta(t) = 0 for t0.3t \leq 0.3, then increasing quadratically to ηmax\eta_{\max}). The negative gradient xlogic(x)-\nabla_x \ell_{\rm logic}(x) points in the direction of maximal reduction in violation, nudging samples back into feasible regions without explicit path planning.

This two-stage design—combining training-time logic shaping and local inference-time steering—enables robust satisfaction of symbolic constraints across a variety of geometry classes.

4. Empirical Evaluation on Constrained Generation

LGVF was evaluated in three 2D settings: a linear half-plane, a nonlinear ring, and a multi-obstacle "forbidden disk" region. In all experiments, vθ(x,t)v_\theta(x, t) was implemented as a 3-layer MLP with 128 hidden units and ReLU activations, trained using Adam for 8,000 steps (learning rate 3×1033 \times 10^{-3}, batch size 256), with 100 Euler steps for ODE integration at inference.

Summary of results for 2,000 samples per geometric setting:

Scenario Violations (FM) Violations (LGVF) Violations (LGVF+Adj.) MMD (FM) MMD (LGVF) MMD (LGVF+Adj.)
Linear half-plane (x1+x20x_1+x_2 \ge 0) 2.20% 2.00% (9%) 0.40% (82%) 0.89×1030.89\times10^{-3} 0.99×1030.99\times10^{-3} 0.29×1030.29\times10^{-3}
Nonlinear ring (1.5x2.81.5 \leq \|x\| \leq 2.8) 5.65% 3.45% (39%) 1.20% (79%) 1.35×1031.35\times10^{-3} 0.86×1030.86\times10^{-3} 0.51×1030.51\times10^{-3}
Multi-obstacle avoidance 1.70% 2.50% (–47%) 0.70% (59%) 0.40×1030.40\times10^{-3} 0.68×1030.68\times10^{-3} 0.82×1030.82\times10^{-3}

Percentages in parentheses denote improvement relative to baseline flow matching (FM). LGVF with inference-time adjustment ("LGVF+Adj.") consistently reduced violation rates by 59–82% across tasks. In the linear and ring settings, distributional fidelity—measured by Maximum Mean Discrepancy (MMD)—was also improved by eliminating infeasible samples. For the multi-region, obstacle scenario, improved feasibility came at the cost of a minimally higher MMD, illustrating a satisfaction–fidelity trade-off.

Empirically, LGVF induced "emergent obstacle-avoidance behavior," automatically routing generative trajectories around forbidden regions without explicit planning.

5. Implementation and Ablation Insights

Key implementation parameters included the network architecture (3-layer, 128-unit MLP), time concatenation, training setup (Adam, learning rate 3×1033\times10^{-3}, 8,000 steps, batch size 256), logic weight schedule λ(t)=λmaxt\lambda(t)=\lambda_{\max} t with λmax[10,15]\lambda_{\max}\in[10,15], and inference schedules η(t)=0\eta(t)=0 for t0.3t\le 0.3 and quadratic ramp-up to ηmax[0.5,1.5]\eta_{\max} \in [0.5, 1.5].

Ablation studies in the linear constraint setting showed that:

  • Increasing λmax\lambda_{\max} steadily reduces violation rates, reaching zero for λmax20\lambda_{\max} \gtrsim 20.
  • Larger ηmax\eta_{\max} values in the inference correction reduce violations for both FM+Adjusted and LGVF+Adjusted, but LGVF+Adjusted achieves zero errors with smaller ηmax\eta_{\max}, indicating complementarity between mechanisms.
  • The timing of inference adjustment (t0t_0 between 0.1 and 0.5) has minimal effect, suggesting robustness of the correction mechanism.

6. Advantages, Limitations, and Future Prospects

LGVF brings hard constraint satisfaction to continuous-time flow generative models by merging training-time vector-field shaping with an inference-time gradient-based steering mechanism. Documented advantages include:

  • Consistent constraint-violation reduction (59–82%).
  • Emergent obstacle-avoidance without explicit path planning.
  • Improved or preserved distributional fidelity (MMD), especially in convex constraint settings.
  • Scalability demonstrated by near-zero violation rates up to 100 dimensions for half-space constraints.

Limitations and potential directions for further research include:

  • Training-time logic shaping may be less effective on highly nonconvex or multi-region constraints; adaptive weighting or curriculum learning could mitigate this.
  • Application to structured, high-dimensional data (e.g., images, molecules) invites research into learning or differentiating more complex violation measures.
  • Joint learning of logic\ell_{\rm logic} from data or symbolic programs is a promising generalization.
  • Further coupling with optimal-transport techniques or more expressive vector-field architectures may yield improvements in sample quality under constraints.

LGVF exemplifies the unification of neuro-symbolic constraint satisfaction with the flexibility of continuous generative dynamics, offering a lightweight and extensible strategy for generating samples that meet complex, declarative requirements (Baheri, 2 Feb 2026).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Logic-Guided Vector Fields (LGVF).