Skip to main content

TinyverseGP: Minimalistic implementations of different representations for Genetic Programming

arXiv discord license python-version

TinyverseGP is a collection of minimalistic implementations of different representations for Genetic Programming. The goal is to provide a simple and easy-to-understand codebase with the following goals in mind:

  • Minimalistic: The codebase should be as small as possible, while still being able to demonstrate the core concepts of the representation.
  • Educational: The codebase should be easy to understand and serve as a starting point for learning about Genetic Programming.
  • Extensible: The codebase should be easy to extend and modify, so that it can be used as a basis for further research and experimentation.
  • Benchmarking: The codebase should be able to run on standard benchmark problems and datasets, so that it can be used to compare different representations and algorithms.

The codebase is written in Python trying to keep the requirements to a minimal. The codebase is organised into different modules, each of which implements a different representation for Genetic Programming. The following representations are currently implemented:

  • Tree-based Genetic Programming (TGP) (also known as Koza-style): the programs are represented as trees. This version supports multi-tree chromosomes, where each individual is represented by a set of trees when the problem requires multiple outputs.
  • Cartesian Genetic Programming (CGP): the programs are represented graphs and naturally encodes multiple outputs with shared components.
  • Linear Genetic Programming (LGP): the programs are represented as a sequence of instructions with memory registers.
  • Grammatical Evolution (GE): the programas are generated following an specified grammar.

This repository is organized as follows:

  • src/gp: contains the core implementation of the different representations.
    • tiny_tgp.py: implementation of Tree-based Genetic Programming (TGP).
    • tiny_cgp.py: implementation of Cartesian Genetic Programming (CGP).
    • tiny_lgp.py: implementation of Linear Genetic Programming (LGP).
    • tiny_ge.py: implementation of Grammatical Evolution (GE).
    • tineverse.py: the abstract classes for GP, Config, Hyperparameters, and Function set.
    • functions.py: the standard set of functions currently supported.
    • problem.py: the abstract class for the problem to be solved. It includes the example based problem (black-box), policy search, and program synthesis.
    • loss.py: currently supported loss functions.
  • src/llm: contains the interfaces for the use of LLM's
  • src/hpo: contains the interfaces for the use hyperparameter optimisation tools
  • src/benchmark: contains the benchmark problems and datasets.
    • symbolic_regression/sr_benchmark.py: sample symbolic regression benchmark problems.
    • symbolic_regression/srbench.py: interface to the SRBench benchmark suite.
    • logic_synthesis/ls_benchmark.py: sample logic synthesis benchmark problems.
    • logic_synthesis/lsbench/lsbench.py: interface to the GBFS/LSBench benchmark.
    • policy_search/policy_evaluation.py: interface to the gymnasium environment.
  • examples: examples on how to use the different benchmarks.

Requirements and testing

The current version supports Python3.10. To install the requirements it is suggest to run:

python3 -m venv env
. env/bin/activate
pip3 install .

If you have a different Python version, you can use Pyenv to switch between versions:

pyenv install 3.10
pyenv sell 3.10

NOTE: we currently do not support Python versions higher than 3.10 due to an issue with one of the dependencies (see here)

To run the examples, you can use one of the following command:

python3 -m examples.symbolic_regression.test_cgp_sr
python3 -m examples.symbolic_regression.test_tgp_sr
python3 -m examples.logic_synthesis.test_cgp_ls
python3 -m examples.logic_synthesis.test_tgp_ls
python3 -m examples.policy_learning.test_cgp_pl
python3 -m examples.policy_learning.test_cgp_pl_ale
python3 -m examples.policy_learning.test_tgp_pl
python3 -m examples.program_synthesis.test_cgp_ps
python3 -m examples.program_synthesis.test_tgp_ps
python3 -m examples.hpo.test_cgp_sr
python3 -m examples.hpo.test_tgp_sr

or any other script in that folder.

Contributing

This repository is kept under a Github Organization to allow for a more inviting environment for contributions. The organisation will not be tied to any specific institution and will be open to all contributors. If you want to contribute, please contact the maintainers to be added to the organisation as a maintainer. The codebase is still in its early stages and contributions are welcome. If you have any suggestions, bug reports, or feature requests, please open an issue, submit a pull request or open a new discussion.

Creating a new representation module

To create a new representation, you can follow the following steps:

  • Create a new Python script in the src/gp folder with the implementation of the representation. As a convention, name the script tiny_<first letter of the representation>gp.py. For example, tiny_tgp.py for Tree-based Genetic Programming and tiny_cgp.py for Cartesian Genetic Programming.

  • Implement the representation as a class and create a Tiny<first letter of the representation>GP class that inherits from the GPModel class. The GPModel class is an abstract class that defines the interface for the different representations. This class should contain the following fields:

  • config: the configuration class inherited from Config abstract class.

  • hyperparameters: the hyperparameters class inherited from Hyperparameters abstract class.

  • problem: the problem class.

  • functions: a list of functions (non-terminals)

  • Implement the following methods in the Tiny<first letter of the representation>GP class:

    • init_population: the initialisation function for the population.
    • fitness(self, individual): the fitness function of a single individual.
    • pipeline(self): the function for the evolutionary pipeline including breeding and selection
    • selection(self): the selection method that selects individuals for recombination and perturbation.
    • predict(self, genome, observation): the prediction method that predicts the output of genome to a single observation.
    • expression(self, genome): the expression method that returns the expression represented by genome.

Creating a new problem domain module

To create a new problem domain, you can follow the following steps:

  • Update the file src/gp/problem.py with a new class that inherits from the Problem abstract class. This class should contain the following methods:
    • is_ideal(self, fitness): a method that returns True if the fitness reached an ideal state (i.e., known optima).
    • is_better(self, fitness1, fitness2): a method that returns True if fitness1 is better than fitness2.
    • evaluate(self, genome, GPModel): a method that instructs how to evaluate a given genome using a GPModel

A good starting point is to look at the BlackBox and PolicySearch classes in the problem.py file which gives examples of two very different problem domains.

Finally, if you want to create an interface to an existing benchmark suite, you can look at the examples in:

  • src/benchmark/symbolic_regression/srbench.py: interface to the SRBench benchmark suite.
  • src/benchmark/logic_synthesis/boolean_benchmark_tools/: interface and evaluator for the GFBS benchmarks.

Roadmap

See Roadmap.md for the current roadmap.

Collaborators

Roman Kalkreuth (RWTH Aachen, Germany) - Initial implementation of the TineverseGP framework, including the initial implementation of the TinyCGP representations.

Fabricio Olivetti de Franca (Universida de Federal do ABC) - Initial implementation of the TinyTGP representation and inclusion of SRBench interface.

Julian Dierkes (RWTH Aachen, Germany) - Inclusion of policy search problem domain.

Zdenek Vasicek (Brno University, Czech Republic) - Inclusion of logic synthesis problem domain.

Marie Anastacio, Anja Jankovic (RWTH Aachen, Germany) - Inclusion of the interfaces for hyperparameter optimisation (HPO).

Holger Hoos (RWTH Aachen, Germany) - Advisory role in the areas of hyperparamter optimisation and automated machine learning (AutoML).

Dominik Sobania (University of Duisburg-Essen, Germany) - Implementation of Grammatical Evolution and LLM interface.

Giovanni Squillero (Politecnico di Torino, Italy) - Implementation of Linear GP.

Alberto Tonda (Institut National de Recherche pour l'Agriculture, l'Alimentation et l'Environnement, France) - Implementation of Linear GP.

Thijs Snelleman (RWTH Aachen, Germany) - Supervision of development practices

Accepted peer-reviewed work

A short paper that proposes the first prototype of TinyverseGP has been accepted for poster presentation at the Genetic and Evolutionary Computation Conference (GECCO'25). The paper can be obtained from arXiv.

Roman Kalkreuth, Fabricio Olivetti de França, Julian Dierkes, Marie Anastacio, Anja Jankovic, Zdenek Vasicek, and Holger Hoos. 2025. TinyverseGP: Towards a Modular Cross-domain Benchmarking Framework for Genetic Programming. In Genetic and Evolutionary Computation Conference (GECCO ’25 Companion), July 14–18, 2025, Malaga, Spain. ACM, New York, NY, USA, 4 pages. https://doi.org/10.1145/3712255.3726697

LICENSE

This work is under GNU General Public License, Version 3.

Acknowledgements

This work was supported by an Alexander von Humboldt Professorship in AI held by Holger Hoos, the Czech Science Foundation project 25-15490S and Conselho Nacional de Desenvolvimento Cientifico e Tecnologico (CNPq) grant 301596/2022-0.

Metadata

Release files for TinyverseGP 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for TinyverseGP 0.0.2
File Size Uploaded
tinyversegp-0.0.2.tar.gz 79.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for TinyverseGP 0.0.2
File Interpreter ABI Platform
tinyversegp-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 172.4 kB

Release files / tinyversegp-0.0.2.tar.gz

Download URL tinyversegp-0.0.2.tar.gz
Size 79.9 kB
Tags Source
SHA-256 checksum
How to use checksums
48ca7200fe79eab2ff3195c825ac4f21d406279d6219f537eddd6f9b19057e8f
BLAKE2b-256 checksum
How to use checksums
6f44f714c30e1f88b2fab74ffca06c8a29fb89df72d5413fe30b51d048fe7266
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 23, 2026.

Transparency log

Release files / tinyversegp-0.0.2-py3-none-any.whl

Download URL tinyversegp-0.0.2-py3-none-any.whl
Size 92.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b401dc037a826e3c9fc1ecd8d47bc6d2d558fa2db4f5f0f03d003859eb81c3d0
BLAKE2b-256 checksum
How to use checksums
faa26f96df0df956d649420b01fa29bd6fc8865aa39153a18a0e2fa13eb873e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 23, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page