AI 与机器学习2019arxiv.org
连接机器学习与科学计算的可微编程系统
A Differentiable Programming System to Bridge ML and Scientific Computing
进阶 · 约 40 分钟读完前置知识:自动微分基础、Julia 语言、机器学习/科学计算基础
导读
这篇论文介绍一个面向科学计算与机器学习的可微编程系统(Julia 生态中的 Zygote),核心目标是在语言层面提供一等公民的自动微分支持,让同一套系统服务多个需要 AD 的社区。作者强调系统需要支持广泛的特性,例如可遍及的自定义梯度、高阶微分、混合模式以及超快标量 AD,并认为随着深度学习与科学计算混合模型的流行,这种通用性会越来越有价值。
HN 关注点:是因为论文来自 Julia/Zygote 作者,讨论了语言级自动微分的通用性,以及它在深度学习之外的科学计算场景中的前景。
后来怎么样
Zygote 成为 Julia 生态中主要的自动微分后端之一,支撑了 Flux.jl 与 SciML 的可微编程实践,并推动了语言级 AD 在科学计算中的应用。
HN 评论精选
这几条评论里:质疑 1 补充 1 亲历 2
亲历作者本人解释论文动机:展示语言级通用 AD 的广度,并强调通用性在混合模型时代会更有价值。
很高兴这篇论文终于上了 arXiv。写它最大的原因是想展示,在语言层面提供高质量、一等公民的 AD 支持,能覆盖多么广泛的应用。有好几个社区都需要这项技术,所以构建一个能同时服务它们、共享技巧的系统是合理的。我也希望这能让人理解,为什么我们对这个系统的功能需求列表如此长(可遍及的自定义梯度、高阶 AD、混合模式、超快标量 AD 等)。如今 AD 常常只被放在深度学习语境里讨论,但随着深度学习前沿推进、混合模型越来越流行,我相信我们对通用性的专注会在这里得到回报。
KenoFischer查看英文原文
Happy that this paper finally made it to arxiv. The biggest reason for writing it was to try and showcase some of the breadth of applications we see for really high quality first class AD support at the language level. There are several communities that need this technology, so it makes sense to try and build one system that can address all of them and share tricks. I'm also hoping this gives people a sense of why our list of feature requirements for this system is so extensive (pervasive custom gradients, higher order AD, mixed mode, ultra fast scalar AD, etc). These days AD is often discussed only in the context of deep learning, but as the frontiers of deep learning are pushed and hybrid models become more and more popular, I'm expecting our focus on generality to pay off here.
质疑对高阶导数 API 的内存与时间复杂度缺乏透明度表示担忧,建议提供类似复杂度速查表的文档。
这很重要,我对 zygote.jl 寄予厚望。观察与请求:对于高阶导数(Hessian、Laplacian 等),AD 库通常提供 API 快捷方式,但我发现很难控制或预测这些快捷方式的内存占用和时间复杂度。Laplacian 就是个典型例子:有时它先通过 forward-over-reverse 计算 Hessian,再取迹。在多数库里,你不得不深入文档或源码,才能理解中间值在内存中是如何累积的。我很想要一张汇总表,列出所有这些 API 快捷方式(laplacian、divergence、hessian 等)的复杂度,类似 Python 数据结构时间复杂度 wiki 那样,用输入/中间/输出维度数以及原函数求值复杂度来表示内存和时间复杂度。
jknz查看英文原文
This is huge and I have high hopes for zygote,jl. Observation/request: For higher-order derivatives (Hessian, Laplacian, etc), AD libraries typically provide API shortcuts. I have found it difficult to control or predict the memory footprint and the time complexity of these API shortcuts. Laplacian is case in point: it is sometimes computed by first computing the Hessian by forward-over-reverse and then taking the trace. In most libraries you would have to dig deep in the documentation or the code itself to understand how intermediary values are accumulated in memory for instance. I would love to have a summary table of the complexity of all these API shortcuts, similar to https://wiki.python.org/moin/TimeComplexity for data-structures, but for these AD shortcuts (laplacian, divergence, hessian, etc). The table would show memory and time complexity in terms of the number of the input/intermediary/output dimensions and the complexity of evaluating the original function.
亲历作为从 Fortran 转向 Julia 的科学计算用户,表达了对 Julia 生态(尤其是 DifferentialEquations)的亲身认可。
我只是粗略读了一下,但想说这看起来非常令人兴奋。Julia 整体上就是一门令人兴奋的语言。我最近把工作上的一些 Fortran 模拟换成了纯 Julia 实现,写起来非常有趣。DifferentialEquations 是一件了不起的作品!
endoftime5查看英文原文
I’ve just given this a cursory read but wanted to say that this looks really exciting. Julia in general seems like such an exciting language. I’ve recently switched some Fortran simulations at work for a pure Julia implementation and it is great fun to write. DifferentialEquations is a phenomenal piece of work!
补充提出替代方案:用函数式结构表达 AD,把优化交给现有编译器。
另一种思路:https://www.microsoft.com/en-us/research/video/the-simple-essence-of-automatic-differentiation/ ,即定义正确的函数式结构,用非常紧凑高效的方式表达自动微分,然后让现有编译器承担繁重工作。
GistNoesis查看英文原文
An alternative approach https://www.microsoft.com/en-us/research/video/the-simple-essence-of-automatic-differentiation/ where you define the right functional structures that allow a very compact and efficient way of expressing automatic differentiation and then let the existing compiler do the heavy lifting.
相关资源
从这篇论文所有 HN 讨论帖的全部评论里整理出来的链接。
历次讨论
- 2019Hacker News 讨论帖381 分 · 71 评
同领域还值得读
DeepSeek-R1:通过强化学习激励 LLM 的推理能力
DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via RL
研究如何用强化学习激励大语言模型的推理能力,提出 DeepSeek-R1,并探讨 RL 训练对模型推理表现的影响。
AI 与机器学习2025 · 1,351 分 · 1,056 评 · 引用 30进阶 · 约 80 分钟编辑精选1-bit LLM 时代:面向低成本计算的三值参数
The Era of 1-bit LLMs: ternary parameters for cost-effective computing
提出用三值参数 {-1, 0, 1} 替代 LLM 中的浮点权重,即所谓“1-bit LLM”。
AI 与机器学习2024 · 1,040 分 · 447 评 · 引用 19进阶 · 约 45 分钟编辑精选DeepSeek-V3.2:推进开放大语言模型的前沿
DeepSeek-v3.2: Pushing the frontier of open large language models
这是 DeepSeek-V3.2 的技术报告,延续了 DeepSeek 开源权重模型的路线,目标是让开放模型继续逼近甚至追平前沿闭源模型。
AI 与机器学习2025 · 982 分 · 465 评进阶 · 约 90 分钟编辑精选通过自我对弈与通用强化学习掌握国际象棋和将棋(AlphaZero)
Mastering Chess and Shogi by Self-Play with General Reinforcement Learning
DeepMind 的 AlphaZero 论文:用通用强化学习算法(自我博弈 + MCTS + 神经网络),从零开始仅数小时训练便在国际象棋和将棋上击败了世界顶级引擎 Stock…
AI 与机器学习2017 · 539 分 · 270 评 · 引用 13进阶 · 约 90 分钟编辑精选用强化学习发现更快的矩阵乘法算法
Discovering faster matrix multiplication algorithms with reinforcement learning
论文提出 AlphaTensor,用强化学习搜索矩阵乘法算法。
AI 与机器学习2022 · 518 分 · 111 评专业 · 约 90 分钟编辑精选