Progress measures for grokking via mechanistic interpretability

Neel Nanda, Lawrence Chan, Tom Lieberum, Jess Smith, Jacob Steinhardt
1/12/2023
cs.LGcs.AI

No official code found. Best implementation: mechanistic-interpretability-grokking/progress-measures-paper (91 stars, last commit 2022-10-11). 1 more below.

Abstract

Neural networks often exhibit emergent behavior, where qualitatively new capabilities arise from scaling up the amount of parameters, training data, or training steps. One approach to understanding emergence is to find continuous \textit{progress measures} that underlie the seemingly discontinuous qualitative changes. We argue that progress measures can be found via mechanistic interpretability: reverse-engineering learned behaviors into their individual components. As a case study, we investigate the recently-discovered phenomenon of ``grokking'' exhibited by small transformers trained on modular addition tasks. We fully reverse engineer the algorithm learned by these networks, which uses discrete Fourier transforms and trigonometric identities to convert addition to rotation about a circle. We confirm the algorithm by analyzing the activations and weights and by performing ablations in Fourier space. Based on this understanding, we define progress measures that allow us to study the dynamics of training and split training into three continuous phases: memorization, circuit formation, and cleanup. Our results show that grokking, rather than being a sudden shift, arises from the gradual amplification of structured mechanisms encoded in the weights, followed by the later removal of memorizing components.

View on arXivView PDF

Code Implementations(2)

9127Python, Jupyter NotebookSep 27, 20224 years ago

Reproduction and extension of Nanda et al. (2023) "Progress measures for grokking via mechanistic interpretability" (ICLR 2023, Oral).

00Python6 months ago

Similar Papers

Cite this paper

@article{nanda2023progress,
  title  = {Progress measures for grokking via mechanistic interpretability},
  author = {Neel Nanda and Lawrence Chan and Tom Lieberum and Jess Smith and Jacob Steinhardt},
  year   = {2023},
  eprint = {2301.05217},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2301.05217v3},
  journal = {ICLR 2023 2023}
}

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

Discussion