Neural Piecewise-Constant Delay Differential Equations

Qunxi Zhu, Yifei Shen, Dongsheng Li, Wei Lin

Abstract

Neural Ordinary Differential Equations (NODEs) are powerful tools for modeling continuous-time dynamics but are fundamentally limited by their inability to learn non-homeomorphic mappings. Neural Delay Differential Equations (NDDEs) overcome this by incorporating historical states, yet they incur prohibitive computational costs due to the need for continuous history recomputation. We propose Neural Piecewise-Constant Delay Differential Equations (NPCDDEs), a novel class of continuous-depth networks that utilize piecewise-constant delays. This approach enables the modeling of complex "memory" effects with $O(1)$ memory cost and $O(K)$ time complexity. We prove that NPCDDEs are universal approximators and demonstrate their efficacy on synthetic chaotic systems and standard image classification benchmarks (MNIST, CIFAR10, SVHN), where they consistently outperform both NODEs and traditional NDDEs.

Introduction

Neural Ordinary Differential Equations (NODEs) have gained popularity for bridging dynamical systems and deep learning. However, they possess a fundamental topological flaw: because they are based on continuous flows (homeomorphisms), they cannot learn mappings that require trajectories to cross or fold, such as separating concentric rings. While Neural Delay Differential Equations (NDDEs) address this by looking at past states, they are computationally intensive. Calculating gradients in NDDEs requires recomputing the entire system history at every step, leading to massive memory and time overhead. This paper introduces NPCDDEs to retain the expressive power of delays while maintaining computational efficiency.

Methodology

The core innovation of NPCDDEs is the transformation of a continuous delay into a piecewise-constant one. By using a floor function $\lfloor t/\tau \rfloor$, the model references the state at the beginning of discrete time intervals rather than interpolating a continuous history.

Key technical components include:

  • The Piecewise Trick: Discretizing the delay makes the vector field constant over specific intervals, simplifying the underlying differential equations.
  • Universal Approximation: The authors prove that by incorporating skip connections from multiple previous time intervals, the model can approximate any continuous function, overcoming the limitations of NODEs.
  • Adjoint Sensitivity Method: A specialized version of the backpropagation algorithm was derived for these piecewise systems, allowing for efficient training with $O(1)$ memory cost.
  • Unshared NPCDDEs (UNPCDDEs): This extension allows network parameters to change across different time intervals, effectively generalizing architectures like ResNets and standard NODEs.

Results and Evaluation

The model was evaluated on synthetic 1D population dynamics and standard image classification benchmarks. In chaotic regimes of 1D dynamics, NPCDDEs significantly outperformed both NODEs and NDDEs in terms of training and test loss.

Figure 5: Comparison of loss curves and learned trajectories for NODE and NPCDDE variants on the concentric rings task.

On image classification tasks, the UNPCDDE architecture showed consistent improvements. On CIFAR10, a UNPCDDE with 5 delay steps achieved 56.73% accuracy, outperforming the standard NODE (53.92%) and NDDE (55.69%). Similar gains were observed on the SVHN dataset, where UNPCDDE5 reached 83.45%, compared to 80.66% for the base NODE.

Key Insights: Breaking Homeomorphism

The primary theoretical advantage of NPCDDEs is their ability to break the homeomorphism constraint. By using piecewise-constant delays, the derivative of the function becomes discontinuous at specific time points. This "jump" allows trajectories to cross or fold, enabling the model to learn complex topological transformations that are impossible for standard NODEs.

Figure 6: Visualization of the transformation of concentric rings over time. NPCDDE variants successfully separate the classes by breaking the homeomorphism constraint, unlike the standard NODE.

Furthermore, the computational cost of NPCDDEs is roughly $O(K)$ (where $K$ is the depth), a significant improvement over the $O(nK)$ cost of standard NDDEs. This efficiency makes delay-based modeling practical for high-dimensional deep learning tasks.

Conclusion and Future Work

NPCDDEs represent a more flexible, "superset" architecture that encompasses ResNets and NODEs while providing the modeling power of delay equations. While powerful, future work is needed to automate hyperparameter tuning for delays and skip connections, and to further analyze the formal stability of these piecewise-constant systems. Nonetheless, NPCDDEs offer a robust framework for capturing memory effects in continuous-depth neural networks without the traditional computational penalties.

Summary updated

BibTeX
@inproceedings{zhu2022neural,
  author = {Qunxi Zhu and Yifei Shen and Dongsheng Li and Wei Lin},
  title = {{Neural Piecewise-Constant Delay Differential Equations}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2022},
  doi = {10.1609/aaai.v36i8.20911},
}
Figure