# 神经常微分方程

神经常微分方程（neural ODE，有时缩写为NODE）是一种深度神经网络模型，其中隐藏状态的导数由神经网络参数化，网络的输出则通过黑箱常微分方程求解器对所得微分方程进行数值求解来计算。该模型不指定离散的隐藏层序列，而是定义连续深度的动力学，因此评估意味着从初始状态到最终时刻求解一个初值问题。<sup>[1](https://arxiv.org/abs/1806.07366)</sup>

| 关键事实 | 详情 |
|---|---|
| 提出者 | Ricky T. Q. Chen、Yulia Rubanova、Jesse Bettencourt 和 David Duvenaud，于2018年6月19日首次发布到arXiv（NeurIPS 2018）<sup>[1](https://arxiv.org/abs/1806.07366)</sup> |
| 定义方程 | 隐藏状态按 \( \frac{dz(t)}{dt} = f(z(t), t) \) 演化，其中 \( f \) 是一个神经网络；输出为常微分方程求解器从 \( z(t_0) = x \) 出发得到的 \( z(t_1) \)<sup>[2](https://proceedings.neurips.cc/paper_files/paper/2020/file/a9e18cb5dd9d3ab420946fa19ebbbf52-Paper.pdf)</sup> |
| 所述特性 | 恒定内存开销、输入自适应的评估策略，以及显式地用数值精度换取速度<sup>[1](https://arxiv.org/abs/1806.07366)</sup> |
| 反向传播 | 伴随敏感度方法在时间上反向求解常微分方程，以O(1)内存计算梯度，且无需访问求解器的内部操作<sup>[1](https://arxiv.org/abs/1806.07366)</sup><sup> • </sup><sup>[3](https://github.com/rtqichen/torchdiffeq)</sup> |
| 主要应用 | 用于生成建模的连续归一化流，以及用于不规则采样时间序列的连续时间潜变量模型<sup>[1](https://arxiv.org/abs/1806.07366)</sup><sup> • </sup><sup>[4](https://arxiv.org/abs/1907.03907)</sup> |
| 主要局限 | 求解器开销：步长与精度之间的权衡可能迫使步长非常小，且训练动力学可能变得刚性<sup>[5](https://doi.org/10.1016/j.dte.2025.100060)</sup><sup> • </sup><sup>[2](https://proceedings.neurips.cc/paper_files/paper/2020/file/a9e18cb5dd9d3ab420946fa19ebbbf52-Paper.pdf)</sup> |
| 参考软件 | torchdiffeq提供可微的常微分方程求解器，完全支持GPU，并具备O(1)内存的反向传播<sup>[3](https://github.com/rtqichen/torchdiffeq)</sup> |

## 与残差网络的关系

该模型作为残差网络的连续极限出现。一个残差层计算 \( z_{t+1} = z_t + f_t(z_t) \)，这可改写为 \( (z_{t+\delta t} - z_t)/\delta t = f_t(z_t) \)，其中 \( \delta t = 1 \)，即导数的有限差分近似。神经常微分方程在 \( \delta t \to 0 \) 的极限下分析此方程，得到 \( \frac{dz(t)}{dt} = f(z(t), t) \)；表示由现成的常微分方程求解器从 \( z(t_0) = x \) 演化到 \( z(t_1) = y \)，其中 \( f \) 由神经网络参数化。<sup>[2](https://proceedings.neurips.cc/paper_files/paper/2020/file/a9e18cb5dd9d3ab420946fa19ebbbf52-Paper.pdf)</sup> 这种连续深度的视角意味着求解器步数——因而有效深度——是在评估时选择的，而非由架构固定。<sup>[5](https://doi.org/10.1016/j.dte.2025.100060)</sup>

## 训练与梯度

存在两族梯度计算方法，分别称为先离散后优化和先优化后离散。<sup>[6](https://link.springer.com/article/10.1007/s10462-024-10894-0)</sup> 直接通过求解器反向传播将其视为动态计算图；这快速且准确，但会存储中间激活值，其内存随时间步数增长。<sup>[7](https://torchode.readthedocs.io/en/latest/backprop/)</sup> 伴随方法则将求解器视为黑箱，在时间上反向求解第二个常微分方程，沿途跟踪梯度；其随问题规模线性扩展，并使用恒定内存。<sup>[3](https://github.com/rtqichen/torchdiffeq)</sup><sup> • </sup><sup>[8](https://onlinelibrary.wiley.com/doi/10.1002/nme.7428)</sup>

伴随方法有其自身的数值误差，因为反向时间轨迹可能与正向解不匹配。<sup>[9](https://arxiv.org/abs/2006.02493)</sup> 后续方法对此加以解决：自适应检查点伴随方法将检查点技术与伴随求解相结合以获得更准确的梯度，而辛伴随方法获得在舍入误差范围内精确的梯度，其内存与求解器使用次数加上网络规模成正比。<sup>[9](https://arxiv.org/abs/2006.02493)</sup><sup> • </sup><sup>[10](https://openreview.net/pdf?id=46J_l-cpc1W)</sup>

## 应用

**生成建模。** 原始论文构建了连续归一化流，这是一种通过最大似然训练的生成模型，无需对数据维度进行划分或排序。<sup>[1](https://arxiv.org/abs/1806.07366)</sup> 这一路线已扩展到随机情形：随机连续归一化流将随机微分方程的底层[布朗运动](https://www.edgepedia.org/zh/brownian-motion)视为潜变量，因此可以使用现有技术将随机微分方程作为随机常微分方程来训练。<sup>[11](https://proceedings.mlr.press/v161/hodgkinson21a.html)</sup>

**不规则采样时间序列。** 非均匀间隔的[时间序列](https://www.edgepedia.org/zh/time-series)对标准循环神经网络来说难以处理。ODE-RNN将RNN推广为具有由常微分方程定义的连续时间隐藏动力学的模型，而Latent ODE在变分框架中使用它们；两者都能处理观测之间的任意时间间隔，可以用泊松过程对观测时间建模，并在不规则采样数据上优于基于RNN的对应方法。<sup>[4](https://arxiv.org/abs/1907.03907)</sup> 对于信息必须连续进入的序列输入，神经受控微分方程通过对连续控制路径积分来扩展该框架。<sup>[5](https://doi.org/10.1016/j.dte.2025.100060)</sup>

**科学与临床建模。** 在系统生物学中，当动力学没有已知的候选函数形式时，神经常微分方程估计系统的变化率，并已应用于转录组预测，尽管与传统常微分方程模型相比，它们提供的生物学可解释性有限。<sup>[12](https://www.frontiersin.org/journals/systems-biology/articles/10.3389/fsysb.2024.1407994/full)</sup> 在临床药理学中，潜在神经常微分方程对患者随时间变化的测量值建模，即使给药不规则或已停止，也能预测个体患者的药代动力学轨迹，并且通过纳入病毒载量和药物浓度等专家变量，已为COVID-19疾病进展构建了融入药理学知识的变体。<sup>[13](https://pmc.ncbi.nlm.nih.gov/articles/PMC11330178/)</sup>

## 局限

若干局限在综述和研究中反复出现。无法对收敛性或满足约束做出保证，求解器也不强制执行最终边界条件。<sup>[5](https://doi.org/10.1016/j.dte.2025.100060)</sup> 积分开销是核心：步长与精度之间的权衡可能驱使应用采用非常小的步长，需要手动调参，而在训练期间，学到的动力学可能变成刚性常微分方程，在这种情况下自适应求解器的函数评估次数会变得大到难以承受。<sup>[5](https://doi.org/10.1016/j.dte.2025.100060)</sup><sup> • </sup><sup>[2](https://proceedings.neurips.cc/paper_files/paper/2020/file/a9e18cb5dd9d3ab420946fa19ebbbf52-Paper.pdf)</sup> 较长的序列可能无法收敛，因为误差从起始状态累积，尤其是在仅有终端损失函数的情况下；推荐的补救措施是将训练分解为较小的时间窗口。<sup>[5](https://doi.org/10.1016/j.dte.2025.100060)</sup> 在临床药理学等小数据场景中，过拟合是经常遇到的问题，预训练和数据增强被提议作为对策。<sup>[13](https://pmc.ncbi.nlm.nih.gov/articles/PMC11330178/)</sup>

一个结构性局限是表达能力：神经常微分方程学习保持输入空间拓扑的表示，并且已证明存在它们无法表示的函数。增强神经常微分方程通过向状态添加额外维度，具有更强的表达能力和经验上更好的稳定性，泛化更好，评估成本更低。<sup>[14](https://papers.neurips.cc/paper_files/paper/2019/hash/21be9a4bd4f81549a9d1d241981cec3c-Abstract.html)</sup>

## 降低求解器开销

由于求解器开销是主要瓶颈，许多后续工作都以此为目标。向更简单动力学正则化是共同主题。基于最优传输和稳定性理论的雅可比正则化和动能正则化，鼓励模型在所有能很好解决问题的动力学中偏好更简单的动力学，从而减少求解器离散化次数，并显著降低实际耗时而不损失性能。<sup>[15](https://proceedings.mlr.press/v119/finlay20a.html)</sup> 一种补充技术在训练期间随机扰动积分上限 \( t_1 \) 至 \( t_1 \pm \delta \)；经验上，这在连续归一化流、不规则时间序列和图像识别中都以显著更低的计算成本达到与未正则化模型相当的性能。<sup>[2](https://proceedings.neurips.cc/paper_files/paper/2020/file/a9e18cb5dd9d3ab420946fa19ebbbf52-Paper.pdf)</sup>

另一种替代方案完全避开求解器：神经流直接用神经网络对常微分方程的解曲线建模，消除昂贵的数值积分，同时保持神经常微分方程的建模能力，应用于时间序列建模、预测和密度估计。<sup>[16](https://arxiv.org/abs/2110.13040)</sup>

## References

1. [Ricky T. Q. Chen, Yulia Rubanova, Jesse Bettencourt, David Duvenaud (2018). Neural Ordinary Differential Equations. arXiv:1806.07366.](https://arxiv.org/abs/1806.07366)
2. [Ghosh et al. (2020). Steady State Neural ODE / A Neural ODE regularization paper, NeurIPS 2020.](https://proceedings.neurips.cc/paper_files/paper/2020/file/a9e18cb5dd9d3ab420946fa19ebbbf52-Paper.pdf)
3. [rtqichen/torchdiffeq: Differentiable ODE solvers with full GPU support and O(1)-memory backpropagation. GitHub.](https://github.com/rtqichen/torchdiffeq)
4. [Yulia Rubanova, Ricky T. Q. Chen, David Duvenaud (2019). Latent ODEs for Irregularly-Sampled Time Series. arXiv:1907.03907.](https://arxiv.org/abs/1907.03907)
5. [A guide to neural ordinary differential equations: Machine learning for data-driven digital engineering. ScienceDirect, Data-Centric Engineering journal (2025).](https://doi.org/10.1016/j.dte.2025.100060)
6. [On the applications of neural ordinary differential equations in medical image analysis. Artificial Intelligence Review (2024).](https://link.springer.com/article/10.1007/s10462-024-10894-0)
7. [Gradients & Backpropagation, torchode documentation.](https://torchode.readthedocs.io/en/latest/backprop/)
8. [Ma et al. (2024). TO-NODE: Topology optimization with neural ordinary differential equation. International Journal for Numerical Methods in Engineering.](https://onlinelibrary.wiley.com/doi/10.1002/nme.7428)
9. [Zhu et al. (2020). Adaptive Checkpoint Adjoint Method for Gradient Estimation in Neural ODE. arXiv:2006.02493.](https://arxiv.org/abs/2006.02493)
10. [Symplectic Adjoint Method for Exact Gradient of Neural ODE with Minimal Memory. OpenReview.](https://openreview.net/pdf?id=46J_l-cpc1W)
11. [Hodgkinson, van der Heide, Roosta, Mahoney (2021). Stochastic continuous normalizing flows: training SDEs as ODEs. UAI 2021, PMLR 161:1130-1140.](https://proceedings.mlr.press/v161/hodgkinson21a.html)
12. [The rise of scientific machine learning: a perspective on combining mechanistic modelling with machine learning for systems biology. Frontiers in Systems Biology (2024).](https://www.frontiersin.org/journals/systems-biology/articles/10.3389/fsysb.2024.1407994/full)
13. [Bridging pharmacology and neural networks: A deep dive into neural ordinary differential equations. CPT: Pharmacometrics & Systems Pharmacology (2024).](https://pmc.ncbi.nlm.nih.gov/articles/PMC11330178/)
14. [Emilien Dupont, Arnaud Doucet, Yee Whye Teh (2019). Augmented Neural ODEs. NeurIPS 2019.](https://papers.neurips.cc/paper_files/paper/2019/hash/21be9a4bd4f81549a9d1d241981cec3c-Abstract.html)
15. [Chris Finlay, Joern-Henrik Jacobsen, Levon Nurbekyan, Adam Oberman (2020). How to Train Your Neural ODE: the World of Jacobian and Kinetic Regularization. ICML 2020, PMLR 119:3154-3164.](https://proceedings.mlr.press/v119/finlay20a.html)
16. [Marin Biloš, Johanna Sommer, Syama Sundar Rangapuram, Tim Januschowski, Stephan Günnemann (2021). Neural Flows: Efficient Alternative to Neural ODEs. arXiv:2110.13040.](https://arxiv.org/abs/2110.13040)

---
*Initially written Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Machine learning and neural computation › Neural networks and deep learning › Titles I to Z

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/neural-ordinary-differential-equation

English original: https://www.edgepedia.org/neural-ordinary-differential-equation
