2026-10-10 补充校核:示例属于伪代码;hermetic 是目标,须固定数据、环境和外部依赖后才能复现,Git 历史本身不保存所有训练输入及决策。 1
Model Training as Code — Aleph Alpha Savanna
Score: ⭐⭐⭐⭐⭐ | HN 124 pts | 💬 13+ comments Source: HN Discussion → Aleph Alpha Blog
TL;DR
Aleph Alpha 的 Savanna 是一个模型工厂(model factory),将整个模型训练 pipeline 实现为代码,使模型训练成为一个协作式软件工程项目。端到端训练是封闭的(hermetic),一键启动。
Three Pillars of MTaC
1. Composability (可组合性)
将手动步骤表达为带类型的函数(typed inputs/outputs),构建抽象层,一键运行完整 pipeline。修改 pipeline = 修改函数;重复工作 = for 循环;测试 = 不同参数的缩小版 pipeline。
# 说明性伪代码;spawn evaluate 不是 Python 语法
async def post_train(config: PostTrainConfig) -> PostTrainEvaluation:
sft_checkpoint = await sft(config.sft)
sft_eval = spawn evaluate(config.eval, sft_checkpoint)
rl_checkpoint = await rl(config.rl, sft_checkpoint)
rl_eval = spawn evaluate(config.eval, rl_checkpoint)
return PostTrainEvaluation(await sft_eval, await rl_eval)2. Consensus (共识)
主分支(main)代表团队对”如何训练模型”的最佳集体理解。代码包含完整的训练配方,无需重建设置、无需担心忘记标志。Trunk-based development 是前提。
3. Provenance (溯源)
代码注释和提交历史只记录实际写入的决策;数据版本、运行环境、随机种子和外部依赖还需另行记录。git blame 可定位代码行的提交来源;它不能还原未记录的讨论。artefact lineage 是否完整取决于实际元数据。
Hidden Costs of Manual Training
- Human error: 每个手动步骤都是人为错误的温床(磁盘满了 → 训练崩溃 → 重建设置)
- Lost learnings: 超参数选择理由、数据混比构成、模型与配方的关系散落在 Slack / 文件系统 / 实验管理器中
- Fragmented ownership: 团队各管一段,手动交接频率低 → 每次整合时积累一个月的分歧
Architecture
- Workflow engine: Flyte on Kubernetes
- CI entrypoint: GitHub Actions (5分钟可验证的小规模端到端训练)
- Artefact registry: W&B (不可变对象存储, artefact lineage 图)
- Leaderboard: 自动更新, 大屏展示
Key Insight
“Looking further ahead, we see MTaC as a key enabler for auto-research. With our entire pipeline in code, an LLM agent can read, modify and run it autonomously, and we are beginning to explore this now.”
Relevance to Hermes/gbrain
- gbrain pipeline 代码化: 数据处理、embedding、同步等工作流可参考 MTaC 思路代码化
- 多 Agent 协作: Capability-based 分解(团队按行为而非按阶段组织)可映射到 Alaya/Anchor/Mano 的职责分工
- Auto-research 前提: MTaC 揭示了一个关键条件——要让 LLM agent 自主改进系统,系统本身必须用代码(而非手动配置)表达