# Gene Expression Programming: a New Adaptive Algorithm for Solving Problems

Gene expression programming evolves programs by decoding linear chromosomes into trees

Candida Ferreira · arXiv · 2001-2-25

- **Problem** Genetic algorithms keep individuals easy to change but limit how complex they can express. Genetic programming trees are expressive but are hard to alter with genetic operators.
- **Method** Gene expression programming stores each individual as a fixed-length linear chromosome and decodes it into an expression tree. Operators edit the chromosome, while selection acts on the tree.
- **Results** On density classification, the evolved rule GEP1 reached accuracy 0.82513 on 100,000 unbiased initial configurations, against 0.824 for the cited GP rule.

## Why separate the genome from the body

GAs and GP share the same evolutionary loop: a population is kept, individuals are chosen by fitness, and variation comes from genetic operators. They differ in the individual itself. A GA individual is a linear string of fixed length, whereas a GP individual is a nonlinear tree of varying size and shape. The argument is that both kinds of system use one entity as both genome and body.

Such systems face a trade-off: when the entity is easy to manipulate genetically, its functional complexity stays low, and when it can express complex structures, it is hard to change through modification.

The phenotype threshold is the point where replicators act through their effects on something else, and the author argues that GAs and GP have not crossed it. Developmental genetic programming tried to cross this threshold by decoding binary strings into expressions, but many decoded strings are invalid, so much computation goes into repairing them, and its gain over GP is small.

GEP is proposed as a system with a genotype and a phenotype that are kept distinct: a linear chromosome is the genome that operators change, and an expression tree is the phenotype on which selection acts.

## Keeping every modification valid

Each gene has a head and a tail. The head may hold both functions and terminals, while the tail holds terminals only, and the head length h is chosen for each problem. The tail length follows from h and from n, the largest number of arguments of any function in the function set, through \\( t = h(n-1)+1 \\). For a function set with two-argument functions, n is 2 and the tail is h plus 1 symbol.

Because the gene length is fixed while the open reading frame varies, the termination point can fall before the end of the gene. The part after the termination point is noncoding and does not affect the decoded tree.

In an example with h = 10 and t = 11, the gene is 21 symbols long and its open reading frame ends at position 10, while the gene ends at position 20. Since the noncoding region absorbs any change, the operators need no repair step. The structure of the head and tail is kept by the operators, and every resulting chromosome still decodes to a syntactically correct program.

## Reading a chromosome as an expression tree

The first position of the open reading frame gives the root of the tree. Each function receives as many branches below it as it has arguments, and building stops once only terminals remain. The string that results from reading the tree left to right and top to bottom is the K-expression. For the tree in the example, the K-expression is Q\*+-abcd, read from position 0 to position 7.

This ordering differs from the postfix and prefix notations that earlier GP implementations used with arrays or stacks.

## Combining genes into one program

A multigenic chromosome holds several genes of equal length. Each gene's open reading frame is decoded into its own sub-tree, so a chromosome of length 27 with three genes yields three sub-trees. In the example, the three open reading frames end at positions 4, 5 and 5, so each sub-tree has its own size.

Sub-trees are joined by posttranslational linking with a chosen function. Addition or multiplication is typical for algebraic sub-trees, and OR or IF is typical for boolean ones. The root of the joined tree is not encoded in the genome. The linking function is fixed for each problem, though it could be placed in the chromosome and adapted.

The author argues that small building blocks, each coded by its own gene, can evolve separately and combine into complex structures. The text states that single-gene chromosomes would make the symbolic regression success rate fall significantly, which is the motivation for multigenic chromosomes. For the 11-multiplexer and the density-classification problem, the chromosome has an IF-based architecture in which sub-trees are linked in clusters of three.

## How individuals are scored and chosen

For symbolic regression, the fitness of a program depends on whether its error on each fitness case falls inside a range of selection M, using either absolute or relative error. A perfect fit receives the maximum fitness, which equals Ct times M, where Ct is the number of fitness cases. A broad initial range, such as a relative error of 20%, lets evolution start from unfit founders, whose descendants are reshaped by selection.

Narrowing the range too early stalls populations, while widening it too far gives many solutions with maximum fitness that are far from good.

For boolean concept learning, fitness counts the fitness cases a program answers correctly. Programs that solve about half the cases are penalized, because that level can be reached by chance on a binary function, so only programs solving more than 50 to 75 percent of the cases are rewarded. The count-based fitness uses n, the number of correctly evaluated cases, out of Ct, the total number of fitness cases.

Parents are chosen by roulettewheel sampling, with the best individual cloned into the next generation as elitism. Preliminary runs found no clear difference between roulette and tournament selection, provided the best individual is cloned. For more complex problems, roulette selection with elitism seemed best.

## Genetic operators on the chromosome

Replication copies the selected chromosomes, and the roulette is spun once per individual so that the population size stays the same. Replication alone adds no variation. Mutation changes symbols in the head to any function or terminal, and changes symbols in the tail only to terminals. A typical mutation rate is equivalent to two point mutations per chromosome.

IS elements are short fragments that transpose into the head of a gene, and RIS elements transpose to the root. Typically the IS transposition rate is 0.1, with three IS elements of different lengths.

One-point and two-point recombination exchange material between two paired chromosomes at one or two cut points. Gene recombination exchanges entire genes at the same position, so it rearranges existing genes but creates none. A typical global crossover rate is 0.7, the sum of the three recombination rates. A chromosome may be picked by none or several operators in one generation, and an operator does not modify the same chromosome more than once.

Modifications from several operators therefore accumulate across reproduction.

## Symbolic regression success rates

The target is y = a4 + a3 + a2 + a, sampled at 10 points, and a solution must fit within 0.01 of the target. The function set is {+, -, \*, /} and the terminal set is {a}. The success-rate analyses use a population of 30 individuals, 50 generations, a mutation rate equivalent to two one-point mutations per chromosome, a recombination rate p1r of 0.7, and 100 identical runs.

Success rate is first studied against chromosome length, starting from short single-gene chromosomes and increasing h. A compact chromosome with h = 6 decodes to a tree equivalent to the target, and large head lengths also evolve solutions, so the most compact genome was not always the most efficient one.

Success rate also depends on the number of generations. The author contrasts this with GP, where 51 generations are described as the norm, and argues that GEP can keep adapting because new material enters the gene pool.

## Block stacking plans

The function set is {C, R, N, A}, with C and R moving blocks to and from the stack, N negating a predicate, and A repeating an action until a condition is true. The sensors are u, t and p, for the current stack, the top correct block and the next needed block. The problem uses a multigenic system of three genes, each of length 9, whose sub-plans execute in sequence.

Fitness scores each empty stack with 1 point, each partially and correctly packed stack with 2 points, and each completely and correctly stacked word with 3 points, so the maximum is 30. Fitness is tested on an empty stack plus nine random initial configurations per generation, and the empty stack guards against runs ending early.

The probability of success is 0.70 with nine out of 10 random initial configurations, while GP uses 167 fitness cases chosen to cover classes of configurations.

## Setting up the density-classification search

The density-classification rule is applied in parallel to a wrap-around row of N binary cells, with each cell connected to neighbours on both sides. The common version uses N = 149 and a neighbourhood of 7 cells. In the GEP search, the rules are scored on 25 unbiased initial configurations, and a rule's fitness counts configurations that settle to all 0s or all 1s after 2 times N time steps.

Rules that settle into an alternating pattern are eliminated, and a rule that classifies both majorities correctly receives a bonus equal to the number of configurations C.

## Accuracy and cost against GP

The GEP1 rule was found in generation 27 of run 5 with fitness 44, and its open reading frame ends at position 28. It reached accuracy 0.82513 on 100,000 unbiased initial configurations in a 149x298 lattice. The cited GP rule reached 0.824, but it was tested in a 149x320 lattice, so the two values come from different lattice sizes. A second rule, with IF and majority functions and three-gene chromosomes, reached 82.55% accuracy.

The GP run cited uses 51,200 individuals, 1,000 initial configurations and 51 generations, which the paper multiplies to 2,611,200,000 fitness evaluations. The GEP run uses 30 individuals, 25 initial configurations and 50 generations, giving 37,500 fitness evaluations. The ratio of the two counts is 69,632, which the author describes as more than four orders of magnitude.

This compares evaluation counts, not wall-clock time.

## What each operator adds to the search

Six dynamics are compared in populations of 500 individuals over 500 generations. Plot 1 uses all operators, and the other plots isolate mutation, combinations of gene recombination with gene transposition, one-point recombination, two-point recombination and gene recombination. The author notes that the average fitness oscillates even after a perfect solution is found.

A small population partly causes these oscillations, but the same pattern appears with larger populations.

When gene recombination is the only operator, the symbolic regression run did not find a perfect solution. The author takes this to show that shuffling existing building blocks cannot always produce a perfect solution. The author adds that recombination produces a homogenizing effect, and that gene recombination with gene transposition still produces oscillatory dynamics.

## Limits of the evidence

The GEP and GP accuracies come from different lattice sizes, 149x298 and 149x320, so they are not measured under the same test conditions. The cost comparison counts fitness evaluations for the runs described, and the GP counts depend on the population, configuration and generation values quoted from the cited work.

The block stacking result uses nine random configurations per generation, and the run with 10 random configurations is reported without results. Gene recombination alone failed to reach a perfect solution in the run shown, and the text presents this only for that one run.

## Paper info

- **Authors**: Candida Ferreira
- **Venue**: arXiv · Preprint
- **First published**: 2001-2-25
- **Added**: 2026-11-12
- **Updated**: 2001-12-30
- **Version**: v3
- **arXiv**: cs/0102027
- **Category**: cs.AI · cs.NE
- **Original paper terms**: [Check in the original ↗](https://arxiv.org/abs/cs/0102027v3)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/cs/0102027v3) · [PDF ↗](https://arxiv.org/pdf/cs/0102027v3)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Candida Ferreira (2001). Gene Expression Programming: a New Adaptive Algorithm for Solving Problems. arXiv:cs/0102027v3. https://arxiv.org/abs/cs/0102027v3

**BibTeX**

```
@misc{ferreira2001gene,
  title = {{Gene Expression Programming: a New Adaptive Algorithm for Solving Problems}},
  author = {Candida Ferreira},
  year = {2001},
  eprint = {cs/0102027},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/cs/0102027v3}
}
```

## Other paper commentary

- [DoReFa-Net: Training Low Bitwidth Convolutional Neural Networks with Low Bitwidth Gradients](https://refivu.com/en/papers/2b8264c6-509a-4bef-bf4f-0e373a15bf5f-dorefa-net-training-low-bitwidth-convolutional-neural.md)
- [Deep Interest Network for Click-Through Rate Prediction](https://refivu.com/en/papers/436010e9-a2e2-4bc6-b152-9c915305a90b-deep-interest-network-for-click-through-rate-prediction.md)
- [Time Series Classification from Scratch with Deep Neural Networks: A Strong Baseline](https://refivu.com/en/papers/8883de27-afd8-4d47-acd8-ad01a7dfe332-time-series-classification-from-scratch-with-deep-neural.md)
- [Temporal Ensembling for Semi-Supervised Learning](https://refivu.com/en/papers/5823cdfc-4033-4589-9f86-a6c88d27f620-temporal-ensembling-for-semi-supervised-learning.md)
- [Modeling Long- and Short-Term Temporal Patterns with Deep Neural Networks](https://refivu.com/en/papers/2ced2044-9976-4c74-bbf8-ff344f253f42-modeling-long-and-short-term-temporal-patterns-with.md)
- [PoseNet: A Convolutional Network for Real-Time 6-DOF Camera Relocalization](https://refivu.com/en/papers/d88e659c-e7cf-4fb4-acf4-46e297868666-posenet-a-convolutional-network-for-real-time-6.md)
- [Online Learning for Matrix Factorization and Sparse Coding](https://refivu.com/en/papers/1ce2d052-c0f8-40f5-8ef8-2c82aed1ea18-online-learning-for-matrix-factorization-and-sparse-coding.md)
- [Asymptotic Equivalence of Bayes Cross Validation and Widely Applicable Information Criterion in Singular Learning Theory](https://refivu.com/en/papers/af4e7ac9-4c58-4c62-938e-efd2bc4d7bd5-asymptotic-equivalence-of-bayes-cross-validation-and-widely.md)
- [Supervised Learning of Universal Sentence Representations from Natural Language Inference Data](https://refivu.com/en/papers/3b717e36-7795-4260-9240-213b394ce804-supervised-learning-of-universal-sentence-representations.md)
- [Deep Speech: Scaling up end-to-end speech recognition](https://refivu.com/en/papers/ace0f457-6253-437c-903d-54b5979d9074-deep-speech-scaling-up-end-to-end-speech.md)
- [ResUNet-a: a deep learning framework for semantic segmentation of remotely sensed data](https://refivu.com/en/papers/e379f4f3-b44b-4709-bcbb-3cde82b7fd42-resunet-a-a-deep-learning-framework-for-semantic.md)
- [Natural Language Processing: State of The Art, Current Trends and Challenges](https://refivu.com/en/papers/96f7443d-3832-4114-ab52-f019f5aec932-natural-language-processing-state-of-the-art-current.md)

## Terms in this paper

- [Accuracy](https://refivu.com/en/terms/1995c0cd6282-accuracy)
- [Success rate](https://refivu.com/en/terms/0964df1dc5eb-success-rate)
- [symbolic regression](https://refivu.com/en/terms/f5306c15b8e3-symbolic-regression)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/69b85116-2014-41bf-86f4-a3f191b7bf3d-gene-expression-programming-a-new-adaptive-algorithm-for)
