about
Connections Between Automatic Differentiation and Delimited Continuations (arxiv.org)
2 points by ericjang on Apr 3, 2018 | hide | past | pdf | discuss on HN

In plain words: Gradients can be computed backwards through any program using a trick that saves and resumes the rest of a calculation, needing no extra bookkeeping lists. With code generation it runs as fast as graph-based tools while staying as flexible as simple library ones.

Abstract · Demystifying Differentiable Programming: Shift/Reset the Penultimate Backpropagator

Deep learning has seen tremendous success over the past decade in computer vision, machine translation, and gameplay. This success rests in crucial ways on gradient-descent optimization and the ability to learn parameters of a neural network by backpropagating observed errors. However, neural network architectures are growing increasingly sophisticated and diverse, which motivates an emerging quest for even more general forms of differentiable programming, where arbitrary parameterized computations can be trained by gradient descent. In this paper, we take a fresh look at automatic differentiation (AD) techniques, and especially aim to demystify the reverse-mode form of AD that generalizes backpropagation in neural networks. We uncover a tight connection between reverse-mode AD and delimited continuations, which permits implementing reverse-mode AD purely via operator overloading and without any auxiliary data structures. We further show how this formulation of AD can be fruitfully combined with multi-stage programming (staging), leading to a highly efficient implementation that combines the performance benefits of deep learning frameworks based on explicit reified computation graphs (e.g., TensorFlow) with the expressiveness of pure library approaches (e.g., PyTorch).

Fei Wang, Daniel Zheng, James Decker, Xilun Wu, Grégory M. Essertel, Tiark Rompf
arXiv:1803.10228 · cs.LG, stat.ML · submitted Mar 27, 2018 · updated Aug 29, 2019
abstract · pdf

add comment on HN
Also discussed: Feb 2020 (110 points, 42 comments) · Aug 2019 (3 points, 0 comments) · May 2018 (3 points, 0 comments)