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

Weidi Xu, Jingwei Wang, Lele Xie, Jianshan He, Hongting Zhou +5 more
2/12/2026

No official code found. Best implementation: wead-hsu/logicmp (11 stars, last commit 2024-07-17).

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.

View on arXivView PDF

Code Implementations(1)

wead-hsu/logicmpCommunity100%

The official repository of LogicMP (ICLR2024).

110Shell, PythonMar 13, 20242 years ago

Similar Papers

Cite this paper

@article{xu2026logicmp,
  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},
  year   = {2026},
  eprint = {2309.15458},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/pdf/2309.15458},
  journal = {ICLR 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2309.15458.svg)](https://codeofpaper.com/paper/2309.15458)

Discussion