Hostname: page-component-89b8bd64d-4ws75 Total loading time: 0 Render date: 2026-05-10T09:07:59.887Z Has data issue: false hasContentIssue false

Perturbation confusion in forward automatic differentiation of higher-order functions

Published online by Cambridge University Press:  16 September 2019

OLEKSANDR MANZYUK
Affiliation:
Department of Computer Science and Hamilton Institute, Maynooth University, Co. Kildare, Ireland (e-mails: manzyuk@gmail.com, barak@pearlmutter.net, axch@alum.mit.edu, kumoyuki@gmail.com)
BARAK A. PEARLMUTTER
Affiliation:
Department of Computer Science and Hamilton Institute, Maynooth University, Co. Kildare, Ireland (e-mails: manzyuk@gmail.com, barak@pearlmutter.net, axch@alum.mit.edu, kumoyuki@gmail.com)
ALEXEY ANDREYEVICH RADUL
Affiliation:
Department of Computer Science and Hamilton Institute, Maynooth University, Co. Kildare, Ireland (e-mails: manzyuk@gmail.com, barak@pearlmutter.net, axch@alum.mit.edu, kumoyuki@gmail.com)
DAVID R. RUSH
Affiliation:
Department of Computer Science and Hamilton Institute, Maynooth University, Co. Kildare, Ireland (e-mails: manzyuk@gmail.com, barak@pearlmutter.net, axch@alum.mit.edu, kumoyuki@gmail.com)
JEFFREY MARK SISKIND
Affiliation:
School of Electrical and Computer Engineering, Purdue University, West Lafayette, IN 47907-2035, USA (e-mail: qobi@purdue.edu)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the 'Save PDF' action button.

Automatic differentiation (AD) is a technique for augmenting computer programs to compute derivatives. The essence of AD in its forward accumulation mode is to attach perturbations to each number, and propagate these through the computation by overloading the arithmetic operators. When derivatives are nested, the distinct derivative calculations, and their associated perturbations, must be distinguished. This is typically accomplished by creating a unique tag for each derivative calculation and tagging the perturbations. We exhibit a subtle bug, present in fielded implementations which support derivatives of higher-order functions, in which perturbations are confused despite the tagging machinery, leading to incorrect results. The essence of the bug is as follows: a unique tag is needed for each derivative calculation, but in existing implementations unique tags are created when taking the derivative of a function at a point. When taking derivatives of higher-order functions, these need not correspond! We exhibit a simple example: a higher-order function f whose derivative at a point x, namely f′(x), is itself a function which calculates a derivative. This situation arises naturally when taking derivatives of curried functions. Two potential solutions are presented, and their deficiencies discussed. One uses eta expansion to delay the creation of fresh tags in order to put them into one-to-one correspondence with derivative calculations. The other wraps outputs of derivative operators with tag substitution machinery. Both solutions seem very difficult to implement without violating the desirable complexity guarantees of forward AD.

Information

Type
Research Article
Creative Commons
Creative Common License - CCCreative Common License - BY
This is an Open Access article, distributed under the terms of the Creative Commons Attribution licence (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted reuse, distribution, and reproduction in any medium, provided the original work is properly cited.
Copyright
© The Author(s) (2019)
Supplementary material: File

Manzyuk et al. supplementary material

Manzyuk et al. supplementary material 1
Download Manzyuk et al. supplementary material(File)
File 5.3 KB

Manzyuk et al. supplementary material

Manzyuk et al. supplementary material 2

Download Manzyuk et al. supplementary material(Video)
Video 21.6 MB
Submit a response

Discussions

No Discussions have been published for this article.