Adaptive migration: stabilize evolution by adapting mutation/selection based on progress#54
Adaptive migration: stabilize evolution by adapting mutation/selection based on progress#54kotama7 wants to merge 10 commits intoSakanaAI:mainfrom
Conversation
fix: Fix database summary when patch_name metadata is missing
Fix packaging so pip install ships full shinka module tree
|
Hi there! Thank you for putting in the work. Do you have any results indicating that this type of adaptation is helping performance? Is there any related work? |
Top: Baseline execution using the shinka_launch variant=circle_packing_example configuration. Bottom: Execution with adaptive migration enabled. All other settings are identical to the baseline, except for the island configuration. Hi Robert — thanks a lot for taking a look. Preliminary results (Circle Packing example) I ran a quick sanity check on circle_packing_example comparing the default (fixed) migration setup vs. database=island_adaptive (this PR), keeping the rest of the run configuration the same. Best fitness (end of run): adaptive improved by ~0.7% (Δ ≈ +0.0185 in the reported score in my run). Efficiency: adaptive reached the baseline’s best score in ~4.6× less wall-clock time (time-to-target). The run also produces migration_adaptation.csv, which makes it easy to inspect per-island migration_rate / migration_interval / island_elitism trajectories and the (optional) bandit-selected policy per generation. Related work Conceptually, this PR is closest to prior work on parameter control in evolutionary algorithms and adaptive/dynamic island models, plus bandit-based operator/policy selection: Karafotias et al., Parameter Control in Evolutionary Algorithms: Trends and Challenges, IEEE TEVC 2015 (survey of parameter control). Srinivasa et al., A Dynamic Migration Model for Self-adaptive Genetic Algorithms, 2005 (dynamic/self-adaptive migration). Candan et al., A Dynamic Island Model for Adaptive Operator Selection, GECCO 2012 (dynamic island model framing + adaptive selection). Fialho et al., Analyzing bandit-based adaptive operator selection mechanisms, AMAI 2010 (MAB/UCB-style adaptive operator selection). Lissovoi et al., GECCO 2016 (work discussing adaptive migration intervals/topology effects in island models). If you prefer, I can add these citations (with brief “how it relates” notes) directly into docs/migration_adaptation.md to better motivate the design. Thanks again — happy to run a more systematic ablation (success-only vs diversity-only vs bandit, and with/without step-clamp) if that would help the PR decision. |


Title: Adaptive island migration: per-island parameter tuning + optional bandit policy selection
Summary:
This PR adds an optional adaptive migration module that tunes island-migration behavior during evolution runs. When enabled, Shinka can adjust (per island):
The adaptation can be driven by success, diversity, and/or a bandit policy selector, and it writes a run log to migration_adaptation.csv in the run’s results_dir.
Motivation:
Fixed, global migration hyperparameters are often suboptimal across islands and across phases of a run. This change makes migration responsive to observed outcomes, improving robustness without changing default behavior for existing configurations (adaptation is opt-in).
Key Changes:
Adds MigrationAdaptationController that:
Migration strategy can consume:
Backward Compatibility:
How to Test:
Install (example using uv):
uv venv --python 3.11
source .venv/bin/activate
uv pip install -e ".[dev]"
Run an example with adaptive migration enabled via the provided database preset:
shinka_launch variant=circle_packing_example database=island_adaptive evo_config.num_generations=12
Confirm outputs:
Expected result:
The run completes normally, and migration_adaptation.csv contains per-generation rows per island with migration_rate, migration_interval, island_elitism, and optional bandit policy fields.
Notes / Design Details:
Checklist: