正弦激活函数让神经网络能用更小的宽度精确学习模加法,且泛化更好。
Provable Benefits of Sinusoidal Activation for Modular Addition
- 使用正弦激活函数的两层网络,宽度仅需2即可精确表示任意长度的模加法。
- 在相同宽度下,ReLU网络必须随模数线性增长宽度,且无法同时拟合不同余数的模加法。
- 正弦网络在不同规模下泛化能力强,尤其擅长对更长序列的外推预测。
本文研究了两层神经网络中激活函数在学习模加法中的作用。我们首先建立了明确的表达能力差距:正弦型多层感知机(sine MLPs)对于任意固定长度 $m$,均可通过宽度为2的网络实现精确表示;若加入偏置项,还能统一适用于所有长度。相比之下,ReLU网络的宽度必须随 $m$ 线性增长才能插值,并且无法同时拟合不同模 $p$ 余数的两个长度。我们进一步提出了针对正弦网络的新颖的Natarajan维数泛化界,得到几乎最优的样本复杂度 $ ilde{igO}(p)$,适用于常宽正弦网络的经验风险最小化。此外,我们还推导出正弦网络在过参数化情形下的宽度无关、基于边距的泛化界,并进行了验证。实验表明,正弦网络在各类设置下均优于ReLU网络,且表现出强大的长度外推能力。
原文摘要 · Abstract (English)
This paper studies the role of activation functions in learning modular addition with two-layer neural networks. We first establish a sharp expressivity gap: sine MLPs admit width-$2$ exact realizations for any fixed length $m$ and, with bias, width-$2$ exact realizations uniformly over all lengths. In contrast, the width of ReLU networks must scale linearly with $m$ to interpolate, and they cannot simultaneously fit two lengths with different residues modulo $p$. We then provide a novel Natarajan-dimension generalization bound for sine networks, yielding nearly optimal sample complexity $\widetilde{\mathcal{O}}(p)$ for ERM over constant-width sine networks. We also derive width-independent, margin-based generalization for sine networks in the overparametrized regime and validate it. Empirically, sine networks generalize consistently better than ReLU networks across regimes and exhibit strong length extrapolation.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。