autoresearch (单卡训练自动化研究智能体)
99,873
Stars
13,750
Forks
733
Watchers
196
Open Issues
待补全
许可证
Python
语言
2026-03-06
创建时间
2026-03-26
最近更新
项目能做什么
在单 GPU 上自动执行 nanochat 训练研究的 AI Agent。
来源:基于仓库元数据
· 内容以仓库实际 README 为准
使用说明 查看原始 README 原仓库文档
## 项目简介
autoresearch 是 Andrej Karpathy 开源的一个自动化 AI 科研实验项目。它的核心思路是:给 AI Agent 提供一个轻量、真实的单 GPU 大语言模型训练环境,让 Agent 在夜间自主开展研究。Agent 会自行修改模型代码、运行 5 分钟训练、检验指标是否有提升、决定保留或放弃改动,然后不断循环。开发者不需要像传统研究那样手动写 Python 代码,而是通过修改 `program.md` 指导 Agent 的行为。
项目训练代码基于 [nanochat](https://github.com/karpathy/nanochat) 的精简单卡实现。
## 核心功能
- **AI 自主实验闭环**:Agent 自主修改架构、超参数、优化器配置与批大小等,自动评估效果并决定迭代方向。
- **固定时长训练(Fixed Time Budget)**:每次训练严格限制为 5 分钟实际墙上时钟时间(不含启动/编译耗时),每小时约可完成 12 次实验,整夜可跑约 100 次。
- **单一评估指标**:使用 `val_bpb`(validation bits per byte,验证集每字节比特数)作为统一指标,数值越低越好,且不受词表大小影响,便于不同架构改动之间的公平比较。
- **极简工程架构**:
- `prepare.py`:固定常量、一次性数据预处理(下载训练数据、训练 BPE 分词器)与运行时工具,无需修改。
- `train.py`:包含完整 GPT 模型、优化器(Muon + AdamW)和训练循环,由 Agent 全权编辑和迭代。
- `program.md`:Agent 的行为提示词与指令基线,由人类开发者编辑和调整。
## 适合谁用
- 拥有单张 NVIDIA 算力卡,希望探索让 AI Agent 自动化进行 LLM 架构与超参数微调的开发者。
- 想要研究或构建“自主科研 Agent(Autonomous Research Agents)”实验工作流的 AI 研发人员。
## 安装步骤
### 运行环境要求
- 单张 NVIDIA GPU(原作者在 H100 上测试)
- Python 3.10+
- [uv](https://docs.astral.sh/uv/) 包管理器
### 安装与准备
```bash
# 1. 安装 uv 包管理器(如果尚未安装)
curl -LsSf https://astral.sh/uv/install.sh | sh
# 2. 安装项目依赖
uv sync
# 3. 下载数据并训练分词器(仅需执行一次,耗时约 2 分钟)
uv run prepare.py
# 4. 手动运行一次单次训练实验测试环境(耗时约 5 分钟)
uv run train.py
配置说明
- Agent 交互配置:在你的开发环境中启动 Claude、Codex 或其他具备代码编辑能力的 Agent(注意关闭危险权限),并向其发送提示词:
text Hi have a look at program.md and let's kick off a new experiment! let's do the setup first. - 实验规则配置:通过编辑
program.md文件来调整 Agent 的探索策略和指令,该文件相当于一个轻量级的 Agent Skill。 - 依赖配置:项目依赖由
pyproject.toml管理。
常见问题
- 支持 CPU 或 Apple Silicon (MPS) 吗?
当前代码硬性要求单张 NVIDIA GPU。原作者表示原则上支持 CPU 或 MPS 会增加代码复杂度,暂未直接集成。如需跨平台支持,建议参考原版 nanochat 仓库中的通用设备兼容与回退方案。 - 不同机器之间的实验结果可以直接对比吗?
不能。因为项目采用 5 分钟固定物理时间预算机制,实验结果针对当前机器硬件进行了算力最大化优化,不同算力平台跑出的指标不可直接横向对比。 - 其他详细问题:此部分原文未说明,请查看原仓库。 ```
原始 README 摘录(英文原文,节选前 3000 字符)
# autoresearch  *One day, frontier AI research used to be done by meat computers in between eating, sleeping, having other fun, and synchronizing once in a while using sound wave interconnect in the ritual of "group meeting". That era is long gone. Research is now entirely the domain of autonomous swarms of AI agents running across compute cluster megastructures in the skies. The agents claim that we are now in the 10,205th generation of the code base, in any case no one could tell if that's right or wrong as the "code" is now a self-modifying binary that has grown beyond human comprehension. This repo is the story of how it all began. -@karpathy, March 2026*. The idea: give an AI agent a small but real LLM training setup 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. The training code here is a simplified single-GPU implementation of [nanochat](https://github.com/karpathy/nanochat). The core idea is that you're not touching any of the Python files like you normally would as a researcher. Instead, you are programming the `program.md` Markdown files that provide context to the AI agents and set up your autonomous research org. The default `program.md` in this repo is intentionally kept as a bare bones baseline, though it's obvious how one would iterate on it over time to find the "research org code" that achieves the fastest research progress, how you'd add more agents to the mix, etc. A bit more context on this project is here in this [tweet](https://x.com/karpathy/status/2029701092347630069) and [this tweet](https://x.com/karpathy/status/2031135152349524125). ## How it works The repo is deliberately kept small and only really has three files that matter: - **`prepare.py`** — fixed constants, one-time data prep (downloads training data, trains a BPE tokenizer), and runtime utilities (dataloader, evaluation). Not modified. - **`train.py`** — the single file the agent edits. Contains the full GPT model, optimizer (Muon + AdamW), and training loop. Everything is fair game: architecture, hyperparameters, optimizer, batch size, etc. **This file is edited and iterated on by the agent**. - **`program.md`** — baseline instructions for one agent. Point your agent here and let it go. **This file is edited and iterated on by the human**. By design, training runs for a **fixed 5-minute time budget** (wall clock, excluding startup/compilation), regardless of the details of your compute. The metric is **val_bpb** (validation bits per byte) — lower is better, and vocab-size-independent so architectural changes are fairly compared. If you are new to neural networks, this ["Dummy's Guide"](https://x.com/hooeem/status/2030720614752039185) looks pretty good for a lot more context. ## Quick start **Requirements:** A single NVIDIA GPU (tested on H10阅读完整原文
项目深度分析 规则生成(AI 未配置)
综合评分 40.4 分。该项目在“个人可实施性”维度得 20 分,“付费可能性”维度得 32.0 分,差异化空间 40.0 分(评分依据见评分卡)。
面向细分需求的二次开发产品
| 产品构想 | 基于 autoresearch 的核心能力,聚焦一个更窄的场景(如某平台、某行业)做差异化。 |
| 目标用户 | 该细分场景用户 |
| 难度/周期 | 中 · 2~6 周 |
| 收费模式 | 买断制 / 订阅制 / 广告 |
| 竞争风险 | 细分需求规模需验证 |
| 依据 | AI 推测:基于项目主题标签的判断 |
以上为规则引擎基于仓库公开数据生成的参考结论,包含推测成分,不构成投资或创业承诺;配置 AI 后可获得更深入的分析。
报告会保存到 个人中心
竞品与相似项目 GitHub Search 真实检索
| 项目 | 中文简介 | Stars | 语言 |
|---|---|---|---|
| aiming-lab/AutoResearchClaw | 中文介绍暂未生成 Fully autonomous & self-evolving research from idea to paper |
14,859 | Python |
| davebcn87/pi-autoresearch | 中文介绍暂未生成 Autonomous experiment loop extension for pi |
8,232 | TypeScript |
| uditgoenka/autoresearch | 中文介绍暂未生成 Claude Autoresearch Skill — Autonomous goal-directed iterati |
6,830 | Shell |
| leo-lilinxiao/codex-autoresearch | 中文介绍暂未生成 Codex Autoresearch Skill — A self-directed iterative system |
3,188 | Python |
| EvoMap/AutoResearch | 中文介绍暂未生成 AI/ML research agents from idea to paper-ready evidence. An |
3,092 | Python |
以上为通过 GitHub 官方 Search API 检索的相似项目,功能差异与优劣势需进一步人工确认,配置 AI 后可生成对比分析。
项目优势与风险
| 技术成熟度 | 创建于 2026-03-06,最近推送 2026-03-26 |
| 社区活跃 | Star 99,873 / Fork 13,750 / Issue 196(数据支持,可自行核实) |
| 许可证 | 未检测到(需人工确认) |
| 主要风险 | 上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价 |
安装与使用
此项目未提供 Docker 镜像,安装步骤以原仓库 README 为准(涉及依赖安装与环境配置,对新手门槛较高)。