Closed-form Continuous-Depth Models

Ramin M. Hasani, Mathias Lechner, Alexander Amini, Lucas Liebenwein, Max Tschaikowski, Gerald Teschl, Daniela Rus

Overview

Continuous-depth models, such as Neural Ordinary Differential Equations (Neural ODEs), offer significant advantages for modeling irregularly sampled time-series data. However, their reliance on iterative numerical solvers creates a computational bottleneck that hinders scalability. This paper introduces Closed-form Continuous-depth networks (CfCs), a new class of neural models that capture the expressive power of continuous-time systems without the massive overhead of numerical solvers. By deriving a novel closed-form approximation for neural interactions, the authors achieve training and inference speeds that are one to five orders of magnitude faster than ODE-based models while maintaining or exceeding state-of-the-art accuracy.

The Bottleneck: Numerical DE Solvers

Traditional continuous-time models treat the hidden state of a network as a continuous flow. To implement this on digital hardware, researchers typically use numerical differential equation (DE) solvers (e.g., the Euler method or Runge-Kutta). These solvers are the primary bottleneck of the system: they are computationally expensive, slow down training, and struggle to scale to large-scale problems. The authors sought to circumvent this by finding a way to solve the underlying dynamical system in closed-form—essentially replacing a slow, iterative simulation with a single, fast mathematical expression.

The Analytical Leap: From ODEs to Closed-Form

The authors focused on Liquid Time-Constant (LTC) networks, which are inspired by the dynamics of small nervous systems. Solving nonlinear differential equations in closed-form is generally considered intractable. The authors bridged this gap by first solving the LTC equations for "piecewise constant" inputs and then deriving a tightly-bounded approximation for general, continuous inputs.

The transition from a liquid time-constant differential equation to a closed-form analytical solution.

This mathematical breakthrough allows the network to compute its state at any time $t$ using a single formula. To make this derivation practical for modern deep learning, the authors implemented two key architectural choices:

  • Replacing Exponential Decay: Pure ODEs often involve exponential terms that cause vanishing gradients. CfCs replace these with a reversed sigmoidal nonlinearity, providing a smoother loss surface and more stable training.
  • Time-Continuous Gating: They implemented a gating mechanism (similar to LSTMs) that uses three "heads" branching from a shared backbone to control information flow continuously over time.

Performance and Efficiency

The primary advantage of CfCs is their computational efficiency. Because they are "solver-free," their complexity is comparable to standard discrete RNNs, yet they retain the ability to handle irregular time intervals naturally by simply plugging in the actual time elapsed ($t$) since the last observation.

Complexity comparison showing CfC's efficiency relative to RNNs, ODE-RNNs, and Transformers.

In empirical evaluations across diverse benchmarks—including autonomous driving, ICU mortality prediction (PhysioNet), and kinematic simulations (Walker2D)—CfCs demonstrated remarkable results:

  • Speedup: CfCs are 100x to 100,000x faster than ODE-based counterparts in training and inference.
  • Accuracy: On the Walker2D task, CfCs outperformed Transformers by an 18% margin.
  • Parameter Efficiency: In autonomous driving experiments, CfCs performed end-to-end lane keeping with only about 4,000 trainable parameters in their recurrent component.

Conclusion and Future Work

Closed-form Continuous-depth networks represent a significant step forward in time-series modeling. By bypassing the numerical solver bottleneck, they bring the benefits of continuous-time dynamics to resource-constrained environments like robotics and medical monitoring. While the authors note that Transformers remain the standard for massive language tasks, CfCs are an ideal choice for applications where efficiency, physical dynamics, and irregular sampling are the primary concerns. Future work may address potential vanishing gradient issues in extremely long-term dependencies through "mixed-memory" variants.

Summary updated

BibTeX
@article{hasani2022closed,
  author = {Ramin M. Hasani and Mathias Lechner and Alexander Amini and Lucas Liebenwein and Max Tschaikowski and Gerald Teschl and Daniela Rus},
  title = {{Closed-form Continuous-Depth Models}},
  journal = {Nat. Mac. Intell.},
  year = {2022},
  doi = {10.1038/s42256-022-00556-7},
}
Figure