Abrupt Learning in Transformers: A Case Study on Matrix Completion

Pulkit Gopalani, Ekdeep Singh Lubana, Wei Hu
10/29/2024
cs.LGstat.ML

No official code found. Best implementation: pulkitgopalani/tf-matcomp (1 star, last commit 2025-04-17).

Abstract

Recent analysis on the training dynamics of Transformers has unveiled an interesting characteristic: the training loss plateaus for a significant number of training steps, and then suddenly (and sharply) drops to near--optimal values. To understand this phenomenon in depth, we formulate the low-rank matrix completion problem as a masked language modeling (MLM) task, and show that it is possible to train a BERT model to solve this task to low error. Furthermore, the loss curve shows a plateau early in training followed by a sudden drop to near-optimal values, despite no changes in the training procedure or hyper-parameters. To gain interpretability insights into this sudden drop, we examine the model's predictions, attention heads, and hidden states before and after this transition. Concretely, we observe that (a) the model transitions from simply copying the masked input to accurately predicting the masked entries; (b) the attention heads transition to interpretable patterns relevant to the task; and (c) the embeddings and hidden states encode information relevant to the problem. We also analyze the training dynamics of individual model components to understand the sudden drop in loss.

View on arXivView PDF

Code Implementations(1)

Code for "Abrupt Learning in Transformers: A Case Study on Matrix Completion" (NeurIPS 2024)

10PythonOct 30, 20241 years ago
abrupt-learninginterpretabilitytraining-dynamicstransformer

Similar Papers

Cite this paper

@article{gopalani2024abrupt,
  title  = {Abrupt Learning in Transformers: A Case Study on Matrix Completion},
  author = {Pulkit Gopalani and Ekdeep Singh Lubana and Wei Hu},
  year   = {2024},
  eprint = {2410.22244},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2410.22244},
  url    = {http://arxiv.org/abs/2410.22244v1},
  journal = {NEURIPS 2024 2024}
}

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

Discussion