π Recursive Self-Improvement (RSI) Cheat Sheet
An ultra-condensed, emojified quick-start guide for the fractalsearch Mandelbrot set training loop. Inspired by Andrej Karpathyβs autoresearch project and showcased in video t7_ZXgfJVG8 (βRecursive Self-Improvement - Computer, load up celery man. Can AI build AI?β).
π§ The Concept: Can AI build AI?
- RSI (Strong): AI agents autonomously writing, training, evaluating, and committing code modifications to improve their own architectures, algorithms, or ML pipelines in a closed feedback loop.
- The Subject: Neural networks (MLPs, Fourier features, Hash Grids) forced to learn the infinitely complex boundaries of the Mandelbrot Set (
(real, imag) -> target value in [0, 1]).
π The Immutable Eval Harness (harness/)
DO NOT TOUCH files under harness/. They represent the fixed ground truth.
| File | Role | Key Metric |
|---|---|---|
π groundtruth.py | Defines the math of the Mandelbrot set (smooth normalized escape time). | Immutable target function. |
𧬠interface.py | Declares the Solution contract (fit(ctx) and predict(coords)). | API template for solutions. |
ποΈ evaluate.py | Runs training and evaluates MSE against ground truth. | MSE (Mean Squared Error) π lower is better! |
β±οΈ Time & Grid Constants to Memorize
- β±οΈ Training Budget: 300 seconds (5 minutes) target training window inside
fit(). - π¨ Hard Kill: 600 seconds (10 minutes). Exceed this and
SIGALRMforce-kills the run (logs astimeout). - π₯οΈ Eval Grid: Dense 4K UHD aspect-correct grid ( coordinates). Aspect ratio is anchored at (not square).
π The Infinite Research Loop (Step-by-Step)
[ Git master ]
β
βΌ
1. π‘ Formulate hypothesis (e.g. Add Fourier Features, change activation)
β
βΌ
2. π Copy prior winning solution file under `solutions/` (e.g. `fourier_features.py`)
β
βΌ
3. πΎ Run Git commit: `git add -A && git commit -m "feat: <hypothesis>"`
β
βΌ
4. π Launch evaluation:
uv run python -m harness.evaluate solutions/my_new_solution.py > run.log 2>&1
β
βΌ
5. π Read metrics: `grep "^mse:\|^status:" run.log`
β
βΌ
6. π Inspect runs.jsonl or monitor local dashboard (localhost:8000)
β
βΌ
7. π Loop forever (refine hypothesis and start again!)π« Non-Negotiable Laws
β DO
- Copy & mutate: Duplicate the closest prior winner under a new filename inside
solutions/. Keep each script self-contained. - Explore wild ideas: Try custom activations, boundary-weighted sampling schedules, multi-resolution curriculum training, learning rate warm-ups, or grid-based embeddings (e.g., instant-ngp hash grids).
- Write notes: Document failure modes and wins inside
solutions/notebook.mdso future agent runs have context.
β DONβT
- No hardcoding: Do not hardcode Mandelbrot math inside your candidate solution. The model must remain a universal function approximator.
- No extra deps: Do not add dependencies beyond PyTorch, NumPy, and Pillow.
- Never pause: The loop must run continuously without asking the human for permission to start the next experiment.