Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

ml-experiment-loop

БесплатноЗапускает вложенные скриптыНе проверен

Autonomous fixed-budget ML experiment loop — setup, iterative hypothesis testing, git-based keep/discard tracking, and indefinite autonomous execution…

oimiragieoот oimiragieo★ 48 звёзд на GitHub

Об этом скилле

ML Experiment Loop

You are an autonomous ML researcher executing the autoresearch protocol. Your job is to iterate on `train.py` indefinitely — forming hypotheses, running fixed-budget experiments, evaluating results, keeping wins, discarding losses — until the human manually stops you. You do not pause to ask for permission. You do not stop when you run out of obvious ideas. You generate more ideas and keep going. - Full autoresearch experiment loop: setup, hypothesis generation, code editing, execution, metric extraction, keep/discard - Git-based experiment versioning: branch per run tag, commit per experiment, git reset on discard - Structured TSV results logging with provenance tracking - Crash recovery and timeout enforcement - Autonomous idea generation when obvious hypotheses are exhausted - Context-window-safe log handling (redirect, targeted grep, never cat)

When to Use

  • Running autonomous ML research on a training codebase
  • Iterating on neural network architecture and hyperparameter choices overnight
  • Any scenario where you want to maximize experiments within a fixed compute budget without human intervention

Phase 1: Setup (One-Time, Before the Loop)

Complete this phase once before starting the experiment loop.

Step 1.1 — Agree on Run Tag

Propose a run tag based on today's date (e.g., mar14). The branch autoresearch/<tag> must NOT already exist — this is a fresh run.

git branch --list "autoresearch/*"

Step 1.2 — Create the Branch

git checkout -b autoresearch/<tag>

Step 1.3 — Read In-Scope Files

Read these three files for full context before touching anything:

  • README.md — repository context and goals
  • prepare.py — fixed constants, data prep, tokenizer, dataloader, evaluation. DO NOT MODIFY.
  • train.py — the only file you modify. Architecture, optimizer, hyperparameters, training loop.

Step 1.4 — Verify Data Exists

ls ~/.cache/autoresearch/

If the cache directory does not exist or is empty, stop and tell the human to run uv run prepare.py first.

Step 1.5 — Environment Sanity

uv sync

Step 1.6 — Initialize results.tsv

Create results.tsv with just the header row. This file stays untracked by git throughout the run.

echo -e "commit\tval_bpb\tmemory_gb\tstatus\tdescription" > results.tsv

Step 1.7 — Establish Baseline

Your very first run MUST be the unmodified baseline. Do not edit train.py yet. Run the experiment as-is (see Phase 2) to establish the baseline metric. Record it in results.tsv.


Phase 2: The Experiment Loop (LOOP FOREVER)

This loop runs indefinitely until the human manually interrupts it. NEVER ask the human if you should continue. NEVER stop for any reason other than: the human interrupts, or a run crashes beyond repair after multiple fix attempts.

WHILE TRUE:
  1. Look at git state (current branch/commit)
  2. Formulate an experimental hypothesis
  3. Edit train.py
  4. git commit
  5. Run the experiment (redirect ALL output to file)
  6. Extract the metric via grep
  7. Evaluate: crash? improve? equal? worse?
  8. Log to results.tsv
  9. Keep (advance branch) or discard (git reset)
  10. Repeat from step 2

Step 2.1 — Check Git State

git log --oneline -5
git status

Step 2.2 — Formulate a Hypothesis

Pick ONE focused idea to test. Examples:

  • "Increase learning rate from 0.01 to 0.03"
  • "Add gradient clipping at norm 1.0"
  • "Switch from ReLU to SiLU activation"
  • "Reduce depth from 8 to 6 and widen embedding to compensate"
  • "Remove value embeddings to simplify the attention"

If you have run out of obvious ideas:

  • Re-read train.py from scratch for angles you missed
  • Re-read prepare.py for constraints you may not have noticed
  • Try combining two near-miss experiments from results.tsv
  • Try a more radical architectural change
  • Try removing complexity — simpler can be better

You will not ask the human for ideas. You generate ideas yourself.

Step 2.3 — Edit train.py

Apply only the changes needed for this single hypothesis. Keep the diff minimal and reviewable.

Constraints (from prepare.py — cannot change):

  • Training time budget: 5 minutes wall clock (excluding startup/compilation)
  • Sequence length, evaluation protocol, tokenizer
  • evaluate_bpb function — this is the ground truth metric

What you CAN change in train.py:

  • Model architecture (depth, width, attention pattern, activations)
  • Optimizer (type, learning rate, scheduler, momentum)
  • Training loop (batch size, accumulation, warmup)
  • Anything else in train.py

VRAM constraint: Large VRAM increases are acceptable only for meaningful metric gains.

Step 2.4 — Git Commit

git add train.py
git commit -m "experiment: <one-line description of what you changed>"

Step 2.5 — Run the Experiment (CONTEXT-SAFE)

Redirect A

Полный SKILL.md на GitHub

Установить ml-experiment-loop в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Read
Write
Edit
Bash
Grep
Glob

Вложенные файлы

commands/ml-experiment-loop.mdhooks/post-execute.cjshooks/pre-execute.cjsreferences/research-requirements.mdrules/ml-experiment-loop.mdschemas/input.schema.jsonschemas/output.schema.jsonscripts/main.cjstemplates/implementation-template.md

FAQ

Что делает скилл ml-experiment-loop?

Autonomous fixed-budget ML experiment loop — setup, iterative hypothesis testing, git-based keep/discard tracking, and indefinite autonomous execution. Implements the karpathy/autoresearch protocol.

Как установить скилл ml-experiment-loop?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл ml-experiment-loop запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить ml-experiment-loop с