Neuro-Symbolic Entropy Regularization

Kareem Ahmed, Eric Wang, Kai-Wei Chang, Guy Van den Broeck

Abstract

In structured prediction, the goal is to jointly predict many output variables that together encode a structured object -- a path in a graph, an entity-relation triple, or an ordering of objects. Such a large output space makes learning hard and requires vast amounts of labeled data. Different approaches leverage alternate sources of supervision. One approach -- entropy regularization -- posits that decision boundaries should lie in low-probability regions. It extracts supervision from unlabeled examples, but remains agnostic to the structure of the output space. Conversely, neuro-symbolic approaches exploit the knowledge that not every prediction corresponds to a valid structure in the output space. Yet, they do not further restrict the learned output distribution. This paper introduces a framework that unifies both approaches. We propose a loss, neuro-symbolic entropy regularization, that encourages the model to confidently predict a valid object. It is obtained by restricting entropy regularization to the distribution over only the valid structures. This loss can be computed efficiently when the output constraint is expressed as a tractable logic circuit. Moreover, it seamlessly integrates with other neuro-symbolic losses that eliminate invalid predictions. We demonstrate the efficacy of our approach on a series of semi-supervised and fully-supervised structured-prediction experiments, where it leads to models whose predictions are more accurate as well as more likely to be valid.

Introduction

Structured output prediction is a fundamental challenge in machine learning, requiring models to predict complex objects such as paths through graphs or sets of related entities in natural language. This task is complicated by two major factors: the exponential explosion of the output space and the "validity gap," where the vast majority of possible outputs are invalid according to domain-specific rules.

Current solutions typically fall into two categories. Entropy regularization encourages models to be confident on unlabeled data, assuming that data forms distinct clusters. However, it is "structure-blind" and can lead a model to confidently predict invalid structures. Neuro-symbolic methods use logical constraints to penalize invalid outputs but do not necessarily encourage the model to be informative or confident among valid candidates. This research bridges these two paradigms by introducing a principled way to enforce confidence specifically within the manifold of valid structures.

Methodology: Neuro-Symbolic Entropy Regularization

The core contribution of this work is Neuro-Symbolic Entropy Regularization (NeSy Entropy). Unlike standard entropy regularization, which minimizes uncertainty across the entire output space, NeSy Entropy minimizes the entropy of the model's distribution conditioned on a logical constraint ($\alpha$). This encourages the model to be confident about which valid structure is correct, rather than simply being confident in any prediction.

Predictive distributions under different regularization regimes. (a) High entropy across valid and invalid regions. (b) Confidence in an invalid prediction. The bottom panels show the goal of NeSy entropy: concentrating probability mass on valid structures.

Tractable Computation via Logic Circuits

Computing entropy over all valid models of a logical formula is generally a #P-hard problem. To overcome this, the authors leverage Knowledge Compilation, transforming logical constraints into tractable logical circuits (specifically those that are smooth, deterministic, and decomposable).

  • AND gates allow entropy to be summed across independent sub-problems.
  • OR gates allow entropy to be partitioned across mutually exclusive options. This transformation enables the computation of NeSy Entropy in time linear to the size of the circuit, making it a viable loss function for training neural networks.

Experimental Evaluation

The efficacy of NeSy Entropy was tested across several domains:

  • Entity-Relation Extraction (ACE05, SciERC): Identifying relationships under ontological constraints.
  • Preference Learning (PREFLIB): Predicting full rankings from partial information.
  • Pathfinding (Warcraft Shortest Path): Predicting optimal paths in a 12x12 terrain map from raw image data.

Key Results

The results demonstrate that NeSy Entropy consistently outperforms both pure neural baselines and standard neuro-symbolic approaches:

  • Low-Data Performance: In the ACE05 task with only 3 labels per relation, NeSy Entropy achieved an F1-score of ~14.7, nearly tripling the baseline (~4.9).
  • Warcraft Pathfinding: Coherent accuracy (predicting the exact optimal path) improved from 44.8% to 55.0% compared to a standard ResNet-18.
  • Constraint Satisfaction: In preference learning, the model satisfied logical constraints 96.04% of the time, a significant improvement over standard MLPs (2.72%) and models using only semantic loss (69.83%).

Discussion and Conclusion

NeSy Entropy creates a synergy with existing neuro-symbolic losses like Semantic Loss. While Semantic Loss eliminates invalid predictions, NeSy Entropy provides the necessary "nudge" for the model to commit to the most likely valid candidate.

However, limitations remain. The "circuit compilation bottleneck" can lead to exponential growth in circuit size for highly complex constraints. Additionally, the framework currently assumes fixed logical rules. Future work may explore learning these constraints alongside entropy regularization and scaling these methods to larger, real-world networks.

Summary updated

BibTeX
@inproceedings{ahmed2022neuro,
  author = {Kareem Ahmed and Eric Wang and Kai-Wei Chang and Guy Van den Broeck},
  title = {{Neuro-Symbolic Entropy Regularization}},
  booktitle = {Conference on Uncertainty in Artificial Intelligence},
  year = {2022},
  url = {https://openreview.net/forum?id=rlbz4_Io5g9},
}
Figure