Learning Modular Addition with Auxiliary Modulus
Hanato Kikuchi, Ryosuke Masuya, Kazuhiko Kawamoto, Hiroshi Kera
NeurIPS page · Open on the map
Category: Interpretability & Model Adaptation › Neural Representation and Compression Theory · Type: new method · Keywords: modular addition, covariate shift, auxiliary modulus, sample efficiency, algorithmic learning
Summary
The paper introduces a covariate-shift-free modular addition method that uses an auxiliary modulus Kq to preserve input distribution and achieve scalable learning.
Explained to a 5-year-old
We want computers to learn how to add numbers that wrap around like a clock. The old way made the computer see different kinds of numbers when learning and testing, which made it hard. The new idea is to use a bigger helper number during learning so the computer always sees the same kind of numbers. This helps the computer learn faster and better, even when there are many numbers and only a little data. As a result, the computer can solve big math problems more reliably.
Explained to a 5-year-old, longer
Adding numbers that wrap around is like a clock where after 12 comes 1. Teaching a computer to do this is tricky because the computer needs to see the same kind of numbers when it learns and when it is tested. Some previous methods tried to make learning easier by changing the numbers, but that caused the computer to forget what it learned. The new idea is to introduce a helper number that is a multiple of the original wrap-around size during training. This helper number makes the wrap-around happen less often, so the problem becomes simpler. Because the helper number does not change the kind of numbers the computer sees, the learning and testing stay consistent. This consistency lets the computer learn from fewer examples and still work well on big problems. Even when there are many numbers to add and only a small amount of data, the new method still gets high accuracy. For instance, with 64 numbers and a very large wrap-around size, the computer reaches 97% correct answers using only 100 thousand examples. The old method would only get about 10% correct with the same amount of data. With a million examples, the old method improves but still falls short of the new method’s performance. Overall, the new approach makes learning modular addition more reliable and efficient.
For a technical reader
The paper addresses the difficulty of training models to perform modular addition when the input distribution changes between training and testing. It shows that prior methods, which increase zeros in training sequences, cause a covariate shift that hampers scalability. The proposed solution introduces an auxiliary modulus Kq during training to reduce wrap-around frequency while keeping the input distribution unchanged. This preserves consistency across training and testing, enabling the model to learn efficiently even with large input lengths, large moduli, and limited data. Experiments demonstrate that the new method achieves high τ-accuracy (e.g., 97% with 100K samples) where previous approaches fail.
Problem
Learning modular addition (or parity) functions is challenging because the input distribution shifts between training and testing, making it hard to scale to many summands and large moduli.
Method
During training, an auxiliary modulus Kq is introduced to lower wrap-around frequency, which reduces problem difficulty without altering the input distribution. This ensures that the training and test distributions remain aligned, enabling scalable and sample-efficient learning.
Results
Our method attains 97.0% τ-accuracy at τ=0.05 on a large-scale setting (N=64, q=974269) with only 100K samples, whereas the prior sparse method reaches just 9.5% under the same conditions and 93.9% even with 1M samples.
Contributions
The paper provides a theoretical and empirical analysis of covariate shift in modular addition learning and proposes a distribution-preserving training technique that scales to large problems and works efficiently with limited data.
This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction