Generational Computation Reduction in Informal Counterexample-Driven Genetic Programming

Thomas Helmuth, Edward R. Pantridge, James Gunder Frazier, Lee Spector · DOI

Introduction

Genetic Programming (GP) is a powerful evolutionary technique for automated program synthesis. However, its primary bottleneck is the computational cost of evaluation. In a typical GP run, every candidate program in a population must be tested against a full suite of training cases. For instance, a population of 1,000 programs evaluated against 200 training cases results in 200,000 executions per generation.

To mitigate this, researchers previously proposed Counterexample-Driven GP (CDGP), which utilizes formal mathematical specifications to generate counterexamples—inputs that expose flaws in the current best programs. While effective, the requirement for formal specifications is a significant barrier, as writing these specifications can be as complex as writing the code itself. This paper introduces informal Counterexample-Driven Genetic Programming (iCDGP), a method that achieves the benefits of counterexample-driven search using only standard input/output data.

Methodology

The core of iCDGP is the maintenance of a small, dynamic active training set ($T_A$). Instead of evaluating the entire population against the full training set ($T$), evolution proceeds using only $T_A$.

  1. Initialization: $T_A$ begins with a small random subset (e.g., 10 cases).
  2. Evolutionary Loop: Programs are evolved and selected based on their performance on $T_A$.
  3. Counterexample Identification: If a program successfully passes all cases in $T_A$, it is then tested against the remaining "hidden" cases in $T$.
  4. Set Update: If the program fails a hidden case, that case is added to $T_A$ as a new counterexample for subsequent generations.

To prevent evolutionary stagnation when no program can pass the current $T_A$, the authors introduced a generation-based variant. In this version (e.g., $d=50$), a new case is forced into the active set every $d$ generations regardless of performance, ensuring a consistent search gradient.

Experimental parameters used in the study.

The study utilized Lexicase Selection as the parent selection mechanism. Lexicase selection is particularly suited for this approach because it maintains population diversity by rewarding individuals that excel at different subsets of the training data, helping the population recover quickly from the "hyperselection" that can occur when a new, difficult counterexample is added.

Experimental Setup

The researchers evaluated iCDGP across 12 problems from the Program Synthesis Benchmark suite (PSB1), covering string manipulation, arithmetic, logic, and control flow. Training set sizes for these problems ranged from 100 to 250 cases.

Key Results and Discussion

The experimental results demonstrate that iCDGP significantly reduces the computational budget required to find solutions. By making each generation "cheaper" to evaluate, the system can explore the search space more deeply within the same total number of program executions.

Comparison of success rates across different GP methods and variants.

As shown in the results table, the $d=50$ variant emerged as the most robust configuration. It outperformed standard GP on 5 out of 12 problems and remained competitive across the rest. Notably, iCDGP performed comparably to down-sampled lexicase selection ($q=0.8$), a state-of-the-art method for handling large training sets.

Insights

  • Dynamic Search Gradients: The success of iCDGP highlights that adding counterexamples is far more effective than using a static small data subset. Counterexamples act as a "frontier," focusing the search on the specific edge cases the current population finds most challenging.
  • Diversity Resilience: While adding a difficult counterexample can initially lead to a bottleneck where only a few individuals survive, Lexicase Selection allows the population to recover its diversity almost immediately, preventing evolutionary dead ends.

Conclusion

Informal Counterexample-Driven Genetic Programming provides a practical, specification-free way to accelerate program evolution. By intelligently growing the training set through counterexamples, iCDGP offers a significant reduction in generational computation while maintaining competitive performance with more complex selection methods. Future work may explore more sophisticated strategies for selecting counterexamples when multiple failures occur, potentially further increasing the efficiency of the search.

Summary updated

BibTeX
@inproceedings{helmuth2024generational,
  author = {Thomas Helmuth and Edward R. Pantridge and James Gunder Frazier and Lee Spector},
  title = {{Generational Computation Reduction in Informal Counterexample-Driven Genetic Programming}},
  booktitle = {EuroGP},
  year = {2024},
  doi = {10.1007/978-3-031-56957-9\_2},
}
Figure