{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,1,9]],"date-time":"2026-01-09T03:33:13Z","timestamp":1767929593089,"version":"3.49.0"},"reference-count":34,"publisher":"Association for Computing Machinery (ACM)","issue":"POPL","license":[{"start":{"date-parts":[[2023,1,9]],"date-time":"2023-01-09T00:00:00Z","timestamp":1673222400000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"funder":[{"name":"NWO","award":["VI.Veni.202.124"],"award-info":[{"award-number":["VI.Veni.202.124"]}]}],"content-domain":{"domain":["dl.acm.org"],"crossmark-restriction":true},"short-container-title":["Proc. ACM Program. Lang."],"published-print":{"date-parts":[[2023,1,9]]},"abstract":"<jats:p>\n            Where dual-numbers forward-mode automatic differentiation (AD) pairs each scalar value with its tangent value, dual-numbers\n            <jats:italic>reverse-mode<\/jats:italic>\n            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\n            <jats:italic>linear factoring<\/jats:italic>\n            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.\n          <\/jats:p>","DOI":"10.1145\/3571247","type":"journal-article","created":{"date-parts":[[2023,1,11]],"date-time":"2023-01-11T21:58:14Z","timestamp":1673474294000},"page":"1573-1600","update-policy":"https:\/\/doi.org\/10.1145\/crossmark-policy","source":"Crossref","is-referenced-by-count":9,"title":["Efficient Dual-Numbers Reverse AD via Well-Known Program Transformations"],"prefix":"10.1145","volume":"7","author":[{"ORCID":"https:\/\/orcid.org\/0000-0002-4986-6820","authenticated-orcid":false,"given":"Tom J.","family":"Smeding","sequence":"first","affiliation":[{"name":"Utrecht University, Netherlands"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-4603-0523","authenticated-orcid":false,"given":"Matthijs I. L.","family":"V\u00e1k\u00e1r","sequence":"additional","affiliation":[{"name":"Utrecht University, Netherlands"}],"role":[{"role":"author","vocabulary":"crossref"}]}],"member":"320","published-online":{"date-parts":[[2023,1,11]]},"reference":[{"key":"e_1_2_1_1_1","doi-asserted-by":"publisher","DOI":"10.1145\/3371106"},{"key":"e_1_2_1_2_1","article-title":"Automatic Differentiation in Machine Learning: a Survey","volume":"18","author":"Baydin Atilim Gunes","year":"2017","unstructured":"Atilim Gunes Baydin , Barak A. Pearlmutter , Alexey Andreyevich Radul , and Jeffrey Mark Siskind . 2017 . Automatic Differentiation in Machine Learning: a Survey . J. Mach. Learn. Res. , 18 (2017), 153:1\u2013153:43. http:\/\/jmlr.org\/papers\/v18\/17-468.html Atilim Gunes Baydin, Barak A. Pearlmutter, Alexey Andreyevich Radul, and Jeffrey Mark Siskind. 2017. Automatic Differentiation in Machine Learning: a Survey. J. Mach. Learn. Res., 18 (2017), 153:1\u2013153:43. http:\/\/jmlr.org\/papers\/v18\/17-468.html","journal-title":"J. Mach. Learn. Res."},{"key":"e_1_2_1_3_1","doi-asserted-by":"publisher","DOI":"10.1145\/3158093"},{"key":"e_1_2_1_4_1","doi-asserted-by":"publisher","DOI":"10.1145\/3371132"},{"key":"e_1_2_1_5_1","unstructured":"Paulo Em\u00edlio de Vilhena and Fran\u00e7ois Pottier. 2021. Verifying a Minimalist Reverse-Mode AD Library. arXiv preprint arXiv:2112.07292. \t\t\t\t  Paulo Em\u00edlio de Vilhena and Fran\u00e7ois Pottier. 2021. Verifying a Minimalist Reverse-Mode AD Library. arXiv preprint arXiv:2112.07292."},{"key":"e_1_2_1_6_1","doi-asserted-by":"publisher","DOI":"10.1145\/3236765"},{"key":"e_1_2_1_7_1","doi-asserted-by":"publisher","DOI":"10.1137\/1.9780898717761"},{"key":"e_1_2_1_8_1","doi-asserted-by":"publisher","DOI":"10.1016\/0020-0190(86)90059-1"},{"key":"e_1_2_1_9_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-030-45231-5_17"},{"key":"e_1_2_1_10_1","unstructured":"Edward Kmett and  contributors. 2021. ad: Automatic Differentiation. https:\/\/hackage.haskell.org\/package\/ad \t\t\t\t  Edward Kmett and  contributors. 2021. ad: Automatic Differentiation. https:\/\/hackage.haskell.org\/package\/ad"},{"key":"e_1_2_1_11_1","doi-asserted-by":"publisher","DOI":"10.1145\/3498710"},{"key":"e_1_2_1_12_1","doi-asserted-by":"publisher","DOI":"10.1145\/178243.178246"},{"key":"e_1_2_1_13_1","volume-title":"The representation of the cumulative rounding error of an algorithm as a Taylor expansion of the local rounding errors. Master\u2019s Thesis (in Finnish)","author":"Linnainmaa Seppo","unstructured":"Seppo Linnainmaa . 1970. The representation of the cumulative rounding error of an algorithm as a Taylor expansion of the local rounding errors. Master\u2019s Thesis (in Finnish) , Univ. Helsinki . Seppo Linnainmaa. 1970. The representation of the cumulative rounding error of an algorithm as a Taylor expansion of the local rounding errors. Master\u2019s Thesis (in Finnish), Univ. Helsinki."},{"key":"e_1_2_1_14_1","doi-asserted-by":"publisher","DOI":"10.1002\/widm.1305"},{"key":"e_1_2_1_15_1","doi-asserted-by":"publisher","DOI":"10.1145\/3434309"},{"key":"e_1_2_1_16_1","volume-title":"CHAD for Expressive Total Languages. CoRR, abs\/2110.00446","author":"Nunes Fernando Lucatelli","year":"2021","unstructured":"Fernando Lucatelli Nunes and Matthijs V\u00e1k\u00e1r . 2021. CHAD for Expressive Total Languages. CoRR, abs\/2110.00446 ( 2021 ), arXiv:2110.00446. arxiv:2110.00446 Fernando Lucatelli Nunes and Matthijs V\u00e1k\u00e1r. 2021. CHAD for Expressive Total Languages. CoRR, abs\/2110.00446 (2021), arXiv:2110.00446. arxiv:2110.00446"},{"key":"e_1_2_1_17_1","volume-title":"Automatic Differentiation for ML-family languages: correctness via logical relations. CoRR, abs\/2210.07724","author":"Nunes Fernando Lucatelli","year":"2022","unstructured":"Fernando Lucatelli Nunes and Matthijs V\u00e1k\u00e1r . 2022. Automatic Differentiation for ML-family languages: correctness via logical relations. CoRR, abs\/2210.07724 ( 2022 ), arXiv:2210.07724. arxiv:2210.07724 Fernando Lucatelli Nunes and Matthijs V\u00e1k\u00e1r. 2022. Automatic Differentiation for ML-family languages: correctness via logical relations. CoRR, abs\/2210.07724 (2022), arXiv:2210.07724. arxiv:2210.07724"},{"key":"e_1_2_1_18_1","volume-title":"Logical Relations for Partial Features and Automatic Differentiation Correctness. CoRR, abs\/2210.08530","author":"Nunes Fernando Lucatelli","year":"2022","unstructured":"Fernando Lucatelli Nunes and Matthijs V\u00e1k\u00e1r . 2022. Logical Relations for Partial Features and Automatic Differentiation Correctness. CoRR, abs\/2210.08530 ( 2022 ), arXiv:2210.08530. arxiv:2210.08530 Fernando Lucatelli Nunes and Matthijs V\u00e1k\u00e1r. 2022. Logical Relations for Partial Features and Automatic Differentiation Correctness. CoRR, abs\/2210.08530 (2022), arXiv:2210.08530. arxiv:2210.08530"},{"key":"e_1_2_1_19_1","volume-title":"NIPS 2017 Autodiff Workshop: The future of gradient-based machine learning software and techniques. Curran Associates, Inc.","author":"Paszke Adam","year":"2017","unstructured":"Adam Paszke , Sam Gross , Soumith Chintala , Gregory Chanan , Edward Yang , Zachary DeVito , Zeming Lin , Alban Desmaison , Luca Antiga , and Adam Lerer . 2017 . Automatic differentiation in PyTorch . In NIPS 2017 Autodiff Workshop: The future of gradient-based machine learning software and techniques. Curran Associates, Inc. , Red Hook, NY, USA. Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. 2017. Automatic differentiation in PyTorch. In NIPS 2017 Autodiff Workshop: The future of gradient-based machine learning software and techniques. Curran Associates, Inc., Red Hook, NY, USA."},{"key":"e_1_2_1_20_1","volume-title":"Getting to the Point. Index Sets and Parallelism-Preserving Autodiff for Pointful Array Programming. CoRR, abs\/2104.05372","author":"Paszke Adam","year":"2021","unstructured":"Adam Paszke , Daniel Johnson , David Duvenaud , Dimitrios Vytiniotis , Alexey Radul , Matthew Johnson , Jonathan Ragan-Kelley , and Dougal Maclaurin . 2021. Getting to the Point. Index Sets and Parallelism-Preserving Autodiff for Pointful Array Programming. CoRR, abs\/2104.05372 ( 2021 ), arxiv:2104.05372. Adam Paszke, Daniel Johnson, David Duvenaud, Dimitrios Vytiniotis, Alexey Radul, Matthew Johnson, Jonathan Ragan-Kelley, and Dougal Maclaurin. 2021. Getting to the Point. Index Sets and Parallelism-Preserving Autodiff for Pointful Array Programming. CoRR, abs\/2104.05372 (2021), arxiv:2104.05372."},{"key":"e_1_2_1_21_1","doi-asserted-by":"publisher","DOI":"10.1145\/1330017.1330018"},{"key":"e_1_2_1_22_1","doi-asserted-by":"publisher","DOI":"10.1023\/A:1010027404223"},{"key":"e_1_2_1_23_1","volume-title":"Oancea","author":"Schenck Robert","year":"2022","unstructured":"Robert Schenck , Ola R\u00f8nning , Troels Henriksen , and Cosmin E . Oancea . 2022 . AD for an Array Language with Nested Parallelism. CoRR , abs\/2202.10297 (2022), arXiv:2202.10297. arxiv:2202.10297 Robert Schenck, Ola R\u00f8nning, Troels Henriksen, and Cosmin E. Oancea. 2022. AD for an Array Language with Nested Parallelism. CoRR, abs\/2202.10297 (2022), arXiv:2202.10297. arxiv:2202.10297"},{"key":"e_1_2_1_24_1","doi-asserted-by":"publisher","DOI":"10.1145\/3341701"},{"key":"e_1_2_1_25_1","doi-asserted-by":"publisher","DOI":"10.1145\/636517.636528"},{"key":"e_1_2_1_26_1","unstructured":"Jesse Sigal. 2021. Automatic differentiation via effects and handlers: An implementation in Frank. arXiv preprint arXiv:2101.08095. \t\t\t\t  Jesse Sigal. 2021. Automatic differentiation via effects and handlers: An implementation in Frank. arXiv preprint arXiv:2101.08095."},{"key":"e_1_2_1_27_1","doi-asserted-by":"publisher","DOI":"10.5281\/zenodo.7130343"},{"key":"e_1_2_1_28_1","volume-title":"Efficient Dual-Numbers Reverse AD via Well-Known Program Transformations. CoRR, abs\/2207.03418v2","author":"Smeding Tom","year":"2022","unstructured":"Tom Smeding and Matthijs V\u00e1k\u00e1r . 2022. Efficient Dual-Numbers Reverse AD via Well-Known Program Transformations. CoRR, abs\/2207.03418v2 ( 2022 ), https:\/\/doi.org\/10.48550\/arXiv.2207.03418 arXiv:2207.03418v2. 10.48550\/arXiv.2207.03418 Tom Smeding and Matthijs V\u00e1k\u00e1r. 2022. Efficient Dual-Numbers Reverse AD via Well-Known Program Transformations. CoRR, abs\/2207.03418v2 (2022), https:\/\/doi.org\/10.48550\/arXiv.2207.03418 arXiv:2207.03418v2."},{"key":"e_1_2_1_29_1","doi-asserted-by":"publisher","DOI":"10.2172\/5254402"},{"key":"e_1_2_1_30_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-030-72019-3_22"},{"key":"e_1_2_1_31_1","doi-asserted-by":"publisher","DOI":"10.1145\/3527634"},{"key":"e_1_2_1_32_1","volume-title":"NeurIPS Workshop on Program Transformations.","author":"Vytiniotis Dimitrios","year":"2019","unstructured":"Dimitrios Vytiniotis , Dan Belov , Richard Wei , Gordon Plotkin , and Martin Abadi . 2019 . The differentiable curry . NeurIPS Workshop on Program Transformations. Dimitrios Vytiniotis, Dan Belov, Richard Wei, Gordon Plotkin, and Martin Abadi. 2019. The differentiable curry. NeurIPS Workshop on Program Transformations."},{"key":"e_1_2_1_33_1","volume-title":"6th International Conference on Learning Representations, ICLR","author":"Wang Fei","year":"2018","unstructured":"Fei Wang and Tiark Rompf . 2018. A Language and Compiler View on Differentiable Programming . In 6th International Conference on Learning Representations, ICLR 2018 , Vancouver, BC , Canada, April 30 - May 3, 2018, Workshop Track Proceedings. OpenReview .net. https:\/\/openreview.net\/forum?id=SJxJtYkPG Fei Wang and Tiark Rompf. 2018. A Language and Compiler View on Differentiable Programming. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Workshop Track Proceedings. OpenReview.net. https:\/\/openreview.net\/forum?id=SJxJtYkPG"},{"key":"e_1_2_1_34_1","doi-asserted-by":"publisher","DOI":"10.1145\/355586.364791"}],"container-title":["Proceedings of the ACM on Programming Languages"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3571247","content-type":"unspecified","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3571247","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,6,17]],"date-time":"2025-06-17T18:08:22Z","timestamp":1750183702000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3571247"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2023,1,9]]},"references-count":34,"journal-issue":{"issue":"POPL","published-print":{"date-parts":[[2023,1,9]]}},"alternative-id":["10.1145\/3571247"],"URL":"https:\/\/doi.org\/10.1145\/3571247","relation":{},"ISSN":["2475-1421"],"issn-type":[{"value":"2475-1421","type":"electronic"}],"subject":[],"published":{"date-parts":[[2023,1,9]]},"assertion":[{"value":"2023-01-11","order":2,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}]}}