Backpropagation's main limitation is its need to store intermediate activations (residuals) during the forward pass, which restricts the depth of trainable networks. This raises a fundamental question: can we avoid storing these activations? We address this by revisiting the structure of gradient computation. Backpropagation computes gradients through a sequence of vector-Jacobian products, an operation that is generally irreversible. The lost information lies in the cokernel of each layer's Jacobian. We define submersive networks -- networks whose layer Jacobians have trivial cokernels -- in which gradients can be reconstructed exactly in a forward sweep without storing activations. For non-submersive layers, we introduce fragmental gradient checkpointing, which records only the minimal subset of residuals necessary to restore the cotangents erased by the Jacobian. Central to our approach is a novel operator, the vector-inverse-Jacobian product (vijp), which inverts gradient flow outside the cokernel. Our mixed-mode algorithm first computes input gradients with a memory-efficient reverse pass, then reconstructs parameter gradients in a forward sweep using the vijp, eliminating the need to store activations. We implement this method in Moonwalk and show that it matches backpropagation's runtime while training networks more than twice as deep under the same memory budget.


翻译:反向传播的主要限制在于,其在前向传播过程中需要存储中间激活值(残差),这限制了可训练网络的深度。由此引发一个根本性问题:我们能否避免存储这些激活值?为此,我们重新审视了梯度计算的结构。反向传播通过一系列向量-雅可比乘积运算计算梯度,而该运算通常是不可逆的。丢失的信息位于每层雅可比矩阵的余核中。我们定义了浸没式网络——即各层雅可比矩阵的余核均为平凡的网络——在此类网络中,无需存储激活值,即可通过一次前向扫描精确重构梯度。对于非浸没式层,我们引入了分段梯度检查点技术,仅记录恢复被雅可比矩阵擦除的余切向量所需的最少残差子集。该方法的核心在于一种新型算子——向量-逆雅可比乘积(vijp),其可在余核外部反转梯度流。我们的混合模式算法首先通过内存高效的反向传播计算输入梯度,随后利用vijp在前向扫描中重构参数梯度,从而消除了存储激活值的需求。我们在Moonwalk中实现了该方法,并证明其在相同内存预算下训练深度超过两倍的网络时,运行时间与反向传播相当。

0
下载
关闭预览

相关内容

梯度的本意是一个向量(矢量),表示某一函数在该点处的方向导数沿着该方向取得最大值,即函数在该点处沿着该方向(此梯度的方向)变化最快,变化率最大(为该梯度的模)。
【ETZH博士论文】深度神经网络的数学理解
专知会员服务
36+阅读 · 2025年4月27日
深度学习算法发展简述,从DNN到Transformer再到ChatGPT
专知会员服务
153+阅读 · 2022年12月22日
专知会员服务
31+阅读 · 2021年7月19日
一文搞懂反向传播
机器学习与推荐算法
18+阅读 · 2020年3月12日
一文读懂线性回归、岭回归和Lasso回归
CSDN
34+阅读 · 2019年10月13日
深入卷积神经网络背后的数学原理
人工智能学家
10+阅读 · 2019年4月26日
从泰勒展开来看梯度下降算法
深度学习每日摘要
13+阅读 · 2019年4月9日
误差反向传播——CNN
统计学习与视觉计算组
31+阅读 · 2018年7月12日
CNN 反向传播算法推导
统计学习与视觉计算组
30+阅读 · 2017年12月29日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
Arxiv
0+阅读 · 3月11日
VIP会员
最新内容
乌克兰战场背后的新武器
专知会员服务
5+阅读 · 6月12日
基于博弈论的陆军人机协同(长文报告)
专知会员服务
11+阅读 · 6月12日
美国陆军航空兵:以愿景引领转型
专知会员服务
6+阅读 · 6月12日
《多域战场上反制小型无人机系统》150页
专知会员服务
17+阅读 · 6月11日
战场人工智能:增强陆地作战能力的发现与要求
相关资讯
一文搞懂反向传播
机器学习与推荐算法
18+阅读 · 2020年3月12日
一文读懂线性回归、岭回归和Lasso回归
CSDN
34+阅读 · 2019年10月13日
深入卷积神经网络背后的数学原理
人工智能学家
10+阅读 · 2019年4月26日
从泰勒展开来看梯度下降算法
深度学习每日摘要
13+阅读 · 2019年4月9日
误差反向传播——CNN
统计学习与视觉计算组
31+阅读 · 2018年7月12日
CNN 反向传播算法推导
统计学习与视觉计算组
30+阅读 · 2017年12月29日
相关基金
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员