English

LogicMP: A Neuro-symbolic Approach for Encoding First-order Logic Constraints

Artificial Intelligence 2025-10-10 v4 Symbolic Computation

Abstract

Integrating first-order logic constraints (FOLCs) with neural networks is a crucial but challenging problem since it involves modeling intricate correlations to satisfy the constraints. This paper proposes a novel neural layer, LogicMP, whose layers perform mean-field variational inference over an MLN. It can be plugged into any off-the-shelf neural network to encode FOLCs while retaining modularity and efficiency. By exploiting the structure and symmetries in MLNs, we theoretically demonstrate that our well-designed, efficient mean-field iterations effectively mitigate the difficulty of MLN inference, reducing the inference from sequential calculation to a series of parallel tensor operations. Empirical results in three kinds of tasks over graphs, images, and text show that LogicMP outperforms advanced competitors in both performance and efficiency.

Keywords

Cite

@article{arxiv.2309.15458,
  title  = {LogicMP: A Neuro-symbolic Approach for Encoding First-order Logic Constraints},
  author = {Weidi Xu and Jingwei Wang and Lele Xie and Jianshan He and Hongting Zhou and Taifeng Wang and Xiaopei Wan and Jingdong Chen and Chao Qu and Wei Chu},
  journal= {arXiv preprint arXiv:2309.15458},
  year   = {2025}
}

Comments

28 pages, 14 figures, 12 tables

R2 v1 2026-06-28T12:33:28.060Z