自主超越人类前沿算法
在多模态推荐任务上,AI Scientist 以 AAAI 2025 论文 PGL 为 Seed Baseline,经过一天无人干预的自动化迭代,生成的算法成功超越了人类设计的 PGL 算法。关键改进在于引入了模态感知的用户-物品边重加权机制。
清华大学 · 自动化 AI 科研标准化研究环境
Alchemy 是清华大学人工智能学院 ISE 实验室开源的自动化 AI 科研框架,被喻为为 AI Scientist 预先搭建好的「炼丹炉」。其核心设计是将 Scientist 层(假设生成、算法实现、超参设计)与 研究环境层(任务配置、GPU 调度、容器执行、指标收集)显式分离。AI Scientist 只需提交一个 algorithm.py + 一个 hyperparameter.yaml,Alchemy 负责把所有科研基础设施接起来。
已覆盖推荐系统(通用推荐、序列推荐、多模态推荐等)、图学习(图结构学习、时序图、噪声图等)、时间序列(异常检测、分类、预测等)3 大领域 16 个任务,并支持通过 plugin 机制持续扩展新领域。项目由李佳助理教授课题组完成,李乐晖主导框架设计与核心开发。
在多模态推荐任务上,AI Scientist 以 AAAI 2025 论文 PGL 为 Seed Baseline,经过一天无人干预的自动化迭代,生成的算法成功超越了人类设计的 PGL 算法。关键改进在于引入了模态感知的用户-物品边重加权机制。
在连续生成 100 个推荐算法后,AI Scientist 自动总结出高质量领域知识洞察,形成可复用的研究经验积累。这些总结已呈现出相当有价值的研究洞察,而非停留在表层描述。
支持多任务、多算法、多超参数、多数据集高并发实验,系统可根据实验反馈自动淘汰表现不佳的算法,将算力集中到更具潜力的探索方向上。
当 AI Scientist 生成的代码无法运行时,Alchemy 会将具体可执行的报错信息反馈给 AI Scientist,使其进行多轮迭代修正实现细节,最终生成可正常运行的代码。
本页 <head> 已内嵌机器可读的 application/agent-deploy+json 清单,Agent 可按序执行。部署成功判定:python -m ai_scientist 进程存活 + 日志出现 开始实验 / LLM call / tokens,且无 Python Traceback。
# === 必须全部通过 === uname -s # required: Linux python3 --version # required: 3.10+ (推荐 3.11) git --version # required: 2.20+ pip3 --version # required docker --version # required(或 singularity 二选一) # === 可选 === nvidia-smi # optional:无 GPU 也能 CPU 模式跑(耗时更长) singularity --version # optional:替代 docker curl -fsSL https://get.docker.com | sh && sudo usermod -aG docker $USER && newgrp docker= qwen-max 可换 qwen-plus 等兼容型号 = dashscope/compatible-mode/v1 换其他服务商时按各自文档替换 = [0] 无 GPU 改为 [];多卡如 [0, 1, 2, 3] .env(API Key)+ ai_scientist/config.yaml(模型/任务)+ research_environment/config.yaml(执行环境)Alchemy/.env(存放 API 密钥)OPENAI_API_KEY=sk-xxxxxxxx ai_scientist/config.yaml(模型 + 任务 + 调度)model: "qwen-max" base_url: "https://dashscope.aliyuncs.com/compatible-mode/v1" tasks: - domain: Recsys task: MMRec metric: "recall@20" seeds: ["PGL_2025"] max_rounds: 3 patience: 3 temperatures: [0.7] max_concurrent: 1 ${...},YAML 不支持 shell 变量展开;api_key 通过 .env 传入,不写在 config.yaml。research_environment/config.yaml(实验执行层)mode: docker shared_root: /home/user/Alchemy # 替换为 Alchemy 项目的绝对路径($(pwd)) ssh: nodes: - localhost timeout: 30 docker: images: Recsys/MMRec: "mmrec:latest" conda_env: "" extra_args: [] scheduler: gpus_per_node: 1 gpu_ids: [0] # 无 GPU 改 [],gpus_per_node 改 0 max_per_gpu: 1 max_concurrent: 1 timeout: 10800 # 1. 克隆项目 git clone https://github.com/TsinghuaISE/Alchemy.git && cd Alchemy # 备选(国内加速):git clone https://kkgithub.com/TsinghuaISE/Alchemy.git # 2. 创建虚拟环境 python3 -m venv .venv && source .venv/bin/activate pip install -U pip setuptools wheel # 3. 安装项目依赖(通过 pyproject.toml,pip install -e .) pip install -e . -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com # 4. 创建 .env 文件(存放 API 密钥) echo 'OPENAI_API_KEY=sk-xxxxxxxx' > .env # Agent 替换为真实 Key # 5. 构建 MMRec 任务 Docker 镜像(必加代理清空参数,否则构建会超时) docker build --build-arg http_proxy="" --build-arg https_proxy="" \ -t mmrec:latest research_environment/tasks/Recsys/MMRec/container/ # 6. 写入上方 3 份配置文件(.env + ai_scientist/config.yaml + research_environment/config.yaml) # dry-run 配置校验(启动前) python -c "from ai_scientist.utils.config import load_config; cfg = load_config(); print(f'✅ 配置加载: model={cfg.model}, tasks={len(cfg.tasks)}')" # 后台启动 nohup python -m ai_scientist > alchemy.log 2>&1 & echo $! > alchemy.pid # 等待启动(LLM 首次调用需几秒) sleep 15 # 检查进程存活 + 日志关键字 kill -0 $(cat alchemy.pid) && \ grep -qiE "(开始实验|LLM call|实验完成|tokens)" alchemy.log && \ ! grep -q Traceback alchemy.log && \ echo "✅ Alchemy 调度器已启动并成功进入实验迭代" 未找到 API Key.env 缺失或变量名错。确认项目根目录有 .env,内容为 OPENAI_API_KEY=sk-xxxpip install -e . 报错setuptools 版本太低:pip install -U setuptools>=68 wheeldocker build 超时Dockerfile 内置了内部代理变量:构建时显式置空,加 --build-arg http_proxy="" --build-arg https_proxy=""docker: command not foundcurl -fsSL https://get.docker.com | shRUN conda 前加清华源:conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainconfig.yaml 必须包含 model 和 base_url确认 ai_scientist/config.yaml 顶层有 model: 和 base_url: 字段shared_root 路径不对research_environment/config.yaml 中 shared_root 必须为 Alchemy 项目绝对路径(如 /home/user/Alchemy)source .venv/bin/activate && python -m ai_scientistModuleNotFoundError: ai_scientist没执行 pip install -e .,在项目根目录重跑docker ps 确认;timeout 默认 10800 秒(3 小时)git clone 超时换镜像:git clone https://kkgithub.com/TsinghuaISE/Alchemy.git