{"id":50700403,"url":"https://github.com/tmc/autoresearch-go-ane","last_synced_at":"2026-06-26T09:01:18.310Z","repository":{"id":344484169,"uuid":"1181956150","full_name":"tmc/autoresearch-go-ane","owner":"tmc","description":"Autonomous AI research on Apple Silicon using ANE-accelerated training","archived":false,"fork":false,"pushed_at":"2026-03-17T20:28:46.000Z","size":55712,"stargazers_count":11,"open_issues_count":2,"forks_count":4,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-21T23:42:45.729Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tmc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-14T21:13:35.000Z","updated_at":"2026-06-08T17:40:41.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/tmc/autoresearch-go-ane","commit_stats":null,"previous_names":["tmc/autoresearch-go-ane"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tmc/autoresearch-go-ane","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmc%2Fautoresearch-go-ane","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmc%2Fautoresearch-go-ane/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmc%2Fautoresearch-go-ane/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmc%2Fautoresearch-go-ane/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tmc","download_url":"https://codeload.github.com/tmc/autoresearch-go-ane/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmc%2Fautoresearch-go-ane/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34809886,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-26T02:00:06.560Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-09T09:02:20.418Z","updated_at":"2026-06-26T09:01:18.298Z","avatar_url":"https://github.com/tmc.png","language":"Go","funding_links":[],"categories":["Full list"],"sub_categories":["Software / Systems Optimization"],"readme":"# autoresearch-go-ane\n\nA Go port of [karpathy/autoresearch](https://github.com/karpathy/autoresearch) for Apple Silicon. Give an AI agent a real LLM training setup on the Neural Engine and let it experiment autonomously overnight. It modifies the code, trains for 5 minutes, checks if the result improved, keeps or discards, and repeats. You wake up in the morning to a log of experiments and (hopefully) a better model.\n\nThe training code is a 110M-parameter Llama2-style transformer on [TinyStories](https://huggingface.co/datasets/enio/TinyStories), running entirely in Go with ANE acceleration via [purego](https://github.com/ebitengine/purego) (no CGo). Experiments are measured with Go benchmarks and compared with [benchstat](https://pkg.go.dev/golang.org/x/perf/cmd/benchstat) for statistical rigor.\n\n## How it works\n\nThe repo is deliberately kept small and only really has three files that matter:\n\n- **`harness.go`** — fixed evaluation harness, data loading, random init. Not modified.\n- **`experiment.go`** — the primary file the agent edits. Contains hyperparameters, learning rate schedule, and training configuration. **This file is edited and iterated on by the agent.**\n- **`program.md`** — instructions for the agent. Point your agent here and let it go. **This file is edited and iterated on by the human.**\n\nThe agent can also edit files in `ane/` for deeper changes (optimizer, forward/backward pass, loss function, activations). See [program.md](program.md) for the full scope.\n\nBy design, training runs for a **fixed 5-minute time budget** (wall clock, excluding warmup/compilation), regardless of the details of your Apple Silicon chip. The metric is **val_loss** (validation cross-entropy in nats) — lower is better.\n\n## Quick start\n\n**Requirements:** macOS with Apple Silicon (M1/M2/M3/M4), Go 1.24+.\n\n```bash\n# 1. Clone and set up\ngit clone https://github.com/tmc/autoresearch-go-ane.git\ncd autoresearch-go-ane\nbash scripts/setup.sh   # downloads ~40MB token data + ~420MB model\n\n# 2. Run baseline benchmarks (~2 min)\ngo test -bench . -benchtime 5x -count 3 -v\n\n# 3. Install benchstat for comparing experiments\ngo install golang.org/x/perf/cmd/benchstat@latest\n```\n\n## Running the agent\n\nSpin up Claude Code (or whatever agent you prefer) in this repo, then prompt something like:\n\n```\nRead program.md and let's kick off a new experiment! Do the setup first.\n```\n\nThe `program.md` file is the agent's complete instruction set — it knows how to create a branch, run benchmarks, compare results, and loop forever.\n\n## Project structure\n\n```\nexperiment.go   — hyperparameters, LR schedule, config (agent modifies this)\nharness.go      — evaluation harness, data loading (do not modify)\nbench_test.go   — Go benchmarks (do not modify)\nprogram.md      — agent instructions\nane/            — ANE training engine (agent can modify for deeper experiments)\n```\n\n## Benchmarks\n\n`go test -bench .` reports:\n\n| Benchmark | Key metrics |\n|---|---|\n| `BenchmarkStep` | `loss`, `tok/s`, `step_ms`, `ane_ms`, `adam_ms`, `ane-watts`, `ane-compute-%` |\n| `BenchmarkEvalLogits` | `ns/op` (inference latency), `ane-watts`, `ane-compute-%` |\n| `BenchmarkEvalLoss` | **`val_loss`** (the optimization target), `ane-watts`, `ane-compute-%` |\n| `BenchmarkLRSchedule` | `ns/op` (schedule overhead) |\n\nCompare experiments:\n\n```bash\ngo test -bench . -benchtime 5x -count 6 | tee bench_before.txt\n# edit experiment.go ...\ngo test -bench . -benchtime 5x -count 6 | tee bench_after.txt\nbenchstat bench_before.txt bench_after.txt\n```\n\n## Design choices\n\n- **Go + purego, no CGo.** The entire stack is pure Go using [purego](https://github.com/ebitengine/purego) for Apple framework calls (Accelerate, ANE). No C compiler needed.\n- **Fixed time budget.** Training always runs for exactly 5 minutes. This makes experiments directly comparable regardless of what the agent changes. Each experiment takes ~2-4 minutes to benchmark, so you get 15-30 experiments per hour, ~100-200 overnight.\n- **Statistical rigor.** Go benchmarks + `benchstat` give p-values for every comparison. A change is only kept if it improves val_loss with p \u003c 0.05.\n- **ANE utilization tracking.** Benchmarks report real-time ANE power (watts), compute utilization (%), and energy consumption via [aneperf](https://github.com/tmc/aneperf).\n\n## Model\n\n110M-parameter Llama2-style transformer on TinyStories:\n\n| | |\n|---|---|\n| Vocab | 32,000 (Llama2 BPE) |\n| Dim | 768 |\n| Hidden | 2,048 |\n| Heads | 12 |\n| Layers | 12 |\n| Sequence length | 256 (default) |\n\n## Credits\n\n- [karpathy/autoresearch](https://github.com/karpathy/autoresearch) — the original autonomous research pattern\n- [maderix/ANE](https://github.com/maderix/ANE) — Go Apple Neural Engine training (vendored in `ane/`)\n- [tmc/apple](https://github.com/tmc/apple) — Go Apple platform bindings (Accelerate, CoreML, ANE)\n- [tmc/aneperf](https://github.com/tmc/aneperf) — ANE performance monitoring\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmc%2Fautoresearch-go-ane","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftmc%2Fautoresearch-go-ane","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmc%2Fautoresearch-go-ane/lists"}