A modular, minimalistic, and cross-domain benchmarking framework for Genetic Programming β written in pure Python.
A common, lightweight home for a growing family of GP implementations and benchmarks.
TinyverseGP is an open-source Python framework that bundles minimalistic implementations of the most popular Genetic Programming (GP) representations under one roof. Whether you are a student learning about evolutionary computation, a researcher running cross-domain experiments, or an engineer looking for a clean baseline β TinyverseGP is designed for you.
The framework ships with ready-to-use benchmark interfaces for Symbolic Regression, Logic Synthesis, Policy Search, and Program Synthesis, letting you compare representations on equal footing with minimal boilerplate.
A short paper introducing TinyverseGP has been accepted for poster presentation at GECCO 2025. Read it on arXiv.
Four representations are currently implemented, each in a single self-contained file.
Classic Koza-style GP. Programs are represented as expression trees. Supports multi-tree chromosomes for problems with multiple outputs.
src/gp/tiny_tgp.py
Programs are represented as directed acyclic graphs with fixed topology. Naturally supports multiple outputs through shared computation nodes.
src/gp/tiny_cgp.py
Programs are sequences of register-machine instructions. Efficient representation for imperative-style evolved programs.
src/gp/tiny_lgp.py
Genotypes are integer sequences decoded via a user-supplied BNF grammar, enabling flexible program synthesis in any target language.
src/gp/tiny_ge.py
All representations can be benchmarked across multiple domains through a shared problem API.
Discover mathematical expressions that fit a dataset. Interfaces to the SRBench suite are included.
Evolve Boolean circuits and combinational logic. Benchmarks from GBFS / LSBench are supported out of the box.
Learn interpretable control policies for Gymnasium environments including classic control and Atari (ALE).
Automatically generate programs that satisfy a set of input/output examples β a classic AI benchmark for GP.
TinyverseGP requires Python 3.10. Follow the steps below to install and run your first experiment.
Get the source code from GitHub.
git clone https://github.com/GPBench/TinyverseGP.git
cd TinyverseGP
If you have multiple Python versions installed, use pyenv to switch to 3.10:
# Optional β if you need to install Python 3.10 via pyenv
pyenv install 3.10
pyenv shell 3.10
# Create and activate a virtual environment
python3 -m venv env
source env/bin/activate # Windows: env\Scripts\activate
Install the package including its dependencies from PyPi:
pip install tinyversegp
Note: Python versions above 3.10 are currently not supported due to a dependency limitation. See the upstream issue.
Try symbolic regression with Cartesian GP β one of the simplest experiments to get started.
python3 -m examples.symbolic_regression.test_cgp_sr
Or with Tree-based GP:
python3 -m examples.symbolic_regression.test_tgp_sr
All examples live in examples/ and can be run with
python3 -m <module>.
| Domain | Representation | Module |
|---|---|---|
| Symbolic Regression | CGP | examples.symbolic_regression.test_cgp_sr |
| Symbolic Regression | TGP | examples.symbolic_regression.test_tgp_sr |
| Logic Synthesis | CGP | examples.logic_synthesis.test_cgp_ls |
| Logic Synthesis | TGP | examples.logic_synthesis.test_tgp_ls |
| Policy Learning | CGP | examples.policy_learning.test_cgp_pl |
| Policy Learning (ALE) | CGP | examples.policy_learning.test_cgp_pl_ale |
| Policy Learning | TGP | examples.policy_learning.test_tgp_pl |
| Program Synthesis | CGP | examples.program_synthesis.test_cgp_ps |
| Program Synthesis | TGP | examples.program_synthesis.test_tgp_ps |
| HPO (SR) | CGP | examples.hpo.test_cgp_sr |
| HPO (SR) | TGP | examples.hpo.test_tgp_sr |
Running CGP on a symbolic regression task in a few lines.
from src.gp.tiny_cgp import TinyCGP, CGPConfig, CGPHyperparameters
from src.gp.functions import default_functions
from src.benchmark.symbolic_regression.sr_benchmark import get_problem
# 1. Define the problem
problem = get_problem("koza1")
# 2. Configure the algorithm
config = CGPConfig(
global_seed=42, num_jobs=1, max_generations=200,
stopping_criteria=0.0, minimizing_fitness=True,
ideal_fitness=0.0, silent_algorithm=False,
silent_evolver=False, minimalistic_output=False,
num_outputs=1, report_interval=10, max_time=3600,
n_cols=10, n_rows=1, levels_back=10,
)
hyperparams = CGPHyperparameters(
pop_size=100, mutation_rate=0.05,
cx_rate=0.0, tournament_size=3,
)
# 3. Run the evolution
model = TinyCGP(config, hyperparams, problem, default_functions())
best = model.evolve(problem)
print("Best expression:", model.expression(best.genome))
print("Best fitness :", best.fitness)
TinyverseGP is a community-driven project. We welcome contributions of all kinds!
Implement Push GP, Stack-based GP, or any other representation following the
GPModel abstract interface.
Add problem classes that inherit from Problem and expose your
favourite benchmark suite to all representations.
Found something broken? Open an issue on GitHub or submit a pull request with a fix and a regression test.
Improve docstrings, write tutorials, or extend this website with new content.
Add unit tests, integration tests, or replicate published experimental results using TinyverseGP.
Contribute new crossover, mutation, or selection operators β either representation- specific or agnostic.
TinyverseGP is developed by an international team of researchers.
If you use TinyverseGP in your research, please cite our paper:
@inproceedings{kalkreuth2025tinyversegp,
author = {Kalkreuth, Roman and de Fran{\c c}a, Fabricio Olivetti and
Dierkes, Julian and Anastacio, Marie and Jankovic, Anja and
Vasicek, Zdenek and Hoos, Holger},
title = {{TinyverseGP}: Towards a Modular Cross-domain Benchmarking
Framework for Genetic Programming},
booktitle = {Companion Proceedings of the Genetic and Evolutionary
Computation Conference (GECCO '25 Companion)},
year = {2025},
month = jul,
address = {Malaga, Spain},
publisher = {ACM},
doi = {10.1145/3712255.3726697},
}
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 CientΓfico e TecnolΓ³gico (CNPq) grant 301596/2022-0.