We present a geometric formulation of automatic differentiation (AD) using jet bundles and Weil algebras. Reverse-mode AD emerges as cotangent-pullback, while Taylor-mode corresponds to evaluation in a Weil algebra. From these principles, we derive concise statements on correctness, stability, and complexity: a functorial identity for reverse-mode, algebraic exactness of higher-order derivatives, and explicit bounds on truncation error. We further show that tensorized Weil algebras permit one-pass computation of all mixed derivatives with cost linear in the algebra dimension, avoiding the combinatorial blow-up of nested JVP/VJP schedules. This framework interprets AD theory through the lens of differential geometry and offers a foundation for developing structure-preserving differentiation methods in deep learning and scientific computing. Code and examples are available at https://git.nilu.no/geometric-ad/jet-weil-ad.
翻译:本文提出了一种基于射流丛和Weil代数的自动微分几何表述。反向模式自动微分表现为余切拉回运算,而泰勒模式则对应于Weil代数中的求值运算。基于这些原理,我们推导出关于正确性、稳定性和复杂性的简明论断:反向模式的函子恒等式、高阶导数的代数精确性,以及截断误差的显式界。我们进一步证明,张量化Weil代数允许以代数维度的线性成本单次计算所有混合导数,从而避免了嵌套JVP/VJP调度带来的组合爆炸。该框架通过微分几何的视角阐释自动微分理论,并为开发深度学习和科学计算中保持结构特性的微分方法奠定基础。代码与示例可在https://git.nilu.no/geometric-ad/jet-weil-ad获取。