paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Parallel dual-numbers reverse AD

并行双数(dual-numbers)反向模式自动微分
JFP vol.352025匹配度 2/10 · 论文关注函数式语言中并行 dual-numbers 反向自动微分的实现与复杂度,属于程序语言与数值计算交叉;与用户核心方向(面向 ML/Agentic 程序的静态分析、LLM 辅助静态分析/形式化验证、浮点程序分析、贝叶斯程序分析及其与 LLM 交叉)无直接关联。引用 8 inbox
TOM J. SMEDING, MATTHIJS I. L. VÁKÁR
crossref: 2026-09-10

AI 速览

一句话:提出可高效实现的并行 dual-numbers 反向 AD 技术,能对任务并行源程序生成任务并行导数计算。

双数式反向自动微分通过将每个标量值与一个反向传播函数配对,试图以简单方式实现反向 AD,但已有高阶语言正确性与复杂度分析基于定制操作语义,其高效实现尚不明确。本文借鉴线性因式分解,并结合函数式编程中可变数组等已知优化,将 dual-numbers 反向 AD 优化为具有正确复杂度、可在 Haskell 等标准函数式语言中高效实现的算法。作者给出可微分大部分 Haskell98 的实用实现,并首次将该技术扩展到任务并行源程序:无需为构造反向传播而串行化,而是直接生成任务并行的导数计算。

问题
研究问题:如何为高阶函数式语言中的 dual-numbers 反向模式 AD 给出兼具正确复杂度与高效实现的算法,并扩展到任务并行源程序。
方法
借鉴线性因式分解,结合可变数组等函数式编程常用优化,构造可在 Haskell 中实现的 dual-numbers 反向 AD,并保持源程序的任务并行性。
评估
通过一个能微分大部分 Haskell98 的实用实现展示可行性,并表明可对任务并行源程序生成任务并行的导数计算。
原文摘要(Abstract)

Abstract Where dual-numbers forward-mode automatic differentiation (AD) pairs each scalar value with its tangent value, dual-numbers reverse-mode AD attempts to achieve reverse AD using a similarly simple idea: by pairing each scalar value with a backpropagator function. Its correctness and efficiency on higher-order input languages have been analysed by Brunel, Mazza and Pagani, but this analysis used a custom operational semantics for which it is unclear whether it can be implemented efficiently. We take inspiration from their use of linear factoring to optimise dual-numbers reverse-mode AD to an algorithm that has the correct complexity and enjoys an efficient implementation in a standard functional language with support for mutable arrays, such as Haskell. Aside from the linear factoring ingredient, our optimisation steps consist of well-known ideas from the functional programming community. We demonstrate the use of our technique by providing a practical implementation that differentiates most of Haskell98. Where previous work on dual numbers reverse AD has required sequentialisation to construct the reverse pass, we demonstrate that we can apply our technique to task-parallel source programs and generate a task-parallel derivative computation.

链接与引用

DOI 原文 · arXiv · PDF(开放获取) · DBLP

BibTeX
@article{SmedingV25,
  title = {Parallel dual-numbers reverse AD},
  author = {TOM J. SMEDING and MATTHIJS I. L. VÁKÁR},
  journal = {Journal of Functional Programming},
  volume = {35},
  year = {2025},
  doi = {10.1017/s0956796825100051}
}