Provable Benefits of Sinusoidal Activation for Modular Addition

Tianlong Huang, Zhiyuan Li
11/28/2025
cs.LGstat.ML

No official code found. Best implementation: 1st-Leo-Huang/sinusoidal-modular-addition (0 stars, MIT, last commit 2025-12-02).

Abstract

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.

View on arXivView PDF

Code Implementations(1)

MIT

Code for "Provable Benefits of Sinusoidal Activation for Modular Addition"

00Shell, PythonOct 13, 202510 months agoMIT

Similar Papers

Cite this paper

@article{huang2025provable,
  title  = {Provable Benefits of Sinusoidal Activation for Modular Addition},
  author = {Tianlong Huang and Zhiyuan Li},
  year   = {2025},
  eprint = {2511.23443},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2511.23443v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2511.23443.svg)](https://codeofpaper.com/paper/2511.23443)

Discussion