English

Learning Large-Scale Modular Addition with an Auxiliary Modulus

Machine Learning 2026-05-11 v1

Abstract

Learning parity functions, more general modular addition, is a challenging machine learning task due to its input sensitivity. A recent study substantially scaled modular addition learning in both the number of summands and the modulus. Its key idea is to increase zeros in training sequences, reducing the effective number of summands and thus controlling training difficulty; however, this induces covariate shift between training and test input distributions. This study theoretically and empirically analyzes this side effect and proposes a covariate-shift-free method for modular addition. Specifically, we introduce an auxiliary modulus KqKq during training, which reduces wrap-around frequency and problem difficulty while preserving the same input distribution across training and testing. Experiments show strong scalability and sample efficiency: even for large input length NN, large modulus qq, and small datasets -- where the sparse method fails to learn -- our method achieves equal or better match accuracy and relaxed τ\tau-accuracy. For example, at N=64N=64 and q=974269q=974269, our method trained on 100K samples achieves 97.0%97.0\% τ\tau-accuracy at τ=0.05\tau=0.05, while the sparse method achieves only 9.5%9.5\% with the same data size and 93.9%93.9\% even when extended to 1M samples.

Keywords

Cite

@article{arxiv.2605.07648,
  title  = {Learning Large-Scale Modular Addition with an Auxiliary Modulus},
  author = {Hanato Kikuchi and Ryosuke Masuya and Kazuhiko Kawamoto and Hiroshi Kera},
  journal= {arXiv preprint arXiv:2605.07648},
  year   = {2026}
}

Comments

10+11 pages, 5 figures

R2 v1 2026-07-01T12:57:37.225Z