πŸŒ€ 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.

FileRoleKey Metric
πŸ“ groundtruth.pyDefines the math of the Mandelbrot set (smooth normalized escape time).Immutable target function.
🧬 interface.pyDeclares the Solution contract (fit(ctx) and predict(coords)).API template for solutions.
πŸŽ›οΈ evaluate.pyRuns 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 SIGALRM force-kills the run (logs as timeout).
  • πŸ–₯️ 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.md so 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.

Ask Docs

AI assistant to help answer questions about the documentation. Answers are read-only and cite docs/source.

Hi! How can I help you with the documentation today? Answers are read-only and cite docs/source.

Ctrl+Enter to send