Logic Guided Genetic Algorithms (Student Abstract)

Dhananjay Ashok, Joseph Scott, Sebastian Johann Wetzel, Maysum Panju, Vijay Ganesh

Abstract

Symbolic Regression (SR) is a powerful tool for discovering interpretable mathematical models from data, yet it often struggles with data scarcity and vast search spaces. This paper introduces Logic Guided Genetic Algorithms (LGGA), a framework that incorporates "Auxiliary Truths" (ATs)—prior domain knowledge such as symmetry or boundary conditions—to guide the search process. LGGA employs an AT-enhanced loss function to penalize illogical candidates and a data augmentation loop to generate corrective counterexamples. Experimental results demonstrate that LGGA-enhanced tools can solve up to 30% more equations while requiring over 60% less data than state-of-the-art baselines like Eureqa and TuringBot.

Introduction

Symbolic Regression aims to find mathematical expressions that best fit a dataset, offering the transparency of "white box" models (e.g., $F=ma$) over standard machine learning approaches. However, SR faces two primary challenges: the high cost of obtaining quality scientific data and the infinite search space of mathematical combinations, which often leads to overfitting. LGGA addresses these by leveraging the domain knowledge human researchers already possess—mathematical facts about the system that are typically ignored by automated tools.

Methodology

LGGA integrates domain knowledge into the Genetic Algorithm (GA) framework through two primary mechanisms:

  1. AT Enhanced Loss Function: In addition to standard Mean Squared Error (MSE), LGGA introduces a TruthError metric. This term penalizes candidate equations that violate provided Auxiliary Truths (ATs). For example, if a system is known to be symmetric, any non-symmetric candidate receives a high penalty regardless of its fit to the training data.
  2. AT Driven Data Augmentation: This creates a corrective feedback loop. When a candidate equation violates an AT, the system identifies the specific violation and generates a "counterexample" data point. This new point is added to the training set, forcing the algorithm to satisfy the logical constraint in subsequent generations.
The LGGA Feedback Loop illustrates how Auxiliary Truths guide the genetic algorithm and drive data augmentation to refine the dataset.

Experimental Results

The authors evaluated LGGA against industrial-strength SR tools, Eureqa and TuringBot, across a suite of physical and mathematical equations, including Snell’s Law, the Ideal Gas Law, and Coulomb’s Law.

Increased Discovery and Data Efficiency

LGGA significantly expanded the capabilities of existing tools. Notably, it enabled the discovery of complex formulas like Relativistic Addition and Gaussian distributions, which the base tools failed to solve (marked as "NoDisc" in comparative tests).

Comparative performance table showing the minimum datapoints required to solve target equations with and without LGGA enhancement.

As shown in the results table, LGGA drastically reduces the data requirements for successful regression. For the Parallel Resistance formula, Eureqa's data requirement dropped from 21 points to just 8, representing a 62% improvement in data efficiency. Across the entire test suite, LGGA-enhanced tools solved approximately 30% more equations than their standalone counterparts.

Discussion and Future Work

LGGA acts as a powerful regularizer by penalizing equations that lack mathematical "common sense." By encoding boundary conditions and limits directly into the search, it narrows the focus to physically plausible candidates. Furthermore, the data augmentation process provides "free" labeling, generating valid training points from known truths without requiring additional experimental trials.

Future research will focus on automating the detection of Auxiliary Truths from raw data, handling "noisy" or approximate truths, and optimizing the computational overhead introduced by the counterexample generation process.

For additional results and resources, visit dhananjayashok.github.io/LGGA/.

Summary updated

BibTeX
@inproceedings{ashok2021logic,
  author = {Dhananjay Ashok and Joseph Scott and Sebastian Johann Wetzel and Maysum Panju and Vijay Ganesh},
  title = {{Logic Guided Genetic Algorithms (Student Abstract)}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2021},
  doi = {10.1609/aaai.v35i18.17873},
}
Figure