Paper: 2609.05364 Authors: Samuel Kushnir, Kimia Noorbakhsh, Kavya Sreedhar, Liqun Cheng, Ming Liu, Parthasarathy Ranganathan, Mohammad Alizadeh, Fred Kjolstad, Suvinay Subramanian Categories: cs.PL, cs.AI

The Gap

Machine-learning performance modelling is hostile terrain for long-lived software. A performance model encodes assumptions about the hardware and the model being served — tile sizes, memory hierarchies, the shape of attention, the cost of a collective. When the next generation of either arrives, those assumptions are invalidated, and the framework has to be refactored. Not sometimes: perpetually, by the nature of the domain.

The paper identifies a change that alters the economics of that loop. AI coding agents have become fast and capable enough that regenerating an entire library is cheaper than paying down the tech debt of incrementally patching it. If regeneration is the cheaper option, then the durable artifact is no longer the code — it is whatever the agents regenerate from. And that reframes the design question: what should the source of truth be, if the code is disposable?

   ML PERFORMANCE MODELLING: HOSTILE TERRAIN

   a performance model ENCODES ASSUMPTIONS about the hardware
   and the model being served:
     tile sizes | memory hierarchies | the shape of attention
     the cost of a collective
        |
        v
   when the next generation of EITHER arrives, those assumptions
   are INVALIDATED and the framework must be REFACTORED
     -> not sometimes, but PERPETUALLY, by the nature of the domain
        |
        v
   [THE CHANGE THAT ALTERS THE ECONOMICS]
     AI coding agents are now fast and capable enough that
     REGENERATING AN ENTIRE LIBRARY IS CHEAPER than paying down
     the tech debt of INCREMENTALLY PATCHING it
        |
        v
   IF regeneration is cheaper, the durable artifact is NO LONGER
   THE CODE -- it is whatever the agents regenerate FROM
        |
        v
   [THE REFRAMED DESIGN QUESTION] what should the SOURCE OF
   TRUTH be, if the code is DISPOSABLE?

The Increment

One sentence: Before this paper, the source of truth in a performance-modelling library was its code and the docs described it; after it, the docs are the source of truth and the code is regenerated from them, reproducing hand-audited reference models to round-off precision.

Core Mechanism

The inverted arrangement is the contribution, and it is stated exactly: the main branch contains almost no code. Instead, the repository is a DAG of self-contained natural-language design docs. Three consequences follow directly from that inversion:

  • Coding sub-agents regenerate the implementation from only the docs on new version updates. “Only the docs” is the load-bearing phrase — the agents do not consult the previous implementation, so the docs must be sufficient on their own. That is a much stronger requirement than documentation-as-description.
  • Every human change is a natural-language edit to a doc. So the review artifact and the source of truth are the same object; there is no code change without a corresponding doc change, because there is no code to change.
  • Self-documenting by construction. This falls out rather than being maintained: if the docs generate the code, the docs cannot go stale.

Two ingredients make regeneration reliable, and they address the two ways this could fail — unclear specification and ambiguous output.

A design-doc style built around step-by-step worked examples that act as in-context demonstrations for the generating agents. Worked examples are specified for a reason: a prose description of a cost model leaves the agent to infer conventions, whereas a worked example shows the convention being applied to concrete numbers. The examples are the interface.

A minimal, recursively defined operator IR with three properties: symbolic (SymPy) cost expressions, a fast analytical roll-up mode for large sweeps, and a slow modulo-scheduling mode for fine-grained schedule studies. The IR is what constrains what a regenerated implementation can be — a minimal core with recursion rather than a large surface — and the two modes reflect the two things people actually do with a performance model: sweep broadly, then zoom in on one schedule. Keeping both in the same IR is what prevents the two use cases from drifting into separate tools.

Then the credibility check, which is the reason to take the claim seriously. Regenerated implementations reproduce hand-audited reference models — including DeepSeek-V3 serving on a TPU pod sliceto round-off precision. Two things about that. The comparison is against models that were hand-audited, so the reference is trustworthy rather than merely a previous output of the same system. And round-off precision on a real serving configuration is a stringent tolerance: this is not “the regenerated code runs and gives similar numbers”, it is numerical agreement.

The paper’s conclusion is carefully scoped and worth quoting for its modesty: the result suggests that design docs — not code — can be the durable artifact for ML-systems co-design tools.

   THE INVERSION: THE MAIN BRANCH CONTAINS ALMOST NO CODE
     instead, the repository is a DAG of SELF-CONTAINED
     NATURAL-LANGUAGE DESIGN DOCS
        |
        v
   THREE CONSEQUENCES
     [a] coding sub-agents REGENERATE THE IMPLEMENTATION
         FROM ONLY THE DOCS on new version updates
           <- "only the docs" is load-bearing: the agents do
              NOT consult the previous implementation
           <- a much stronger requirement than
              documentation-as-description
     [b] EVERY HUMAN CHANGE is a natural-language edit to a doc
           -> the review artifact and the source of truth are the
              SAME OBJECT
     [c] SELF-DOCUMENTING BY CONSTRUCTION
           <- falls out rather than being maintained: if the docs
              generate the code, the docs CANNOT GO STALE

   TWO INGREDIENTS THAT MAKE REGENERATION RELIABLE
     (addressing the two ways it could fail: unclear
      specification, ambiguous output)

     [i] A DESIGN-DOC STYLE BUILT AROUND STEP-BY-STEP WORKED
         EXAMPLES acting as IN-CONTEXT DEMONSTRATIONS
           <- prose leaves the agent to INFER conventions;
              a worked example SHOWS the convention applied
              to concrete numbers
           -> the examples ARE the interface

     [ii] A MINIMAL, RECURSIVELY DEFINED OPERATOR IR with:
            SYMBOLIC (SymPy) cost expressions
            a FAST analytical roll-up mode for LARGE SWEEPS
            a SLOW modulo-scheduling mode for FINE-GRAINED
              schedule studies
           <- the IR constrains what a regenerated implementation
              CAN BE: a minimal recursive core, not a large surface
           <- the two modes reflect the two things people do:
              sweep broadly, then zoom in
           -> keeping both in one IR stops the two use cases from
              drifting into separate tools

   THE CREDIBILITY CHECK
     regenerated implementations reproduce HAND-AUDITED REFERENCE
     MODELS -- including DeepSeek-V3 serving on a TPU pod slice --
     TO ROUND-OFF PRECISION
       <- the reference is HAND-AUDITED, not a previous output of
          the same system
       <- round-off precision on a real serving config is a
          STRINGENT tolerance: not "similar numbers" but
          numerical agreement

   CONCLUSION (carefully scoped)
     suggests that DESIGN DOCS -- not code -- can be the durable
     artifact for ML-systems co-design tools

Think of it as a recipe book that a cook can execute perfectly, kept in place of the prepared meals. If the meals spoil — and in this domain they spoil on a schedule, every time the kitchen equipment changes — then storing meals means storing something that is always going off. Store the recipes instead, and each time the equipment changes you cook again. Two things determine whether that works. The recipe has to be specific enough that a competent cook produces the same dish without watching the last one being made — which is the role of worked examples. And there has to be a constrained vocabulary of operations, so the cook does not invent a different technique each time — which is the role of the IR. What would make this convincing is a taste test against a dish prepared by an expert who never saw the recipe: that is the hand-audited reference at round-off precision.

Key Concepts

  • Docs as source of truth, code as build output: the repository’s main branch is a DAG of design docs. It makes the review artifact and the durable artifact the same object, and it makes staleness structurally impossible.
  • Regeneration from docs alone: sub-agents do not consult the previous implementation. It is a much stronger requirement than ordinary documentation, and it is what forces the docs to be complete specifications.
  • Worked examples as the interface: step-by-step examples that serve as in-context demonstrations. They show conventions applied to numbers, where prose would leave them to be inferred.
  • A minimal recursive IR with two modes: symbolic cost expressions, a fast roll-up for sweeps and a slow scheduling mode for fine-grained study. It constrains the space of regenerated implementations and keeps two use cases in one tool.
  • Hand-audited references at round-off precision: the credibility check, and a stringent one. It rules out “the regenerated code roughly agrees” and requires numerical agreement against a trusted baseline.

Framework Shift

Before (code is the source of truth):
  performance model lives in code
  docs describe the code
  -> when hardware or models change, the assumptions
     invalidate and the framework must be REFACTORED
  -> perpetual tech debt, incrementally paid down

After (docs are the source of truth):
  main branch is a DAG of natural-language design docs
  sub-agents regenerate implementation from the docs alone
  every human change is a doc edit; self-documenting by construction
  -> regenerated code matches hand-audited references to
     round-off precision

From maintaining a codebase whose assumptions expire to maintaining a specification from which the codebase is rebuilt, the core shift is that when regeneration becomes cheaper than patching, the durable artifact moves one level up and the code becomes an output.

Expert Assessment

Problem choice: Excellent, and the domain choice is what makes it credible rather than speculative. Performance modelling is the strongest possible case for doc-first development, because its assumptions expire on a predictable schedule — so the argument does not rest on a general claim about documentation, but on a domain where code demonstrably has a short half-life.

Method maturity: The two enabling ingredients address the two real failure modes, and both are well chosen. Worked examples as the specification format solve the ambiguity that makes regenerated code drift; the minimal recursive IR with two modes constrains the space so that regeneration is a search over a small region rather than an open-ended generation. The test protocol is the strongest element: comparing against hand-audited references and requiring round-off precision on a real serving configuration is a demanding bar, and reporting it for DeepSeek-V3 on a TPU pod slice is concrete.

Experimental integrity: The comparison is against an independent, hand-audited baseline rather than a previous generation of the same system, which is what makes numerical agreement meaningful. The honest limitation is scope: this is demonstrated for one library in one domain, and the claim that docs can be the durable artifact is offered as a suggestion rather than a general result. Whether the approach survives a domain where the specification itself is contested — rather than formalisable as cost expressions — is left open, and the paper does not overreach it.

Writing quality: The inversion is stated flatly in the title and abstract, which is the right treatment for a claim this counterintuitive. Because the practical question is what a design doc in this style looks like, a short annotated example — one operator, its worked example, and the regenerated implementation — would let a team assess whether their own domain admits this treatment.

Verdict: strong accept — it makes a well-argued case for inverting source and documentation in a domain where code demonstrably expires, and it backs the inversion with numerical agreement against hand-audited references.

Takeaways

  • Ask whether regeneration has become cheaper than patching. When it has, the durable artifact moves up a level — and that changes what you should be maintaining.
  • Specify with worked examples, not prose. An example applies conventions to concrete numbers where a description leaves them to be inferred.
  • Constrain the output space with a minimal core. A small recursive IR limits what a regenerated implementation can be, which is what makes regeneration reliable rather than creative.
  • Test regeneration against an independent, hand-audited baseline. Agreement with a previous generation of the same system proves nothing about correctness.

论文: 2609.05364 作者: Samuel Kushnir, Kimia Noorbakhsh, Kavya Sreedhar, Liqun Cheng, Ming Liu, Parthasarathy Ranganathan, Mohammad Alizadeh, Fred Kjolstad, Suvinay Subramanian 分类: cs.PL, cs.AI

缺口

机器学习性能建模,对长寿命软件来说是敌意地形。 一个性能模型编码了关于硬件与被服务模型的假设——分块尺寸、内存层次、注意力的形状、一次集合通信的开销。当其中任何一边的下一代到来时,这些假设就失效了,框架必须重构。不是”有时”,而是在这个领域的本性之下、持续不断

论文指出了一项改变这个循环经济性的变化:编程智能体如今已足够快、足够强,重生成整个库比”用增量打补丁的方式偿还技术债”更便宜。 如果重生成是更便宜的选项,那么耐久产物就不再是代码——而是智能体据以重生成的那个东西。这重新框定了设计问题:如果代码是一次性的,真相来源应该是什么?

   ML 性能建模:敌意地形

   一个性能模型「编码了关于硬件与被服务模型的假设」:
     分块尺寸 | 内存层次 | 注意力的形状
     一次集合通信的开销
        |
        v
   当「任何一边」的下一代到来,这些假设就「失效」,
   框架必须「重构」
     -> 不是"有时",而是"在本性之下持续不断"
        |
        v
   [改变经济性的那个变化]
     编程智能体如今已足够快、足够强,
     「重生成整个库」比"用增量打补丁偿还技术债"更便宜
        |
        v
   如果重生成更便宜,耐久产物就「不再是代码」——
   而是智能体「据以重生成的那个东西」
        |
        v
   [被重构的设计问题] 如果代码是一次性的,
   「真相来源」应该是什么?

增量

一句话: 在这篇论文之前,性能建模库的真相来源是它的代码、而文档只是描述它;在这篇论文之后,文档是真相来源、代码由文档重生成,并且能把「手写核对的参考模型」复现到舍入精度。

核心机制

这个倒置才是贡献,而且它被精确陈述:主分支里几乎没有代码。 相反,仓库是一张由自足的自然语言设计文档构成的 DAG。三条后果直接由这个倒置推出:

  • 编程子智能体在版本更新时,仅凭文档重生成实现。 “仅凭文档”是承重的短语——智能体不查阅先前的实现,因此文档必须自身充分。这比”文档作为描述”的要求强得多。
  • 人类的每一次改动,都是对某份文档的自然语言编辑。 于是评审产物与真相来源是同一个对象;不存在”改了代码却没有对应文档改动”的情况,因为没有代码可改。
  • 构造上自带文档(self-documenting by construction)。 这一点是推出来的,而不是维护出来的:如果文档生成代码,文档就不可能过期。

有两个要素让重生成可靠,而它们正好对上两种可能的失效方式——规格不清、输出发散。

一种围绕”分步完整示例”构建的设计文档风格,这些示例充当生成智能体的上下文内演示。 选择完整示例是有理由的:对代价模型的散文式描述会留给智能体去推断惯例,而一个完整示例展示了惯例如何被应用到具体数字上。示例就是接口。

一个极简的、递归定义的算子 IR,具备三个性质符号化(SymPy)代价表达式、一个用于大规模扫描的快速解析汇总模式、以及一个用于精细调度研究的慢速模调度模式。IR 才是**约束重生成实现”可能成为什么”**的东西——一个极简的递归内核,而不是一个庞大的表面——而那两个模式,恰好对应人们对性能模型的两种实际用法:先宽扫,再放大看某一个调度。把两者放在同一个 IR 里,能防止这两个用例漂移成两套工具。

接着是可信性检查,也正是”这个主张值得认真对待”的理由。重生成的实现能复现「手写核对的参考模型」——其中包括在 TPU pod 切片上服务 DeepSeek-V3——到舍入精度。这里有两件事:参照对象是手写核对过的模型,因此它可信,而不只是”同一系统的上一代输出”;而舍入精度在一个真实的推理服务配置上是一个严苛的容差——这不是”重生成的代码能跑、数字差不多”,而是数值一致

论文的结论被谨慎地限制了范围,其谦抑值得引用:这个结果表明,设计文档——而不是代码——可以成为 ML 系统协同设计工具的耐久产物

   倒置:「主分支里几乎没有代码」
     取而代之,仓库是一张由「自足的自然语言设计文档」构成的 DAG
        |
        v
   三条后果
     [a] 编程子智能体在版本更新时「仅凭文档重生成实现」
           <- "仅凭文档"是承重的:智能体「不」查阅先前的实现
           <- 这比"文档作为描述"的要求强得多
     [b] 「人类每一次改动」都是对某份文档的自然语言编辑
           -> 评审产物与真相来源是「同一个对象」
     [c] 「构造上自带文档」
           <- 是推出来的,不是维护出来的:如果文档生成代码,
              文档就「不可能过期」

   让重生成可靠的两个要素
     (对应两种失效方式:规格不清、输出发散)

     [i] 一种围绕「分步完整示例」的设计文档风格,
         这些示例充当「上下文内演示」
           <- 散文留给智能体去「推断」惯例;
              完整示例「展示」惯例如何应用于具体数字
           -> 「示例就是接口」

     [ii] 一个极简的、递归定义的算子 IR,具备:
            符号化(SymPy)代价表达式
            用于「大规模扫描」的快速解析汇总模式
            用于「精细调度研究」的慢速模调度模式
           <- IR 约束重生成实现「可能成为什么」:
              极简递归内核,而非庞大表面
           <- 两个模式对应人们的两种实际用法:先宽扫、再放大
           -> 放在同一个 IR 里,
              能防止两个用例漂移成两套工具

   可信性检查
     重生成的实现能复现「手写核对的参考模型」——
     包括在 TPU pod 切片上服务 DeepSeek-V3——
     「到舍入精度」
       <- 参照是「手写核对」的,不是"同一系统的上一代输出"
       <- 真实服务配置上的舍入精度是「严苛」容差:
          不是"数字差不多",而是「数值一致」

   结论(范围被谨慎限制)
     表明「设计文档——而不是代码」可以成为
     ML 系统协同设计工具的耐久产物

可以用**“保存菜谱,而不是保存做好的菜”来理解这件事: 如果菜会坏——而在这个领域,每当厨房设备变化,菜就按计划坏掉——那么”存菜”就是存一个永远在变质的东西。改为存菜谱**,每次设备变了就再做一遍。 两件事决定这能否成立。菜谱必须足够具体,让一位称职的厨师不用看着上一盘是怎么做的也能做出同一道菜——这就是完整示例的作用。而且必须有一套受约束的操作词汇,免得这位厨师每次发明一种不同的技法——这就是 IR 的作用。 而能让它令人信服的,是拿去和一位从未看过菜谱的专家做的那盘菜进行盲品对比:那就是”手写核对的参考模型、舍入精度”。

关键概念

  • 文档为真相来源、代码为构建产物: 仓库主分支是一张设计文档 DAG。它让评审产物与耐久产物成为同一个对象,并让”过期”在结构上不可能。
  • 仅凭文档重生成: 子智能体不查阅先前的实现。这比普通文档要求强得多,也正是它迫使文档成为完整的规格说明
  • 以完整示例作为接口: 分步示例充当上下文内演示。它们展示惯例在数字上的应用,而散文会把这些留给推断。
  • 极简递归 IR 与两个模式: 符号化代价表达式、用于扫描的快速汇总、用于精细研究的慢速调度模式。它约束了重生成实现的空间,并把两个用例留在同一个工具里。
  • 手写核对参照下的舍入精度: 可信性检查,而且严苛。它排除了”重生成代码大致吻合”,要求与可信基线数值一致

框架转变

之前(代码是真相来源):
  性能模型存在于代码里
  文档描述代码
  -> 当硬件或模型变化,假设失效,框架必须「重构」
  -> 持续的技术债,用增量方式偿还

之后(文档是真相来源):
  主分支是一张自然语言设计文档的 DAG
  子智能体「仅凭文档」重生成实现
  人类每次改动都是文档编辑;构造上自带文档
  -> 重生成的代码与手写核对参照「舍入精度」一致

从”维护一个假设会到期的代码库”,转变为”维护一份据以重建代码库的规格说明”,核心转变在于:当重生成比打补丁更便宜时,耐久产物上移了一层,代码变成了产物。

专家评审

选题眼光: 极好,而且领域的选择才让它可信、而非空想。 性能建模是”文档优先开发”最强的一个用例,因为它的假设按可预期的节奏到期——因此这个论证不依赖于关于文档的泛泛主张,而是落在一个代码半衰期明显很短的领域上。

方法成熟度: 两个使能要素正好对上两种真实失效模式,而且都选得好。 把”完整示例”作为规格格式,解决了让重生成代码漂移的歧义问题;而”极简递归 IR + 两个模式”约束了空间,使重生成成为在一个小区域内的搜索,而不是无边界的生成。 测试协议是最强的一环:与手写核对的参照比较、并要求在真实服务配置上达到舍入精度,是一道很高的门槛;而在 TPU pod 切片上对 DeepSeek-V3 报出这个结果,也足够具体。

实验诚意: 比较对象是一个独立的、手写核对的基线,而不是同一系统的上一代输出——这正是让”数值一致”有意义的原因。 诚实的局限在范围上:这在一个领域、一个库上得到演示,而”文档可以成为耐久产物”这一主张是以建议而非普遍结论的形式给出的。该做法能否在一个规格本身有争议(而非可形式化为代价表达式)的领域中存活,被留作开放,论文也没有越界。

写作功力: 倒置在标题与摘要里被直白陈述,对一个如此反直觉的主张来说,这是正确的处理。 由于实际问题是”这种风格的设计文档长什么样”,若能给一个简短的带注释示例——一个算子、它的完整示例、以及重生成的实现——会让团队评估自己的领域是否适合这种做法。

判决: 强接收(Strong Accept) — 它在一个”代码明显会到期”的领域里,为”倒置源码与文档”给出了论证充分的理由,并用与手写核对参照的数值一致来支撑这个倒置。

要点总结

  • 问一句:重生成是否已经比打补丁更便宜。当它更便宜时,耐久产物就上移了一层——而这改变了你应当维护什么。
  • 完整示例而不是散文来写规格。示例把惯例应用到具体数字上,而描述会把惯例留给推断。
  • 用一个极简内核约束输出空间。小的递归 IR 限制了重生成实现”可能成为什么”,而这才让重生成可靠而不是发挥创意
  • 独立的、手写核对的基线来检验重生成。与同一系统上一代输出一致,并不能证明正确性。