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

Probabilistic Structured Grammatical Evolution

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

TL;DR

The paper introduces Probabilistic Structured Grammatical Evolution (PSGE), a novel Genetic Programming variant that fixes the structural instability of standard Grammatical Evolution. By combining a high-locality genotype representation with an adaptive, probabilistic grammar, PSGE successfully guides the evolutionary search toward better solutions. It statistically outperforms standard Grammatical Evolution across all evaluated benchmarks and beats Probabilistic Grammatical Evolution on most of them.

What Problem Does This Paper Address?

In grammar-based Genetic Programming (GP), we use a Context-Free Grammar (CFG) to define the syntax of the solutions we want to evolve. Standard Grammatical Evolution (GE) represents individuals as a flat list of integers (codons). During the mapping process, these integers determine which grammar rules to apply using a simple modulo operation.

However, standard GE suffers from two major flaws:

  1. Low Locality: It is incredibly brittle. A tiny change (mutation) at the beginning of the integer list can completely alter how the rest of the list is interpreted, drastically changing the final solution (phenotype). This turns a structured evolutionary search into something closer to a random search.
  2. High Redundancy: Many different integer sequences map to the exact same solution, wasting computational effort.

Prior works tried to solve these issues separately. Structured Grammatical Evolution (SGE) fixed the representation by giving each grammar symbol its own distinct list, improving locality. Probabilistic Grammatical Evolution (PGE) introduced a Probabilistic CFG (PCFG) to dynamically bias the grammar toward rules that worked well in previous generations.

This paper addresses the clear next step: How can we combine the structural stability of SGE with the adaptive guidance of PGE?

Methods

The authors propose Probabilistic Structured Grammatical Evolution (PSGE). Instead of a flat integer array, an individual's genotype in PSGE is a set of dynamic lists of real numbers [0, 1], with exactly one list dedicated to each non-terminal symbol in the grammar.

Here is how the core pipeline works:

  • Probabilistic Mapping: When expanding a non-terminal symbol, PSGE looks at the corresponding list in the genotype. The real-valued codon selects a production rule based on predefined probability intervals in a Probabilistic Context-Free Grammar (PCFG).
  • Safe Depth-Limiting: If the mapping process hits the maximum allowed depth limit, PSGE dynamically adjusts the PCFG on the fly, re-weighting the probabilities so that only non-recursive rules can be chosen. This guarantees valid individuals are always generated without the risk of code bloat.
  • Feedback Loop (Learning): At the end of each generation, the algorithm evaluates the best individual. It increases the selection probability for the specific grammar rules that the champion used, while lowering the probabilities for unused rules. This updates the PCFG for the next generation, smoothly shifting the search space bias using a learning factor ($\lambda$).
  • Variation Operators: PSGE uses a Gaussian mutation to make small, localized tweaks to individual codons, and a mask-based crossover that swaps entire non-terminal lists between parents, preserving structural building blocks.

Datasets

The authors evaluated PSGE against standard GE, PGE, and SGE using six classic Genetic Programming benchmark problems:

  1. Quartic Polynomial (Symbolic Regression)
  2. Pagie Polynomial (Symbolic Regression)
  3. Boston Housing (Symbolic Regression, split into 90% training / 10% testing)
  4. 5-bit Even Parity (Boolean Logic)
  5. 11-bit Boolean Multiplexer (Boolean Logic)
  6. Santa Fe Artificial Ant (Pathfinding/Logic)

No new datasets were introduced; these are standard, widely accepted benchmarks in the GP community.

Key Insights and Ideas

  • The Best of Both Worlds: PSGE proves that representation and grammar bias are complementary. SGE's representation keeps mutations localized, while PGE's adaptive grammar ensures the algorithm spends less time exploring dead ends.
  • Automatic Grammar Specialization: As the generations progress, the PCFG evolves alongside the population. By the end of a run, the user is left with a highly specialized grammar tailored specifically to the problem, explicitly highlighting which rules were crucial for success.
  • Generalization Capabilities: In the Boston Housing test, PSGE showed a slight improvement in test performance over training performance compared to GE, hinting that the probabilistic constraints might help prevent overfitting.

Key Results

The performance of the algorithms was tracked over 50 generations across 100 independent runs. Non-parametric statistical tests (Kruskal-Wallis and Mann-Whitney post-hoc with Bonferroni correction) were used to validate the results.

  • PSGE vs. GE: PSGE statistically outperformed standard GE on all 6 benchmark problems with significant effect sizes.
  • PSGE vs. PGE: PSGE outperformed PGE on 4 out of 6 problems (Quartic Polynomial, 5-bit Parity, 11-bit Multiplexer, and Santa Fe Ant).

For example, in the Quartic Polynomial benchmark, PSGE and SGE rapidly decreased error rates, leaving PGE and GE far behind:

Fig. 7. Performance results for the Quartic Polynomial. Results are the mean best fitness of 100 runs.

However, PGE still held an advantage in specific highly non-linear spaces, such as the Pagie Polynomial, where it achieved the best average fitness:

Fig. 8. Performance results for the Pagie Polynomial. Results are the mean best fitness of 100 runs.
  • PSGE vs. SGE: PSGE performed similarly to SGE, never statistically outperforming it, but matching its high standard while offering the added benefit of an interpretable, evolved grammar.

Limitations and Future Work

While PSGE successfully mitigates the flaws of standard GE and outperforms PGE, it does not outperform pure SGE on these benchmarks. The authors note that the primary advantage of PSGE over SGE isn't raw performance, but rather the creation of the specialized PCFG.

Future Directions: * Grammar Transfer Learning: Using a specialized PCFG evolved from one problem as the starting initialization for a new, similar problem. * Alternative Initializations: Testing how PSGE handles grammars initialized with random probabilities or entirely different structural designs. * Human-in-the-Loop Guidance: Manually injecting domain knowledge into the PCFG probabilities before the run starts to guide the evolutionary search.

Summary updated

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