揭示残差网络与Transformer的守恒定律,解释其训练稳定性原理
Transformative or Conservative? Conservation laws for ResNets and Transformers
- 从基础模块出发,推导出残差块和注意力层的守恒规律
- 发现残差连接不改变原有守恒性质,且守恒律可局部独立分析
- 验证连续梯度流中的守恒律在随机梯度下降中仍有效
尽管对浅层ReLU和线性网络的梯度流训练动态中的守恒定律已有充分理解,但对更实际的现代架构研究仍不足。本文填补这一空白,系统推导并分析卷积ResNet和Transformer网络的守恒定律。首先证明,包含ReLU或线性层的浅层网络(无论是否含卷积)具有明确的守恒律,且仅限已知形式。对于单个注意力层,完整刻画了所有守恒律;并证明残差块的守恒律与其无跳跃连接版本相同。进而提出仅依赖部分参数(如连续两层、残差块或注意力层)的守恒律概念,表明此类守恒律的特征可归约为对应模块的孤立分析。最后,考察这些新发现的守恒原理在连续梯度流中的建立如何延续至离散优化动态,特别是在随机梯度下降(SGD)下的表现。
原文摘要 · Abstract (English)
While conservation laws in gradient flow training dynamics are well understood for (mostly shallow) ReLU and linear networks, their study remains largely unexplored for more practical architectures. This paper bridges this gap by deriving and analyzing conservation laws for modern architectures, with a focus on convolutional ResNets and Transformer networks. For this, we first show that basic building blocks such as ReLU (or linear) shallow networks, with or without convolution, have easily expressed conservation laws, and no more than the known ones. In the case of a single attention layer, we also completely describe all conservation laws, and we show that residual blocks have the same conservation laws as the same block without a skip connection. We then introduce the notion of conservation laws that depend only on a subset of parameters (corresponding e.g. to a pair of consecutive layers, to a residual block, or to an attention layer). We demonstrate that the characterization of such laws can be reduced to the analysis of the corresponding building block in isolation. Finally, we examine how these newly discovered conservation principles, initially established in the continuous gradient flow regime, persist under discrete optimization dynamics, particularly in the context of Stochastic Gradient Descent (SGD).
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。