ml-optimizer
An autonomous ML model optimization plugin. Powered by Claude Code.
Autonomous by default — runs until the goal is reached or you stop it. No hardcoded thresholds. No fixed pipeline. The orchestrator dispatches specialized agents, the analysis agent advises direction, and evidence drives decisions.
Why This Approach?
Traditional ML optimization tools follow a fixed pipeline — same strategy every time. The ml-optimizer differs:
-
Optimizes your ML model — research-informed techniques, LLM-driven hyperparameter tuning, ShinkaEvolve evolutionary code mutations, and parallel GPU experiments
-
Adapts its strategy on evidence — the analysis agent evaluates results after each batch and recommends the next action (continue, pivot, or stop); the Phase 7 workflow acts on these directly, and the orchestrator reads the structured result between phases.
-
Gets better each session — claude-mem recalls insights from prior sessions; behavioral memory tracks what works and what doesn't.
Core principle: standing on the shoulders of giants. The best ML optimization builds on proven research. The plugin prioritizes finding and implementing techniques from papers before inventing from scratch. User-provided papers get highest priority. Research-implement is a first-class strategy, not a fallback.
Overview
The ml-optimizer understands your ML model, establishes baselines, researches improvements, tunes hyperparameters, evolves code, runs experiments (parallel across GPUs), monitors for divergence, and improves each session.
Key design decisions:
- Workflow-driven experiment loop: Phases 5–8 run as dynamic workflows. The Phase 7 script holds the iteration loop and dispatches tuning, experiment, and analysis agents via
agentType (a standalone monitor-agent dispatch exists but isn't wired into the loop — divergence polling is folded into each experiment agent instead). Analysis advises, the workflow routes the next action; the orchestrator reads the structured return between phases.
- LLM-driven hyperparameter tuning (Claude reasons about results — no Optuna/grid search)
- Research via web search + alphaxiv academic paper search + user-provided papers
- ShinkaEvolve for fine-grained evolutionary code mutations
- Structured output directory in your project (location chosen at Phase 0 — no hardcoded default)
Key Features
Inspired by SakanaAI ShinkaEvolve and karpathy/autoresearch:
| Feature | What it does |
|---|
| ShinkaEvolve | Fine-grained evolutionary code mutations via LLM-generated SEARCH/REPLACE diff patches confined to EVOLVE-BLOCK regions. Dispatched by the Phase 7/Phase 8 workflow through the implement-agent |
| Research-Implement | Paper-informed optimization — finds techniques via web/papers, implements as git branches, tests with HP tuning |
| Stuck Protocol | When analysis advises stop, the Phase 7 workflow dispatches research for fresh ideas, then judges continue-or-exit from evidence (fresh proposals vs. exhausted agenda) — no fixed stop-count threshold |
| Dead-End Catalog | Tracks techniques conclusively unpromising. Research and hp-tune agents consult it before proposing, preventing wasted budget |
| Research Agenda | Living document initialized from proposals, reprioritized after each batch on experimental evidence |
| Progress Dashboard | Self-contained HTML dashboard with auto-refresh (--live), SVG timeline, sortable results, HP sensitivity, method explanations |
| Immutable Baseline | SHA-256 checksum of baseline metrics verified once before the experiment loop begins — halts if metrics are modified |
| Goal Anchoring | optimization-goals.json written at Phase 0; all agents read it before acting. Post-dispatch validation catches frozen param changes, scope breaches, dead-end re-proposals |
| Cross-Session Learning | claude-mem recalls insights from prior sessions; behavioral memory tracks what works across runs |
| Behavioral Memory | learned-behaviors.json accumulates HP constraints, method outcomes, divergence patterns. All agents have memory: local for persistent role-specific learning |
| Workflow-Driven Phases 5–8 | Research, implement, experiment, and stacking run as dynamic workflows bundled in the orchestrate skill (skills/orchestrate/workflows/phase-{5,6,7,8}-*.js). The orchestrator launches one Workflow({scriptPath, args}) per phase; each script holds that phase's fan-out/loop and reuses the existing agents via agentType. Internal pipeline steps launched by scriptPath, not user-facing /commands |