AIDE ML — 机器学习工程代理
由 LLM 驱动的代理,能够编写、评估和改进机器学习代码。
生产环境中需要使用?试试 Weco →
什么是 AIDE ML?
AIDE ML 是AIDE 算法的开源“参考版本”,AIDE 算法是一个树搜索代理,能够自主地编写、调试和测试代码,直到用户定义的指标达到最大值(或最小值)。它以易于研究人员使用的Python 包的形式发布,并包含一系列实用工具(命令行界面、可视化、配置预设),方便学术界和工程师研究人员复现论文、测试新想法或构建机器学习流程原型。
| 层 | 描述 | 在哪里可以找到它 |
|---|---|---|
| AIDE算法 | 在代码空间中,基于LLM的智能体树搜索。 | 我们在论文中对此进行了描述。 |
| AIDE ML代码库(本代码库) | 精益实施,用于实验和扩展。 | pip install aideml |
| Weco产品 | 该平台将 AIDE 的功能推广到更广泛的代码优化场景,提供实验跟踪和增强的用户控制。 | weco.ai |
谁应该使用它?
- 代理架构研究人员——替换新的搜索启发式方法、评估器或 LLM 后端。
- 机器学习从业者——根据数据集快速构建高性能机器学习管道。
主要能力
- 自然语言任务规范:引导智能体使用数据集,并用通俗易懂的英语描述目标和指标。无需 YAML 网格或自定义封装。
aide data_dir=… goal="Predict churn" eval="AUROC" - 迭代式智能体树搜索:每个 Python 脚本都成为解决方案树中的一个节点;LLM 生成的补丁会生成子节点;度量反馈用于修剪和指导搜索。OpenAI 的MLE-Bench(75 项 Kaggle 竞赛)发现,AIDE 的树搜索算法获得的奖牌数量是最佳线性智能体(OpenHands)的4 倍。
此仓库提供的实用功能
- HTML可视化工具——查看完整的解决方案树以及附加到每个节点的代码。
- Streamlit UI– 机器学习解决方案原型。
- 模型中立的管道——OpenAI、Anthropic、Gemini 或任何支持 OpenAI API 的本地 LLM。
基于 AIDE 的特色研究
| 机构 | 论文/项目名称 | 链接 |
|---|---|---|
| OpenAI | MLE-bench:在机器学习工程中评估机器学习代理 | 论文,GitHub |
| 地铁 | RE-Bench:评估语言模型代理相对于人类专家的前沿人工智能研发能力 | 论文,GitHub |
| 坂名爱 | AI 科学家 v2:基于智能体树搜索的研讨会级自动化科学发现 | 论文,GitHub |
| 元 | 自动化LLM速通基准测试:重现NanoGPT改进 | 论文,GitHub |
| 元 | 用于机器学习的人工智能研究代理:MLE-bench 中的搜索、探索和泛化 | 论文,GitHub |
| 上海交通大学 | ML-Master:通过融合探索与推理,迈向人工智能的人工智能 | 论文,GitHub |
知道还有其他引用或衍生自 AIDE 的公共项目吗?
提交 PR并添加到列表中吧!
如何使用 AIDE ML
快速入门
#1 Installpip install -U aideml#2 Set an LLM keyexportOPENAI_API_KEY=<your‑key>#https://platform.openai.com/api-keys#3 Run an optimisationaide data_dir="example_tasks/house_prices"\ goal="Predict the sales price for each house"\ eval="RMSE between log‑prices"运行结束后你会发现:
logs/<id>/best_solution.py找到的最佳代码logs/<id>/tree_plot.html– 点击查看解决方案树
Web 用户界面
pip install -U aideml#adds streamlitcdaide/webui streamlit run app.py使用侧边栏粘贴您的 API 密钥,上传数据,设置目标和指标,然后按运行 AIDE。
用户界面显示实时日志、解决方案树和最佳代码。
高级 CLI 选项
#Choose a different coding model and run 50 stepsaide agent.code.model="claude-4-sonnet"\ agent.steps=50 \ data_dir=… goal=… eval=…常用旗帜
| 旗帜 | 目的 | 默认 |
|---|---|---|
agent.code.model | LLM 用于编写代码 | gpt-4-turbo |
agent.steps | 改进迭代 | 20 |
agent.search.num_drafts | 每步草稿 | 5 |
在 Python 中使用 AIDE ML
importaideimportloggingdefmain(): logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') aide_logger=logging.getLogger("aide") aide_logger.setLevel(logging.INFO)print("Starting experiment...") exp=aide.Experiment( data_dir="example_tasks/bitcoin_price",# replace this with your own directorygoal="Build a time series forecasting model for bitcoin close price.",# replace with your own goal descriptioneval="RMSLE"# replace with your own evaluation metric) best_solution=exp.run(steps=2)print(f"Best solution has validation metric:{best_solution.valid_metric}")print(f"Best solution code:{best_solution.code}")print("Experiment finished.")if__name__=='__main__':main()高级用户附加功能
本地LLM(Ollama示例)
exportOPENAI_BASE_URL="http://localhost:11434/v1"aide agent.code.model="qwen2.5"data_dir=… goal=… eval=…注意:评估器默认为 gpt-4o。
完全本地化(代码+评估器——无外部调用)
<span style="background-color:#f6f8fa"><span style="color:#1f2328"><span style="color:#1f2328"><span style="background-color:#f6f8fa"><code>export OPENAI_BASE_URL="http://localhost:11434/v1" aide agent.code.model="qwen2.5" agent.feedback.model="qwen2.5" data_dir=… goal=… eval=… </code></span></span></span></span>提示:使用完全本地化的模型时,性能可能会有所下降。
Docker
docker build -t aide.docker run -it --rm \ -v"${LOGS_DIR:-$(pwd)/logs}:/app/logs"\ -v"${WORKSPACE_BASE:-$(pwd)/workspaces}:/app/workspaces"\ -v"$(pwd)/aide/example_tasks:/app/data"\ -e OPENAI_API_KEY="your-actual-api-key"\ aide data_dir=/app/data/house_prices goal="Predict price"eval="RMSE"开发安装
git clone https://github.com/WecoAI/aideml.gitcdaideml&&pip install -e.引用
如果您在工作中使用 AIDE,请引用以下论文:
@article{aide2025,title={AIDE: AI-Driven Exploration in the Space of Code},author={Zhengyao Jiang and Dominik Schmidt and Dhruv Srikanth and Dixing Xu and Ian Kaplan and Deniss Jacenko and Yuxiang Wu},year={2025},eprint={2502.13138},archivePrefix={arXiv},primaryClass={cs.AI},url={https://arxiv.org/abs/2502.13138}, }