Hacker News new | ask | show | jobs
by tiarkrompf 2313 days ago
Co-author here - nice to see this discussed and happy to answer questions
2 comments

Can any continuations work? I think that single-usage delimited continuations, as in E, are not able to implement the reverse-mode AD technique directly. This is because your continuations are called multiple times.

Thanks for this paper. Along with the string of "compiling to categories" papers, our understanding of AD has improved greatly.

I have not read the paper yet but, reading the abstract, the idea of using continuation to store the differentiation information is reminiscent of the technique used in Zygote[0].

Is there some parenty between the ideas ?

[0]: https://arxiv.org/abs/1810.07951v4

I believe Zygote's approach is based on the backpropagator of Pearlmutter and Siskind. The back propagator approach seems much simpler to me, although the authors of this paper suggest that it requires non-local program transformations

> The implementation proposed by Pearlmutter and Siskind returns a pair of a value and a backpropagator ... Doing this correctly requires a non-local program transformation ... Further tweaks arerequired if a lambda uses variables from an outer scope ... In contrast to Pearlmutter and Siskind [2008], using delimited continuations enables reverse-mode AD with only local transformations. Any underlying non-local transformations are implicitly resolved by shift and reset.

I'll have to look more carefully to understand how the CPS version avoids non-local program transformations.