🧬 TinyverseGP

A modular, minimalistic, and cross-domain benchmarking framework for Genetic Programming β€” written in pure Python.

About TinyverseGP

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.

  • πŸ”¬
    Minimalistic Each representation is self-contained in a single, readable Python file β€” no hidden magic, no bloated abstractions.
  • πŸŽ“
    Educational Clear code structure and docstrings make the framework an ideal starting point for learning about GP and evolutionary computation.
  • πŸ”Œ
    Extensible A well-defined abstract interface makes it straightforward to add new representations, operators, or problem domains.
  • πŸ“Š
    Benchmarking Built-in interfaces to SRBench, GBFS/LSBench, Gymnasium, and more for fair, reproducible cross-domain comparisons.
  • πŸ€–
    AutoML-ready Integrates with HPO tools (SMAC3) and LLM interfaces for automated hyperparameter optimisation and natural-language program synthesis.

GP Representations

Four representations are currently implemented, each in a single self-contained file.

🌳

Tree-based GP (TGP)

Classic Koza-style GP. Programs are represented as expression trees. Supports multi-tree chromosomes for problems with multiple outputs.

SR LS Policy PS

src/gp/tiny_tgp.py

πŸ”—

Cartesian GP (CGP)

Programs are represented as directed acyclic graphs with fixed topology. Naturally supports multiple outputs through shared computation nodes.

SR LS Policy PS

src/gp/tiny_cgp.py

πŸ“‹

Linear GP (LGP)

Programs are sequences of register-machine instructions. Efficient representation for imperative-style evolved programs.

SR Policy

src/gp/tiny_lgp.py

πŸ“–

Grammatical Evolution (GE)

Genotypes are integer sequences decoded via a user-supplied BNF grammar, enabling flexible program synthesis in any target language.

SR PS

src/gp/tiny_ge.py

Problem Domains

All representations can be benchmarked across multiple domains through a shared problem API.

πŸ“ˆ

Symbolic Regression

Discover mathematical expressions that fit a dataset. Interfaces to the SRBench suite are included.

⚑

Logic Synthesis

Evolve Boolean circuits and combinational logic. Benchmarks from GBFS / LSBench are supported out of the box.

πŸ•ΉοΈ

Policy Search

Learn interpretable control policies for Gymnasium environments including classic control and Atari (ALE).

πŸ’»

Program Synthesis

Automatically generate programs that satisfy a set of input/output examples β€” a classic AI benchmark for GP.

Getting Started

TinyverseGP requires Python 3.10. Follow the steps below to install and run your first experiment.

1

Clone the repository

Get the source code from GitHub.

git clone https://github.com/GPBench/TinyverseGP.git
cd TinyverseGP
2

Set up a virtual environment with Python 3.10

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
3

Install TinyverseGP

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.

4

Run your first example

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

Available Examples

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

Quick Code Snippet

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)

🀝 Call for Contributions

TinyverseGP is a community-driven project. We welcome contributions of all kinds!

🌱

New Representations

Implement Push GP, Stack-based GP, or any other representation following the GPModel abstract interface.

πŸ‹οΈ

New Problem Domains

Add problem classes that inherit from Problem and expose your favourite benchmark suite to all representations.

πŸ›

Bug Reports & Fixes

Found something broken? Open an issue on GitHub or submit a pull request with a fix and a regression test.

πŸ“

Documentation

Improve docstrings, write tutorials, or extend this website with new content.

πŸ§ͺ

Tests & Experiments

Add unit tests, integration tests, or replicate published experimental results using TinyverseGP.

βš™οΈ

Operators & Utilities

Contribute new crossover, mutation, or selection operators β€” either representation- specific or agnostic.

πŸ“– Read the Full Contribution Guide   πŸ› Open an Issue   πŸ’¬ Join Discord

Team & Collaborators

TinyverseGP is developed by an international team of researchers.

RK

Roman Kalkreuth

RWTH Aachen, Germany
Framework design & TinyCGP
FO

Fabricio O. de FranΓ§a

UFABC, Brazil
TinyTGP & SRBench interface
JD

Julian Dierkes

RWTH Aachen, Germany
Policy search domain
ZV

Zdenek Vasicek

Brno University, Czech Republic
Logic synthesis domain
MA

Marie Anastacio

RWTH Aachen, Germany
HPO interfaces
AJ

Anja Jankovic

RWTH Aachen, Germany
HPO interfaces
DS

Dominik Sobania

University of Duisburg-Essen, Germany
Grammatical Evolution & LLM
GS

Giovanni Squillero

Politecnico di Torino, Italy
Linear GP
AT

Alberto Tonda

INRAE, France
Linear GP
HH

Holger Hoos

RWTH Aachen, Germany
Advisory – HPO & AutoML

Publication

If you use TinyverseGP in your research, please cite our paper:

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
BibTeX
@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.