Skip to content

Commit 82d4c22

Browse files
update README and more
1 parent 002a9b8 commit 82d4c22

8 files changed

+211
-324
lines changed

README.md

+55-21
Original file line numberDiff line numberDiff line change
@@ -11,37 +11,71 @@ Automating the Search for Artificial Life with Foundation Models
1111
<p align="center">
1212
📝 <a href="https://sakana.ai/asal">[Blog]</a>
1313
🌐 <a href="https://asal.sakana.ai/">[Paper]</a> |
14-
📄 <a href="https://arxiv.org/">[PDF]</a> |
15-
💻 <a href="Google colab">[Google Colab]</a> |
14+
📄 <a href="https://arxiv.org/abs/2412.17799">[PDF]</a> |
15+
<!-- 💻 <a href="Google Colab">[Google Colab (coming soon)]</a> | -->
16+
💻 Google Colab (coming soon)
1617
</p>
1718

1819
[Akarsh Kumar](https://x.com/akarshkumar0101) $^{1}$ $^2$, [Chris Lu](https://x.com/_chris_lu_) $^{3}$, [Louis Kirsch](https://x.com/LouisKirschAI) $^{4}$, [Yujin Tang](https://x.com/yujin_tang) $^2$, [Kenneth O. Stanley](https://x.com/kenneth0stanley) $^5$, [Phillip Isola](https://x.com/phillip_isola) $^1$, [David Ha](https://x.com/hardmaru) $^2$
1920
<br>
2021
$^1$ MIT, $^2$ Sakana AI, $^3$ OpenAI, $^4$ The Swiss AI Lab IDSIA, $^5$ Independent
2122

23+
## Abstract
24+
With the recent Nobel Prize awarded for radical advances in protein discovery, foundation models (FMs) for exploring large combinatorial spaces promise to revolutionize many scientific fields. Artificial Life (ALife) has not yet integrated FMs, thus presenting a major opportunity for the field to alleviate the historical burden of relying chiefly on manual design and trial-and-error to discover the configurations of lifelike simulations. This paper presents, for the first time, a successful realization of this opportunity using vision-language FMs. The proposed approach, called *Automated Search for Artificial Life* (ASAL), (1) finds simulations that produce target phenomena, (2) discovers simulations that generate temporally open-ended novelty, and (3) illuminates an entire space of interestingly diverse simulations. Because of the generality of FMs, ASAL works effectively across a diverse range of ALife substrates including Boids, Particle Life, Game of Life, Lenia, and Neural Cellular Automata. A major result highlighting the potential of this technique is the discovery of previously unseen Lenia and Boids lifeforms, as well as cellular automata that are open-ended like Conway’s Game of Life. Additionally, the use of FMs allows for the quantification of previously qualitative phenomena in a human-aligned way. This new paradigm promises to accelerate ALife research beyond what is possible through human ingenuity alone.
2225

23-
## Installation
26+
## Repo Description
27+
This repo contains a minimalistic implementation of ASAL to get you started ASAP.
28+
Everything is implemented in the [Jax framework](https://github.com/jax-ml/jax), making everything end-to-end jittable and very fast.
2429

25-
First, recreate the conda environment for the project
26-
```shell
27-
conda env create -f environment.yaml
28-
pip install -r requirements.txt
30+
We have already implemented the following ALife substrates:
31+
- [Lenia](https://en.wikipedia.org/wiki/Lenia)
32+
- [Boids](https://en.wikipedia.org/wiki/Boids)
33+
- [Particle Life](https://www.youtube.com/watch?v=scvuli-zcRc)
34+
- Particle Life++
35+
- (Particle Life with changing color dynamics)
36+
- [Particle Lenia](https://google-research.github.io/self-organising-systems/particle-lenia/)
37+
- Discrete Neural Cellular Automata
38+
- [Continuous Neural Cellular Automata](https://distill.pub/2020/growing-ca/)
39+
- [Game of Life/Life-Like Cellular Automata](https://en.wikipedia.org/wiki/Life-like_cellular_automaton)
40+
41+
You can find these substrates at [models/](models/)
42+
43+
The main files to run ASAL are the following:
44+
- [main_opt.py](main_opt.py)
45+
- Run this for supervised target and open-endedness
46+
- Search algorithm: Sep-CMA-ES (from evosax)
47+
- [main_illuminate.py](main_illuminate.py)
48+
- Run this for illumination
49+
- Search algorithm: custom genetic algorithm
50+
- [main_sweep_gol.py](main_sweep_gol.py)
51+
- Run this for open-endedness in Game of Life substrate (b/c discrete search space)
52+
- Search algorithm: brute force search
53+
54+
## Running on Google Colab
55+
<!-- Check out the [Google Colab](here). -->
56+
Coming soon!
57+
58+
## Running Locally
59+
### Installation
60+
61+
To run this project locally, you can start by cloning this repo.
62+
```sh
63+
git clone [email protected]:SakanaAI/asal.git
64+
```
65+
Then, set up the python environment with conda:
66+
```sh
67+
conda create --name asal python=3.10.13
68+
conda activate asal
69+
```
70+
71+
Then, install the necessary python libraries:
72+
```sh
73+
python -m pip install -r requirements.txt
2974
```
75+
However, if you want GPU acceleration (trust me, you do), please [manually install jax](https://github.com/jax-ml/jax?tab=readme-ov-file#installation) according to your system's CUDA version.
3076

31-
If you encounter any issues installing this environment, please [manually install jax](https://github.com/jax-ml/jax?tab=readme-ov-file#installation) according to your system's CUDA version.
32-
Then manually install the following libraries:
33-
- flax==0.9.0
34-
- transformers==4.45.2
35-
- tqdm==4.66.5
36-
- einops==0.8.0
37-
- evosax==0.1.6
38-
- imageio==2.35.1
39-
- imageio-ffmpeg==0.5.1
40-
- matplotlib==3.9.2
41-
- pillow==10.4.0
42-
43-
## Running ASAL
44-
Check out [asal.ipynb](asal.ipynb)
77+
### Running ASAL
78+
Check out [asal.ipynb](asal.ipynb) to learn how to run the files and visualize the results.
4579

4680
## Reproducing Results from the Paper
4781
Coming soon!

asal.ipynb

+19-20
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,18 @@
3131
"import os, sys, glob, pickle\n",
3232
"from functools import partial\n",
3333
"\n",
34+
"import jax\n",
35+
"import jax.numpy as jnp\n",
36+
"from jax.random import split\n",
37+
"\n",
3438
"import numpy as np\n",
35-
"import pandas as pd\n",
36-
"import xarray as xr\n",
3739
"import matplotlib.pyplot as plt\n",
3840
"\n",
3941
"from tqdm.auto import tqdm\n",
4042
"from einops import rearrange, reduce, repeat\n",
41-
"import util\n",
42-
"\n",
43-
"from create_sim import create_sim, FlattenSimulationParameters, rollout_simulation, rollout_and_embed_simulation\n",
4443
"\n",
45-
"import jax\n",
46-
"import jax.numpy as jnp\n",
47-
"from jax.random import split"
44+
"import util\n",
45+
"from create_sim import create_sim, FlattenSimulationParameters, rollout_simulation, rollout_and_embed_simulation\n"
4846
]
4947
},
5048
{
@@ -459,7 +457,7 @@
459457
}
460458
],
461459
"source": [
462-
"! python main_illuminate.py --seed=0 --save_dir=\"/home/akarsh_sakana_ai/nca-alife-data/asal/illuminate_0\" --sim='lenia' --k_nbrs=2 --bs=32 --pop_size=256 --n_iters=10000 --sigma1=0.1 --sigma2=0."
460+
"! python main_illuminate.py --seed=0 --save_dir=\"./data/illuminate_0\" --sim='lenia' --k_nbrs=2 --bs=32 --pop_size=256 --n_iters=10000 --sigma1=0.1 --sigma2=0."
463461
]
464462
},
465463
{
@@ -476,8 +474,8 @@
476474
}
477475
],
478476
"source": [
479-
"data = util.load_pkl(\"/home/akarsh_sakana_ai/nca-alife-data/asal/illuminate_0\", \"data\") # load optimization data\n",
480-
"pop = util.load_pkl(\"/home/akarsh_sakana_ai/nca-alife-data/asal/illuminate_0\", \"pop\") # load the best parameters found\n",
477+
"data = util.load_pkl(\"./data/illuminate_0\", \"data\") # load optimization data\n",
478+
"pop = util.load_pkl(\"./data/illuminate_0\", \"pop\") # load the best parameters found\n",
481479
"params = pop['params']\n",
482480
"\n",
483481
"sim = create_sim('lenia') # create the substrate\n",
@@ -545,15 +543,16 @@
545543
"\n",
546544
"Above, we only showed results on Lenia because it runs the fastest, but feel free to run on other substrates as well!\n",
547545
"We have implemented the following substrates already:\n",
548-
"- Lenia\n",
549-
"- Boids\n",
550-
"- Particle Life\n",
551-
"- Particle Life++ (Particle Life with changing color dynamics)\n",
552-
"- Particle Lenia\n",
553-
"- Discrete NCA\n",
554-
"- Continuous NCA (hidden dimension=1)\n",
555-
"- Continuous NCA (hidden dimension=3)\n",
556-
"- Game of Life\n",
546+
"- [Lenia](https://en.wikipedia.org/wiki/Lenia)\n",
547+
"- [Boids](https://en.wikipedia.org/wiki/Boids)\n",
548+
"- [Particle Life](https://www.youtube.com/watch?v=scvuli-zcRc)\n",
549+
"- Particle Life++\n",
550+
" - (Particle Life with changing color dynamics)\n",
551+
"- [Particle Lenia](https://google-research.github.io/self-organising-systems/particle-lenia/)\n",
552+
"- Discrete Neural Cellular Automata\n",
553+
"- [Continuous Neural Cellular Automata](https://distill.pub/2020/growing-ca/)\n",
554+
"- [Game of Life/Life-Like Cellular Automata](https://en.wikipedia.org/wiki/Life-like_cellular_automaton)\n",
555+
"\n",
557556
"\n",
558557
"The following block visualizes random simulation parameters in each of these substrates.\n",
559558
"\n",

0 commit comments

Comments
 (0)