𝜆ₛ: computable semantics for differentiable programming with higher-order functions and datatypes
Benjamin Sherman, Jesse Michel, Michael Carbin
Proceedings of the ACM on Programming Languages·2021·7 citations
<jats:p>Deep learning is moving towards increasingly sophisticated optimization objectives that employ higher-order functions, such as integration, continuous optimization, and root-finding. Since differentiable programming frameworks such as PyTorch and TensorFlow do not have first-class representations of these functions, developers must reason about the semantics of such objectives and manually translate them to differentiable code.</jats:p>
<jats:p>
We present a differentiable programming language, λ
<jats:sub>
<jats:italic>S</jats:italic>
</jats:sub>
, that is the first to deliver a semantics for higher-order functions, higher-order derivatives, and Lipschitz but nondifferentiable functions. Together, these features enableλ
<jats:sub>
<jats:italic>S</jats:italic>
</jats:sub>
to expose differentiable, higher-order functions for integration, optimization, and root-finding as first-class functions with automatically computed derivatives. λ
<jats:sub>
<jats:italic>S</jats:italic>
</jats:sub>
’s semantics is computable, meaning that values can be computed to arbitrary precision, and we implement λ
<jats:sub>
<jats:italic>S</jats:italic>
</jats:sub>
as an embedded language in Haskell.
</jats:p>
<jats:p>
We use λ
<jats:sub>
<jats:italic>S</jats:italic>
</jats:sub>
to construct novel differentiable libraries for representing probability distributions, implicit surfaces, and generalized parametric surfaces – all as instances of higher-order datatypes – and present case studies that rely on computing the derivatives of these higher-order functions and datatypes. In addition to modeling existing differentiable algorithms, such as a differentiable ray tracer for implicit surfaces, without requiring any user-level differentiation code, we demonstrate new differentiable algorithms, such as the Hausdorff distance of generalized parametric surfaces.
</jats:p>