Gradient Flossing: Improving Gradient Descent through Dynamic Control of Jacobians

训练递归神经网络(RNNs)仍然是一个挑战,因为在长时间范围内梯度的不稳定性可能导致梯度爆炸和消失。最近的研究将这些问题与前向动力学的李亚普诺夫指数的值联系起来,这些指数描述了微小扰动的增长或收缩。在这里,我们提出了梯度漂移(gradient flossing)的新方法,通过在学习过程中将前向动力学的李亚普诺夫指数推向零来解决梯度不稳定性。我们通过可微分线性代数通过反向传播来正则化李亚普诺夫指数,从而实现了"漂洗"梯度,稳定了它们,从而提高了网络训练的效果。我们证明了梯度漂移不仅控制梯度范数,还控制长期雅可比矩阵的条件数,从而促进多维误差反馈传播。我们发现,在训练之前应用梯度漂移可以提高长时间范围任务的成功率和收敛速度。对于具有挑战性的任务,我们展示了在训练期间应用梯度漂移可以进一步增加通过时间反向传播所能跨越的时间范围。此外,我们证明了我们的方法对于各种RNN架构和不同时间复杂度的任务的有效性。此外,我们提供了一个简单的梯度漂移算法的实现,可以在实践中使用。我们的结果表明,通过正则化李亚普诺夫指数的梯度漂移可以显著增强RNN训练的有效性,缓解梯度爆炸和消失问题。
Training recurrent neural networks (RNNs) remains a challenge due to the instability of gradients across long time horizons, which can lead to exploding and vanishing gradients. Recent research has linked these problems to the values of Lyapunov exponents for the forward-dynamics, which describe the growth or shrinkage of infinitesimal perturbations. Here, we propose gradient flossing, a novel approach to tackling gradient instability by pushing Lyapunov exponents of the forward dynamics toward zero during learning. We achieve this by regularizing Lyapunov exponents through backpropagation using differentiable linear algebra. This enables us to "floss" the gradients, stabilizing them and thus improving network training. We demonstrate that gradient flossing controls not only the gradient norm but also the condition number of the long-term Jacobian, facilitating multidimensional error feedback propagation. We find that applying gradient flossing prior to training enhances both the success rate and convergence speed for tasks involving long time horizons. For challenging tasks, we show that gradient flossing during training can further increase the time horizon that can be bridged by backpropagation through time. Moreover, we demonstrate the effectiveness of our approach on various RNN architectures and tasks of variable temporal complexity. Additionally, we provide a simple implementation of our gradient flossing algorithm that can be used in practice. Our results indicate that gradient flossing via regularizing Lyapunov exponents can significantly enhance the effectiveness of RNN training and mitigate the exploding and vanishing gradient problem.
许愿