Skip to main content
QUICK REVIEW

[Paper Review] MALI: A memory efficient and reverse accurate integrator for Neural ODEs

Juntang Zhuang, Nicha C. Dvornek|arXiv (Cornell University)|May 3, 2021
Model Reduction and Neural NetworksPhysics and Astronomy38 references7 citations
TL;DR

MALI is a memory-efficient and reverse-accurate integrator for Neural ODEs that leverages the asynchronous leapfrog (ALF) solver to achieve constant memory usage over integration time, unlike traditional methods that scale with time. It enables accurate gradient estimation by preserving trajectory fidelity in reverse time, outperforming existing methods in ImageNet training, time-series modeling, and continuous generative modeling.

ABSTRACT

Neural ordinary differential equations (Neural ODEs) are a new family of deep-learning models with continuous depth. However, the numerical estimation of the gradient in the continuous case is not well solved: existing implementations of the adjoint method suffer from inaccuracy in reverse-time trajectory, while the naive method and the adaptive checkpoint adjoint method (ACA) have a memory cost that grows with integration time. In this project, based on the asynchronous leapfrog (ALF) solver, we propose the Memory-efficient ALF Integrator (MALI), which has a constant memory cost w.r.t integration time similar to the adjoint method, and guarantees accuracy in reverse-time trajectory (hence accuracy in gradient estimation). We validate MALI in various tasks: on image recognition tasks, to our knowledge, MALI is the first to enable feasible training of a Neural ODE on ImageNet and outperform a well-tuned ResNet, while existing methods fail due to either heavy memory burden or inaccuracy; for time series modeling, MALI significantly outperforms the adjoint method; and for continuous generative models, MALI achieves new state-of-the-art performance. We provide a pypi package: https://jzkay12.github.io/TorchDiffEqPack

Motivation & Objective

  • To address the high memory cost and inaccuracy in reverse-time trajectory estimation that plague existing Neural ODE training methods.
  • To develop an integrator that maintains constant memory usage regardless of integration time, matching the efficiency of the adjoint method.
  • To ensure numerical accuracy in reverse-time integration, thereby improving gradient estimation reliability.
  • To enable feasible training of Neural ODEs on large-scale datasets like ImageNet, where prior methods fail due to memory or accuracy limitations.
  • To achieve state-of-the-art performance in continuous generative modeling and time-series modeling tasks.

Proposed method

  • MALI is built upon the asynchronous leapfrog (ALF) solver, which enables stable and accurate time integration with low memory overhead.
  • The method stores only the necessary intermediate states for reverse-time integration, ensuring memory cost remains constant regardless of integration duration.
  • MALI enforces reverse-time trajectory accuracy by maintaining consistent time-step synchronization during adjoint computation.
  • It uses a checkpointing strategy that is both memory-efficient and numerically stable, avoiding error accumulation in reverse passes.
  • The integrator supports adaptive time stepping while preserving accuracy, making it suitable for complex dynamics.
  • MALI is implemented in PyTorch and released as a public package: https://jzkay12.github.io/TorchDiffEqPack

Experimental results

Research questions

  • RQ1Can a Neural ODE integrator be designed to maintain constant memory usage over long integration times without sacrificing reverse-time accuracy?
  • RQ2Does MALI enable feasible training of Neural ODEs on large-scale datasets like ImageNet, where prior methods fail due to memory or gradient inaccuracy?
  • RQ3How does MALI compare to the adjoint method in terms of gradient accuracy and performance on time-series modeling tasks?
  • RQ4Can MALI achieve state-of-the-art results in continuous normalizing flow and other continuous generative modeling tasks?
  • RQ5What is the impact of reverse-time trajectory accuracy on final model performance across diverse machine learning tasks?

Key findings

  • MALI enables the first feasible training of a Neural ODE on ImageNet, achieving performance that surpasses a well-tuned ResNet.
  • MALI outperforms the adjoint method in time-series modeling tasks, demonstrating superior predictive accuracy.
  • MALI achieves new state-of-the-art performance in continuous generative modeling, particularly in normalizing flow-based density estimation.
  • The method maintains constant memory cost with respect to integration time, unlike ACA and naive methods that scale linearly.
  • MALI ensures high accuracy in reverse-time trajectory, leading to reliable and precise gradient estimation.
  • The open-source implementation in PyPI allows researchers to easily adopt and extend MALI for various continuous-depth models.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.