Improving Deep Learning Models via Constraint-Based Domain Knowledge: a Brief Survey

Andrea Borghesi, Federico Baldo, Michela MilanoarXiv 2020

TL;DR

Deep learning models are incredibly powerful but often act as "black boxes" that require massive amounts of data to learn basic rules. This survey explores how to bridge the gap between data-driven learning and human expertise by injecting constraint-based domain knowledge—mathematical or logical rules—directly into neural networks to make them more efficient, accurate, and reliable.

What Problem Does This Paper Address?

While Deep Learning (DL) excels at finding patterns in large datasets, it faces two major hurdles:

  1. Data Hunger: Models struggle when high-quality labeled data is scarce.
  2. Lack of "Common Sense": Purely data-driven models can learn functions that violate fundamental domain laws (e.g., a physics model predicting negative mass or a medical model suggesting an impossible drug interaction).

The authors argue that we shouldn't force a model to "re-learn" what we already know. Instead, we should provide "hints" or "guardrails" in the form of constraints. This paper categorizes the diverse, often isolated research efforts aimed at integrating this prior knowledge into Deep Neural Networks (DNNs).

Methods

The authors identify five primary mechanisms for injecting domain knowledge:

  1. Feature Space Manipulation: Instead of just feeding raw data, researchers use domain knowledge to engineer new features. For example, using knowledge graphs to create additional input dimensions that represent known relationships between variables.
  2. Hypothesis Space Modification: Designing the actual architecture of the neural network to match the problem's structure. Familiar examples include Convolutional Neural Networks (CNNs) for spatial locality or Graph Neural Networks (GNNs) for data that naturally forms a network.
  3. Data Augmentation: Using domain rules to generate new, valid training examples. In chemistry, for instance, a single molecule can be represented by multiple valid string sequences; enumerating these based on chemical constraints expands the training set without new experiments.
  4. Regularization Schemes: Adding a penalty term to the loss function. If the model produces an output that violates a domain constraint (e.g., a non-monotonic output where a monotonic one is expected), the loss increases, "punishing" the model during training.
  5. Constrained Learning (Decision-Focused): Integrating DNNs into larger optimization pipelines. Here, the network is trained not just to be "accurate" in a vacuum, but to produce outputs that lead to optimal, feasible solutions in a downstream task (like combinatorial optimization).

Datasets

As a survey paper, this work does not introduce a new dataset. Instead, it reviews studies that utilize a wide variety of data types, including:

  • Chemical informatics: Molecular structures and properties (e.g., SMILES strings).
  • Sports analytics: Soccer match outcomes and team ratings.
  • Natural Language: Sentiment analysis datasets.
  • Optimization problems: Partial Latin Square problems and floating-point precision tuning.

The authors note a significant problem in the field: there is no "standard" benchmark for knowledge injection, making it difficult to compare different methods fairly.

Key Insights and Ideas

  • "Soft" vs. "Hard" Constraints: Most current DL approaches favor "soft" constraints (penalties in the loss function) because they play nicely with gradient descent. However, this means the model might still occasionally violate the rules if the "accuracy" reward is high enough.
  • The Accuracy-Consistency Trade-off: A model that perfectly follows domain rules might actually show lower accuracy on a noisy dataset compared to a purely data-driven model. The authors suggest we need better metrics that value "logical consistency" alongside raw accuracy.
  • Unsupervised Potential: Acting on the feature space or using data augmentation often doesn't require labeled data ($y_i$), making these techniques particularly powerful for unsupervised learning tasks.
  • Logic as a Universal Language: The authors advocate for using first-order logic and mathematical constraints as a "common language" to bridge the gap between human experts (who know the rules) and ML engineers (who build the models).

Key Results

The survey highlights several successful frameworks:

  • SBR (Semantic Based Regularization) & LYRICS: These provide tools to translate logical formulas into fuzzy constraints that can be plugged into standard loss functions.
  • DL2: A framework that allows users to "query" a neural network with logic, checking if constraints are satisfied and training the model on inputs outside the original training set.
  • Performance Boosts: The cited works consistently show that injecting knowledge provides a "warm start" for training and significantly improves performance in "small data" regimes where standard DNNs typically fail.

Limitations and Future Work

  • Lack of Homogeneity: The field is currently fragmented. Different researchers use different injection methods, target different architectures, and evaluate on different metrics.
  • Optimization Difficulties: Balancing multiple penalty terms in a loss function is notoriously hard. If the weights ($\lambda$) aren't tuned perfectly, the optimizer might ignore the constraints entirely or fail to converge.
  • The Need for a Unified Framework: The authors conclude that the next big step for the field is developing a unified methodology and a set of common benchmarks. They suggest that a language based on constraint programming and mixed-integer linear programming could be the key to describing diverse domain challenges in a way that neural networks can understand.

Summary updated

BibTeX
@misc{borghesi2020improving,
  author = {Andrea Borghesi and Federico Baldo and Michela Milano},
  title = {{Improving Deep Learning Models via Constraint-Based Domain Knowledge: a Brief Survey}},
  year = {2020},
  eprint = {2005.10691},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2005.10691},
}
Figure