Grokking modular arithmetic

Andrey Gromov
1/6/2023
cs.LGcond-mat.dis-nn

No confident code implementation found for this paper. 3 possible matches can be shown below.

Abstract

We present a simple neural network that can learn modular arithmetic tasks and exhibits a sudden jump in generalization known as ``grokking''. Concretely, we present (i) fully-connected two-layer networks that exhibit grokking on various modular arithmetic tasks under vanilla gradient descent with the MSE loss function in the absence of any regularization; (ii) evidence that grokking modular arithmetic corresponds to learning specific feature maps whose structure is determined by the task; (iii) analytic expressions for the weights -- and thus for the feature maps -- that solve a large class of modular arithmetic tasks; and (iv) evidence that these feature maps are also found by vanilla gradient descent as well as AdamW, thereby establishing complete interpretability of the representations learnt by the network.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 3 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{gromov2023grokking,
  title  = {Grokking modular arithmetic},
  author = {Andrey Gromov},
  year   = {2023},
  eprint = {2301.02679},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2301.02679v1}
}

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/2301.02679.svg)](https://codeofpaper.com/paper/2301.02679)

Discussion