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(θ)=Et∼U[0,1], x0∼p0, x1∼pdata∥vθ(xt,t)−(x1−x0)∥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=(1−t)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 pdatap_{\rm data}0 through differentiable surrogates pdatap_{\rm data}1, where pdatap_{\rm data}2 iff pdatap_{\rm data}3. The general form is: pdatap_{\rm data}4 with pdatap_{\rm data}5 extracting features relevant to the constraint (e.g., pdatap_{\rm data}6 for a half-space), and pdatap_{\rm data}7 being a hinge-style relaxation such as pdatap_{\rm data}8.

A penalty term is added to the training objective, resulting in the total LGVF loss: pdatap_{\rm data}9 where the logic loss is a time-weighted trajectory integral: vθ(x,t)v_\theta(x, t)0 and the schedule vθ(x,t)v_\theta(x, t)1 increases toward vθ(x,t)v_\theta(x, t)2, where adherence to constraints becomes critical.

This approach shapes vθ(x,t)v_\theta(x, t)3 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_\theta(x, t)4 where vθ(x,t)v_\theta(x, t)5 is a schedule that becomes active at later times (e.g., vθ(x,t)v_\theta(x, t)6 for vθ(x,t)v_\theta(x, t)7, then increasing quadratically to vθ(x,t)v_\theta(x, t)8). The negative gradient vθ(x,t)v_\theta(x, t)9 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, 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_00 was implemented as a 3-layer MLP with 128 hidden units and ReLU activations, trained using Adam for 8,000 steps (learning rate 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_01, 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 (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_02) 2.20% 2.00% (9%) 0.40% (82%) 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_03 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_04 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_05
Nonlinear ring (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_06) 5.65% 3.45% (39%) 1.20% (79%) 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_07 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_08 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_09
Multi-obstacle avoidance 1.70% 2.50% (–47%) 0.70% (59%) p0p_00 p0p_01 p0p_02

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 p0p_03, 8,000 steps, batch size 256), logic weight schedule p0p_04 with p0p_05, and inference schedules p0p_06 for p0p_07 and quadratic ramp-up to p0p_08.

Ablation studies in the linear constraint setting showed that:

  • Increasing p0p_09 steadily reduces violation rates, reaching zero for pdatap_{\rm data}0.
  • Larger pdatap_{\rm data}1 values in the inference correction reduce violations for both FM+Adjusted and LGVF+Adjusted, but LGVF+Adjusted achieves zero errors with smaller pdatap_{\rm data}2, indicating complementarity between mechanisms.
  • The timing of inference adjustment (pdatap_{\rm data}3 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 pdatap_{\rm data}4 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).