mlsanityData to 14 Oct 2026

Reversed Attention: On The Gradient Descent Of Attention Layers In GPT

arXiv 2412.17019 ↗First posted 22 Dec 2024cs.CLcited by 2

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

  1. 2017Attention Is All You Needcited by 60,361
  2. 2020Language Models are Few-Shot Learnerscited by 32,419
  3. 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,305
  4. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
  5. 2020Measuring Massive Multitask Language Understandingcited by 7,963
  6. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
  7. 2019HellaSwag: Can a Machine Really Finish Your Sentence?cited by 4,100
  8. 2022OPT: Open Pre-trained Transformer Language Modelscited by 3,512
  9. 2022Locating and Editing Factual Associations in GPTcited by 2,691
  10. 2013Deep Inside Convolutional Networks: Visualising Image Classification Models and Saliency Mapscited by 2,371
  11. 2019HuggingFace's Transformers: State-of-the-art Natural Language Processingcited by 2,218
  12. 2023Efficient Streaming Language Models with Attention Sinkscited by 2,186
18 more
  1. 2020Don't Stop Pretraining: Adapt Language Models to Domains and Taskscited by 1,565
  2. 2022Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 smallcited by 1,165
  3. 2019Attention is not Explanationcited by 929
  4. 2022A Survey on In-context Learningcited by 721
  5. 2022Transformer Feed-Forward Layers Build Predictions by Promoting Concepts in the Vocabulary Spacecited by 532
  6. 2017Word Translation Without Parallel Datacited by 487
  7. 2019Is Attention Interpretable?cited by 389
  8. 2023Towards Best Practices of Activation Patching in Language Models: Metrics and Methodscited by 359
  9. 2022Why Can GPT Learn In-Context? Language Models Implicitly Perform Gradient Descent as Meta-Optimizerscited by 204
  10. 2023One Step of Gradient Descent is Provably the Optimal In-Context Learner with One Layer of Linear Self-Attentioncited by 170
  11. 2024Fine-Tuning Enhances Existing Mechanisms: A Case Study on Entity Trackingcited by 149
  12. 2023Scan and Snap: Understanding Training Dynamics and Token Composition in 1-layer Transformercited by 102
  13. 2023Neurons in Large Language Models: Dead, N-gram, Positionalcited by 88
  14. 2023Knowledge is a Region in Weight Space for Fine-tuned Language Modelscited by 58
  15. 2022Grad-SAM: Explaining Transformers via Gradient Self-Attention Mapscited by 42
  16. 2023VISIT: Visualizing and Interpreting the Semantic Information Flow of Transformerscited by 32
  17. 2024Backward Lens: Projecting Language Model Gradients into the Vocabulary Spacecited by 32
  18. 2017Distinguishing Antonyms and Synonyms in a Pattern-based Neural Networkcited by 19

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 2.

2 papers.