Clustering Head: A Visual Case Study of the Training Dynamics in Transformers

Ambroise Odonnat, Wassim Bouaziz, Vivien Cabannes
10/31/2024
cs.LGstat.ML

No confident code implementation found for this paper.

Abstract

This paper introduces the sparse modular addition task and examines how transformers learn it. We focus on transformers with embeddings in $\R^2$ and introduce a visual sandbox that provides comprehensive visualizations of each layer throughout the training process. We reveal a type of circuit, called "clustering heads," which learns the problem's invariants. We analyze the training dynamics of these circuits, highlighting two-stage learning, loss spikes due to high curvature or normalization layers, and the effects of initialization and curriculum learning.

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. Any repos shown below are weak matches — 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{odonnat2024clustering,
  title  = {Clustering Head: A Visual Case Study of the Training Dynamics in Transformers},
  author = {Ambroise Odonnat and Wassim Bouaziz and Vivien Cabannes},
  year   = {2024},
  eprint = {2410.24050},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2410.24050v2}
}

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

Discussion