Autoexperiment Skill
Run autonomous time-budget experiment loops. Each iteration modifies train.py,
trains for a fixed wall-clock budget, evaluates, records in results.tsv, and repeats.
Setup
- Ensure
results.tsvexists with a baseline (exp000) before iterating - Create
EXPERIMENT.mdwith your goal, baseline, hypothesis, and constraints - Run:
/mlx:autoexperiment path/to/train.py
Protocol
Before each iteration
- Read
EXPERIMENT.mdfor the current hypothesis - Read
results.tsvfor experiment history - Identify one change to make (ONE variable only)
Iteration loop
- Edit
train.pywith the single change - Run with TIME_BUDGET:
timeout $BUDGET uv run train.py - Capture exit code and metrics
- Record in
results.tsv: KEEP / DISCARD / CRASH - If CRASH 3× in a row on the same error → stop, report diagnosis
After each iteration
- Update
EXPERIMENT.md"Next to try" section - Summarize: what changed, what happened, what's next
Templates
See references/EXPERIMENT.md.template for the hypothesis file format.
See scripts/time_budget_train.py for a complete training script template with all patterns.
Key patterns
- TIME_BUDGET: wall-clock seconds, not epochs. ~12 experiments/hour at 300s each
- val_bpb:
total_nats / (math.log(2) * total_bytes)— vocab-independent metric - GC freeze: after step 0 eliminates ~500ms stalls
- Fast fail:
if math.isnan(loss) or loss > 100: sys.exit(1) - Circuit breaker: 3 consecutive CRASHes on same error → escalate to user
See references/autoexperiment-guide.md for full documentation.