一句话:将迭代编译为可微循环神经元,使离散算法可直接嵌入神经网络并加速学习。
在可微编程中,离散结构及其上的条件、迭代等控制流通常缺乏显式导数,因而难以直接嵌入梯度学习,限制了可表达的可微算法范围。本文提出 Cajal(N):一个带迭代、类型化、高阶且线性的最小语言,其迭代构造可被编译为线性循环神经元(recurrent neurons),从而以可微形式表达离散算法。作者证明该编译保持正确性。实验将循环神经元连接到求解迭代图像变换任务的神经网络,预先确定部分函数先验;相比没有一等迭代的基线,网络学习更快且数据效率更高。结论是循环神经元促进了学习与普通编程中离散结构之间的互动。
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---by compiling to linear recurrent neurons. We present a minimal typed, higher-order and linear programming language with iteration called Cajal(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.
DOI 原文 · arXiv · PDF(开放获取) · DBLP
@article{abs-2511-14953,
title = {Compiling to Recurrent Neurons},
author = {Joey Velez-Ginorio and Nada Amin and Konrad Kording and Steve Zdancewic},
journal = {Proceedings of the ACM on Programming Languages},
volume = {10},
number = {PLDI},
year = {2026},
doi = {10.1145/3808345}
}