Reversed Attention: On The Gradient Descent Of Attention Layers In GPT
Not on the map. Why?
Abstract (arXiv)
The success of Transformer-based Language Models (LMs) stems from their attention mechanism. While this mechanism has been extensively studied in explainability research, particularly through the attention values obtained during the forward pass of LMs, the backward pass of attention has been largely overlooked. In this work, we study the mathematics of the backward pass of attention, revealing that it implicitly calculates an attention matrix we refer to as "Reversed Attention". We examine the properties of Reversed Attention and demonstrate its ability to elucidate the models' behavior and edit dynamics. In an experimental setup, we showcase the ability of Reversed Attention to directly alter the forward pass of attention, without modifying the model's weights, using a novel method called "attention patching". In addition to enhancing the comprehension of how LM configure attention layers during backpropagation, Reversed Attention maps contribute to a more interpretable backward pass.
Key facts. Cited by 2 papers in the map (data through 14 Oct 2026). Builds on 30 of its 41 references that are in the map. First posted on arXiv 22 Dec 2024.
Builds on
30 of 41 references.
References · 30
- 2017Attention Is All You Needcited by 60,361
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,305
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
- 2020Measuring Massive Multitask Language Understandingcited by 7,963
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
- 2019HellaSwag: Can a Machine Really Finish Your Sentence?cited by 4,100
- 2022OPT: Open Pre-trained Transformer Language Modelscited by 3,512
- 2022Locating and Editing Factual Associations in GPTcited by 2,691
- 2013Deep Inside Convolutional Networks: Visualising Image Classification Models and Saliency Mapscited by 2,371
- 2019HuggingFace's Transformers: State-of-the-art Natural Language Processingcited by 2,218
- 2023Efficient Streaming Language Models with Attention Sinkscited by 2,186
18 more
- 2020Don't Stop Pretraining: Adapt Language Models to Domains and Taskscited by 1,565
- 2022Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 smallcited by 1,165
- 2019Attention is not Explanationcited by 929
- 2022A Survey on In-context Learningcited by 721
- 2022Transformer Feed-Forward Layers Build Predictions by Promoting Concepts in the Vocabulary Spacecited by 532
- 2017Word Translation Without Parallel Datacited by 487
- 2019Is Attention Interpretable?cited by 389
- 2023Towards Best Practices of Activation Patching in Language Models: Metrics and Methodscited by 359
- 2022Why Can GPT Learn In-Context? Language Models Implicitly Perform Gradient Descent as Meta-Optimizerscited by 204
- 2023One Step of Gradient Descent is Provably the Optimal In-Context Learner with One Layer of Linear Self-Attentioncited by 170
- 2024Fine-Tuning Enhances Existing Mechanisms: A Case Study on Entity Trackingcited by 149
- 2023Scan and Snap: Understanding Training Dynamics and Token Composition in 1-layer Transformercited by 102
- 2023Neurons in Large Language Models: Dead, N-gram, Positionalcited by 88
- 2023Knowledge is a Region in Weight Space for Fine-tuned Language Modelscited by 58
- 2022Grad-SAM: Explaining Transformers via Gradient Self-Attention Mapscited by 42
- 2023VISIT: Visualizing and Interpreting the Semantic Information Flow of Transformerscited by 32
- 2024Backward Lens: Projecting Language Model Gradients into the Vocabulary Spacecited by 32
- 2017Distinguishing Antonyms and Synonyms in a Pattern-based Neural Networkcited by 19
Built on by
Citing papers per year: 2026: 2.
2 papers.