# Interpreting Grokked Transformers in Complex Modular Arithmetic

**Authors:** Hiroki Furuta, Gouki Minegishi, Yusuke Iwasawa, Yutaka Matsuo  
**arXiv:** [2402.16726](https://arxiv.org/abs/2402.16726)  
**Date:** 2024-02-26  
**Summary page:** https://www.summarizepaper.com/en/paper/2402.16726v2/

## Key points

- Focus on grokking in classification tasks involving simple algorithmic data
- Study explores interpretability of algorithms within grokked models and mechanisms behind delayed generalization
- Investigates complex modular arithmetic through interpretable reverse engineering
- Introduces novel progress measures like Fourier Frequency Sparsity and Fourier Coefficient Ratio to evaluate internal representations
- Research delves into mechanistic interpretability within neural networks during training and inference processes
- Aims to understand phenomena like double descent by reverse engineering neural networks
- Detailed analysis of a wide range of modular arithmetic operations including addition, subtraction, multiplication, polynomials, and multi-task mixtures

## Summary

, , , , 


In this work, the focus is on grokking in classification tasks involving simple algorithmic data commonly explored in the literature. The study delves into the interpretability of algorithms within grokked models, shedding light on the mechanisms behind delayed generalization. It goes beyond basic modular addition to investigate complex modular arithmetic through interpretable reverse engineering and uncovers intriguing insights into how different mathematical operations are represented internally by Transformer models. To comprehensively evaluate internal representations of grokked models per modular operation, novel progress measures like Fourier Frequency Sparsity and Fourier Coefficient Ratio are introduced. The empirical analysis underscores the importance of holistic evaluation across various combinations. Furthermore, the research delves into mechanistic interpretability within neural networks during training and inference processes. By systematically reverse engineering neural networks, researchers aim to understand phenomena like double descent and identify functional modules or circuits inside these complex systems. Previous studies have revealed algorithmic patterns obtained during tasks such as modular addition or group composition through techniques like Fourier transform of logits or gradient investigation. However, this work provides a detailed analysis of a wide range of modular arithmetic operations including addition, subtraction, multiplication, polynomials, and multi-task mixtures. Unlike previous studies that focused on specific operations or tasks, this research offers a comprehensive exploration of grokking across various mathematical domains within neural networks.
