{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,9,22]],"date-time":"2026-09-22T21:28:54Z","timestamp":1790112534630,"version":"4.0.1"},"reference-count":29,"publisher":"Association for Computing Machinery (ACM)","issue":"PLDI","license":[{"start":{"date-parts":[[2026,6,8]],"date-time":"2026-06-08T00:00:00Z","timestamp":1780876800000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/legalcode"}],"content-domain":{"domain":["dl.acm.org"],"crossmark-restriction":true},"short-container-title":["Proc. ACM Program. Lang."],"published-print":{"date-parts":[[2026,6,8]]},"abstract":"<jats:p>\n                    Discrete structures are currently second-class in differentiable programming. Since functions over discrete structures lack overt derivatives, differentiable programs do not differentiate through them and limit where they can be used. For example, when programming a neural network, conditionals and iteration cannot be used everywhere; they can break the derivatives necessary for gradient-based learning to work. This limits the class of differentiable algorithms we can directly express, imposing restraints on how we build neural networks and differentiable programs more generally. However, these restraints are not fundamental. Recent work shows conditionals can be first-class, by compiling them into differentiable form as linear neurons. Similarly, this work shows iteration can be first-class\u2014by compiling to linear\n                    <jats:italic toggle=\"yes\">recurrent<\/jats:italic>\n                    neurons. We present a minimal typed, higher-order and linear programming language with iteration called\n                    <jats:styled-content style=\"color:#005393\">\n                      <jats:monospace>\n                        <jats:bold>Cajal<\/jats:bold>\n                      <\/jats:monospace>\n                    <\/jats:styled-content>\n                    <jats:monospace>(<\/jats:monospace>\n                    <jats:styled-content style=\"color:#005393\">\n                      <jats:monospace>\u22b8<\/jats:monospace>\n                    <\/jats:styled-content>\n                    ,\n                    <jats:styled-content style=\"color:#005393\">\n                      <jats:monospace>\ud835\udfda<\/jats:monospace>\n                    <\/jats:styled-content>\n                    ,\n                    <jats:styled-content style=\"color:#005393\">\n                      <jats:monospace>\u2115<\/jats:monospace>\n                    <\/jats:styled-content>\n                    <jats:monospace>)<\/jats:monospace>\n                    . We prove its programs compile correctly to recurrent neurons, allowing discrete algorithms to be expressed in a differentiable form compatible with gradient-based learning. With our implementation, we conduct two experiments where we link these recurrent neurons against a neural network solving an iterative image transformation task. This determines part of its function prior to learning. As a result, the network learns faster and with greater data-efficiency relative to a neural network programmed without first-class iteration. A key lesson is that recurrent neurons enable a rich interplay between learning and the discrete structures of ordinary programming.\n                  <\/jats:p>","DOI":"10.1145\/3808345","type":"journal-article","created":{"date-parts":[[2026,6,8]],"date-time":"2026-06-08T18:04:09Z","timestamp":1780941849000},"page":"2452-2473","update-policy":"https:\/\/doi.org\/10.1145\/crossmark-policy","source":"Crossref","is-referenced-by-count":1,"title":["Compiling to Recurrent Neurons"],"prefix":"10.1145","volume":"10","author":[{"ORCID":"https:\/\/orcid.org\/0009-0004-6451-5107","authenticated-orcid":false,"given":"Joey","family":"Velez-Ginorio","sequence":"first","affiliation":[{"name":"University of Pennsylvania, Philadelphia, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-0830-7248","authenticated-orcid":false,"given":"Nada","family":"Amin","sequence":"additional","affiliation":[{"name":"Harvard University, Cambridge, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0001-8408-4499","authenticated-orcid":false,"given":"Konrad","family":"Kording","sequence":"additional","affiliation":[{"name":"University of Pennsylvania, Philadelphia, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-3516-1512","authenticated-orcid":false,"given":"Steve","family":"Zdancewic","sequence":"additional","affiliation":[{"name":"University of Pennsylvania, Philadelphia, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"320","published-online":{"date-parts":[[2026,6,8]]},"reference":[{"key":"e_1_3_2_2_2","doi-asserted-by":"publisher","DOI":"10.1145\/3371106"},{"key":"e_1_3_2_3_2","doi-asserted-by":"publisher","DOI":"10.1007\/0-8176-4435-0"},{"key":"e_1_3_2_4_2","unstructured":"Matko Bosnjak Tim Rocktaschel Jason Naradowsky and Sebastian Riedel . 2017. Programming with a differentiable forth interpreter. In International conference on machine learning. PMLR 547\u2013556. https:\/\/dl.acm.org\/doi\/10.5555\/3305381.3305438"},{"key":"e_1_3_2_5_2","unstructured":"James Bradbury Roy Frostig Peter Hawkins Matthew James Johnson Chris Leary Dougal Maclaurin George Necula Adam Paszke Jake VanderPlas Skye Wanderman-Milne and Qiao Zhang . 2018. JAX: composable transformations of Python+NumPy programs. http:\/\/github.com\/jax-ml\/jax"},{"key":"e_1_3_2_6_2","doi-asserted-by":"publisher","DOI":"10.1017\/S0960129502003729"},{"key":"e_1_3_2_7_2","doi-asserted-by":"publisher","DOI":"10.1145\/3236765"},{"key":"e_1_3_2_8_2","unstructured":"Alexander L Gaunt Marc Brockschmidt Nate Kushman and Daniel Tarlow . 2017. Differentiable programs with neural libraries. In International Conference on Machine Learning. PMLR 1213\u20131222. https:\/\/dl.acm.org\/doi\/abs\/10.5555\/3305381.3305507"},{"key":"e_1_3_2_9_2","article-title":"Neural turing machines","author":"Graves Alex","year":"2014","unstructured":"Alex Graves , Greg Wayne , and Ivo Danihelka . 2014. Neural turing machines. arXiv preprint arXiv:1410.5401 (2014). https:\/\/doi.org\/10.48550\/arXiv.1410.5401","journal-title":"arXiv preprint arXiv:1410.5401"},{"key":"e_1_3_2_10_2","article-title":"Hypernetworks","author":"Ha David","year":"2016","unstructured":"David Ha , Andrew Dai , and Quoc V Le . 2016. Hypernetworks. arXiv preprint arXiv:1609.09106 (2016). https:\/\/doi.org\/10.48550\/arXiv.1609.09106","journal-title":"arXiv preprint arXiv:1609.09106"},{"key":"e_1_3_2_11_2","doi-asserted-by":"publisher","DOI":"10.5555\/3002812"},{"key":"e_1_3_2_12_2","doi-asserted-by":"publisher","DOI":"10.1109\/ICPR.2010.579"},{"key":"e_1_3_2_13_2","unstructured":"Ozan Irsoy and Claire Cardie . 2014. Deep recursive neural networks for compositionality in language. Advances in neural information processing systems 27 (2014). https:\/\/proceedings.neurips.cc\/paper_files\/paper\/2014\/hash\/cb954cd53b6527a80248cc0732366871-Abstract.html"},{"key":"e_1_3_2_14_2","doi-asserted-by":"publisher","DOI":"10.7551\/mitpress\/4932.001.0001"},{"key":"e_1_3_2_15_2","unstructured":"Diederik P Kingma . 2014. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980 (2014). https:\/\/arxiv.org\/abs\/1412.6980"},{"key":"e_1_3_2_16_2","doi-asserted-by":"publisher","DOI":"10.1145\/3498710"},{"key":"e_1_3_2_17_2","volume-title":"Introductory functional analysis with applications","author":"Kreyszig Erwin","year":"1991","unstructured":"Erwin Kreyszig . 1991. Introductory functional analysis with applications. John Wiley & Sons."},{"key":"e_1_3_2_18_2","article-title":"Handwritten digit recognition with a back-propagation network","volume":"2","author":"LeCun Yann","year":"1989","unstructured":"Yann LeCun , Bernhard Boser , John Denker , Donnie Henderson , Richard Howard , Wayne Hubbard , and Lawrence Jackel . 1989. Handwritten digit recognition with a back-propagation network. Advances in neural information processing systems 2 (1989).","journal-title":"Advances in neural information processing systems"},{"key":"e_1_3_2_19_2","doi-asserted-by":"publisher","DOI":"10.1609\/aaai.v38i9.28934"},{"key":"e_1_3_2_20_2","doi-asserted-by":"crossref","unstructured":"Ziyang Li Jiani Huang and Mayur Naik . 2023. Scallop: A language for neurosymbolic programming. Proceedings of the ACM on Programming Languages 7 PLDI (2023) 1463\u20131487. https:\/\/arxiv.org\/abs\/2304.04812","DOI":"10.1145\/3591280"},{"key":"e_1_3_2_21_2","first-page":"15","article-title":"Categorical semantics of linear logic","volume":"27","author":"Mellies Paul-Andr\u00e9","year":"2009","unstructured":"Paul-Andr\u00e9 Mellies . 2009. Categorical semantics of linear logic. Panoramas et syntheses 27 (2009), 15\u2013215.","journal-title":"Panoramas et syntheses"},{"key":"e_1_3_2_22_2","article-title":"How to construct deep recurrent neural networks","author":"Pascanu Razvan","year":"2013","unstructured":"Razvan Pascanu , Caglar Gulcehre , Kyunghyun Cho , and Yoshua Bengio . 2013. How to construct deep recurrent neural networks. arXiv preprint arXiv:1312.6026 (2013). https:\/\/doi.org\/10.48550\/arXiv.1312.6026","journal-title":"arXiv preprint arXiv:1312.6026"},{"key":"e_1_3_2_23_2","unstructured":"Adam Paszke Sam Gross Francisco Massa Adam Lerer James Bradbury Gregory Chanan Trevor Killeen Zeming Lin Natalia Gimelshein Luca Antiga Alban Desmaison Andreas Kopf Edward Yang Zachary DeVito Martin Raison Alykhan Tejani Sasank Chilamkurthy Benoit Steiner Lu Fang Junjie Bai and Soumith Chintala . 2019. PyTorch: An Imperative Style High-Performance Deep Learning Library. In Advances in Neural Information Processing Systems H. Wallach H. Larochelle A. Beygelzimer F. d'Alch\u00e9-Buc E. Fox and R. Garnett (Eds.) Vol. 32. Curran Associates Inc. https:\/\/proceedings.neurips.cc\/paper_files\/paper\/2019\/file\/bdbca288fee7f92f2bfa9f7012727740-Paper.pdf"},{"key":"e_1_3_2_24_2","volume-title":"4th International Conference on Learning Representations, ICLR 2016","author":"Reed Scott E.","year":"2016","unstructured":"Scott E. Reed and Nando de Freitas . 2016. Neural Programmer-Interpreters. In 4th International Conference on Learning Representations, ICLR 2016, San Juan, Puerto Rico, May 2-4, 2016, Conference Track Proceedings, Yoshua Bengio and Yann LeCun (Eds.). https:\/\/doi.org\/10.48550\/arXiv.1511.06279"},{"key":"e_1_3_2_25_2","doi-asserted-by":"publisher","DOI":"10.1201\/9780429501906"},{"key":"e_1_3_2_26_2","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-319-10882-7_26"},{"key":"e_1_3_2_27_2","doi-asserted-by":"crossref","unstructured":"Joey Velez-Ginorio . 2026. Compiling to recurrent neurons. https:\/\/doi.org\/10.5281\/zenodo.18963154","DOI":"10.1145\/3808345"},{"key":"e_1_3_2_28_2","doi-asserted-by":"publisher","DOI":"10.1145\/3776677"},{"key":"e_1_3_2_29_2","first-page":"3","article-title":"Substructural type systems","author":"Walker David","year":"2005","unstructured":"David Walker . 2005. Substructural type systems. Advanced topics in types and programming languages (2005), 3\u201344. https:\/\/doi.org\/10.7551\/mitpress\/1104.003.0003","journal-title":"Advanced topics in types and programming languages"},{"key":"e_1_3_2_30_2","doi-asserted-by":"publisher","DOI":"10.7551\/mitpress\/3054.001.0001"}],"container-title":["Proceedings of the ACM on Programming Languages"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3808345","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2026,9,22]],"date-time":"2026-09-22T10:40:24Z","timestamp":1790073624000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3808345"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2026,6,8]]},"references-count":29,"journal-issue":{"issue":"PLDI","published-print":{"date-parts":[[2026,6,8]]}},"alternative-id":["10.1145\/3808345"],"URL":"https:\/\/doi.org\/10.1145\/3808345","relation":{},"ISSN":["2475-1421"],"issn-type":[{"value":"2475-1421","type":"electronic"}],"subject":[],"published":{"date-parts":[[2026,6,8]]},"assertion":[{"value":"2025-11-13","order":0,"name":"received","label":"Received","group":{"name":"publication_history","label":"Publication History"}},{"value":"2026-04-03","order":2,"name":"accepted","label":"Accepted","group":{"name":"publication_history","label":"Publication History"}},{"value":"2026-06-08","order":3,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}]}}