NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Co-evolutionary Probabilistic Structured Grammatical Evolution

Jessica Mégane, Nuno Lourenço, Penousal MachadoarXiv 2022 · DOI

TL;DR

Co-evolutionary Probabilistic Structured Grammatical Evolution (Co-PSGE) enhances genetic programming by giving every individual in a population its own unique, evolving grammar. By co-evolving production rule probabilities alongside standard genotypes, the algorithm dynamically adapts its search space, significantly outperforming traditional Grammatical Evolution (GE) variants on complex symbolic regression and logic benchmarks.

What Problem Does This Paper Address?

Grammatical Evolution (GE) is a popular tool for automatically generating computer programs or mathematical expressions using a Context-Free Grammar (CFG). However, standard GE suffers from two major flaws: low locality (small changes in the genetic code cause massive, unpredictable changes in the final program) and high redundancy (many different genetic codes map to the exact same program).

Structured Grammatical Evolution (SGE) was previously introduced to fix these issues by organizing the genotype into distinct, dynamic lists for each non-terminal symbol in the grammar. Yet, standard SGE relies on a static grammar where every production rule has an equal chance of being chosen. Because the design of a grammar heavily dictates how effectively an algorithm navigates the search space, using a rigid, unbiased grammar can slow down convergence or cause the algorithm to get stuck in local optima.

Methods

The authors introduce Co-PSGE, which replaces the static grammar of SGE with an individualized Probabilistic Context-Free Grammar (PCFG) for every single solution in the population.

Here is how it works:

  • Genotype Representation: Instead of integers (like standard GE), the genotype consists of lists of real numbers bounded between $[0, 1]$. Each list corresponds to a specific non-terminal symbol in the grammar.
  • Individualized Grammars: Each individual carries its own set of probabilities for its grammar's production rules. During the genotype-to-phenotype mapping, these probabilities determine which rule is selected based on the genotype's real values.
  • Co-evolution via Variation Operators: The grammar isn't static; it evolves. At the end of each generation, the grammar probabilities undergo a Gaussian mutation (adding a small random value from a normal distribution). To maintain valid probabilities, the remaining rules for that non-terminal are re-adjusted so they sum to 1. During crossover, the offspring inherits the grammar of the fitter parent.

The difference in mapping can be contrasted between standard GE's integer-modulo approach and Co-PSGE's probabilistic interval approach:

Figure 2: Example of the genotype-phenotype mapping of GE.
Figure 4: Example of the genotype-phenotype mapping of Co-PSGE with a PCFG.

Datasets

The approach was evaluated using four standard genetic programming benchmarks:

  1. Pagie Polynomial: A highly non-linear, two-input symbolic regression problem ($x[1], x[2] \in [-5, 5]$).
  2. Boston Housing Dataset: A real-world machine learning dataset containing 506 entries and 13 features, split into 90% training and 10% testing to predict housing prices.
  3. 5-bit Even Parity: A logic problem where the system must determine if a 5-bit binary string contains an even number of ones.
  4. 11-bit Boolean Multiplexer: A logic problem requiring the system to decode a 3-bit address to retrieve data from 8 registers.

Key Insights and Ideas

  • Dynamic Search Space Adaptation: By allowing individual grammars to mutate, the algorithm can automatically "warp" the search space landscape for specific lineages, making successful structural components much more likely to appear in future generations.
  • Emergence of Universal Components: In the 5-bit even parity problem, the average probability of selecting the NOR production rule skyrocketed to over 90% in successful runs. Because NOR is a universal logic gate, the co-evolving grammar independently discovered its utility and biased the search space to exploit it, leading to a massive performance leap.
  • Better Generalization: On the Boston Housing dataset, Co-PSGE did not show a significant edge over standard SGE during training, but it performed significantly better on the unseen test data. This implies that mutating grammar probabilities acts as a form of regularization, preventing overfitting and yielding more generalized models.

Key Results

The authors compared Co-PSGE against standard GE, Probabilistic GE (PGE), and standard SGE over 100 independent runs per problem. Statistical significance was verified using Kruskal-Wallis and Mann-Whitney post-hoc tests ($\alpha = 0.05$).

  • vs. GE: Co-PSGE comprehensively outperformed standard GE across all four problems with statistically significant, large effect sizes.
  • vs. PGE: Co-PSGE achieved significantly better fitness in three out of the four problems (Boston Housing Test, 5-bit Parity, and 11-bit Multiplexer).
  • vs. SGE: Co-PSGE performed significantly better in two problems. In the 5-bit parity problem, Co-PSGE's fitness curve dropped much faster, achieving a final error rate less than half that of standard SGE.

For the Pagie Polynomial, PGE ultimately achieved the lowest mean best fitness after 50 generations, though Co-PSGE converged faster in the initial generations:

Figure 8: Performance results for the Pagie polynomial. Results are the mean best fitness of 100 runs.

Limitations and Future Work

While Co-PSGE shows clear advantages, the authors note a few areas for improvement:

  • Locality and Redundancy Metrics: Although SGE inherently fixes GE's structural locality issues, the exact impact of mutating grammars on locality and redundancy metrics has not yet been formally quantified.
  • Initialization Strategies: All individual grammars were initialized uniformly (equal probabilities for all rules). Performance might improve by seeding populations with non-uniform or diverse grammar biases.
  • Problem Scope: Future work will involve testing Co-PSGE on multi-objective optimization problems to see if individual grammar biases can help balance competing objectives.

Summary updated

BibTeX
@misc{megane2022co,
  author = {Jessica Mégane and Nuno Lourenço and Penousal Machado},
  title = {{Co-evolutionary Probabilistic Structured Grammatical Evolution}},
  year = {2022},
  eprint = {2204.08985},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2204.08985},
}
Figure