arXiv:2605.17659cs.LG2026-05

发现并解决神经网络训练中的权重漂移问题,提升模型效率与稳定性。

Bug or Feature$^2$: Weight Drift, Activation Sparsity and Spikes

论文配图:Bug or Feature$^2$: Weight Drift, Activation Sparsity and Spikes
图 1 · 摘自论文原文
  • 提出负权重漂移机制,解释激活函数与损失函数交互导致的训练异常。
  • 在GPT-nano中实现高达90%的激活稀疏性,但超过70%时准确率急剧下降。
  • 通过裁剪改进平方激活函数,显著提升性能,适合高效Transformer模型设计。

现代神经网络架构的设计基于渐进式经验选择,但其训练动态机制仍不完全清晰。本文揭示并分析了由标准损失函数与正向偏置激活函数相互作用引发的负权重漂移现象。证明在均方误差或交叉熵损失下,正前激活梯度在初始化时期望值非负,导致早期训练中下游权重趋向负值。该漂移源于优化过程本身而非数据,且在多类架构(MLP、ResNet、ViT、GPT-nano、MP-SENe)和非对称激活函数(ReLU、GELU、SiLU)中普遍存在。结合ReLU使用时,权重漂移使GPT-nano中激活稀疏性最高达90%。我们对79种配置进行稀疏性-精度权衡分析,发现当激活稀疏性超过约70%时出现精度陡降。虽然ReLU²在GPT-nano中具有良好的稀疏性-精度比,但会病理性放大中间Transformer层的激活峰值。通过裁剪可缓解此问题,同时保留平方激活的表征优势:裁剪后的ReLU²优于未裁剪版本,而GELU²在GPT-nano上达到最低验证损失。代码已开源。

原文摘要 · Abstract (English)

The design of modern neural architectures has converged through incremental empirical choices, yet the mechanisms governing their training dynamics remain only partially understood. We identify and analyze a negative weight drift induced by the interaction between standard losses and positively biased activation functions. We prove that under MSE or cross-entropy loss, the gradient with respect to positive pre-activations is non-negative in expectation at initialization, driving downstream weights toward negative values during early training. The drift is intrinsic to optimization rather than data, and persists across architectures (MLP, ResNet, ViT, GPT-nano, MP-SENe) and asymmetric activation functions (ReLU, GELU, SiLU). Coupled with ReLU, weight drift produces activation sparsity reaching up to 90\% in GPT-nano. We characterize the sparsity-accuracy tradeoff across 79 configurations and identify a sharp accuracy cliff above $\sim$70\% activation sparsity. While ReLU$^2$ achieves a good sparsity--accuracy ratio in GPT-nano, it pathologically amplifies identified activation spikes in intermediate transformer layers. Clipping resolves this while preserving the representational benefits of squaring: clipped ReLU$^2$ outperforms its unclipped version, and GELU$^2$ achieves the lowest validation loss on GPT-nano. Code is available at https://github.com/On-Point-RND/BugOrFeature.

权重漂移激活稀疏Transformer优化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。