Sparse Autoencoders Reveal Temporal Difference Learning in Large Language Models
Not on the map. Why?
Abstract (arXiv)
In-context learning, the ability to adapt based on a few examples in the input prompt, is a ubiquitous feature of large language models (LLMs). However, as LLMs' in-context learning abilities continue to improve, understanding this phenomenon mechanistically becomes increasingly important. In particular, it is not well-understood how LLMs learn to solve specific classes of problems, such as reinforcement learning (RL) problems, in-context. Through three different tasks, we first show that Llama 3 70B can solve simple RL problems in-context. We then analyze the residual stream of Llama using Sparse Autoencoders (SAEs) and find representations that closely match temporal difference (TD) errors. Notably, these representations emerge despite the model only being trained to predict the next token. We verify that these representations are indeed causally involved in the computation of TD errors and Q-values by performing carefully designed interventions on them. Taken together, our work establishes a methodology for studying and manipulating in-context learning with SAEs, paving the way for a more mechanistic understanding.
Key facts. Cited by 15 papers in the map (data through 7 Oct 2026). Builds on 34 of its 73 references that are in the map. First posted on arXiv 2 Oct 2024.
Builds on
34 of 73 references.
References · 34
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2024The Llama 3 Herd of Modelscited by 14,192
- 2020Scaling Laws for Neural Language Modelscited by 6,411
- 2018Soft Actor-Critic: Off-Policy Maximum Entropy Deep Reinforcement Learning with a Stochastic Actorcited by 4,635
- 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,064
- 2022Emergent Abilities of Large Language Modelscited by 2,483
- 2024Gemma 2: Improving Open Language Models at a Practical Sizecited by 1,928
- 2019Similarity of Neural Network Representations Revisitedcited by 1,695
- 2023Sparse Autoencoders Find Highly Interpretable Features in Language Modelscited by 1,359
- 2022Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 smallcited by 1,130
- 2018Exploration by Random Network Distillationcited by 966
- 2022In-context Learning and Induction Headscited by 930
22 more
- 2022Toy Models of Superpositioncited by 928
- 2022Transformers learn in-context by gradient descentcited by 714
- 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 700
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 671
- 2024Scaling and evaluating sparse autoencoderscited by 530
- 2022Using cognitive psychology to understand GPT-3cited by 389
- 2024Gemma Scope: Open Sparse Autoencoders Everywhere All At Once on Gemma 2cited by 381
- 2022CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learningcited by 342
- 2016Successor Features for Transfer in Reinforcement Learningcited by 331
- 2023Finding Neurons in a Haystack: Case Studies with Sparse Probingcited by 328
- 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 274
- 2022Why Can GPT Learn In-Context? Language Models Implicitly Perform Gradient Descent as Meta-Optimizerscited by 204
- 2023How does GPT-2 compute greater-than?: Interpreting mathematical abilities in a pre-trained language modelcited by 199
- 2024How to use and interpret activation patchingcited by 191
- 2022In-context Reinforcement Learning with Algorithm Distillationcited by 186
- 2024In-Context Language Learning: Architectures and Algorithmscited by 86
- 2017Eigenoption Discovery through the Deep Successor Representationcited by 85
- 2016Deep Successor Reinforcement Learningcited by 72
- 2023Meta-in-context learning in large language modelscited by 59
- 2024In-context learning agents are asymmetric belief updaterscited by 13
- 2023Reinforcement Learning with Simple Sequence Priorscited by 11
- 2024Large Language Models are Biased Reinforcement Learnerscited by 5
Built on by
Citing papers per year: 2024: 1; 2025: 9; 2026: 5.
15 papers.
Sort:
By area:
- 2025From Flat to Hierarchical: Extracting Sparse Representations with Matching Pursuitcited by 45
- 2025Belief Dynamics Reveal the Dual Nature of In-Context Learning and Activation Steeringcited by 24
- 2025How does Chain of Thought Think? Mechanistic Interpretability of Chain-of-Thought Reasoning with Sparse Autoencodingcited by 19
- 2025A Snapshot of Influence: A Local Data Attribution Framework for Online Reinforcement Learningcited by 11
- 2026KernelBlaster: Continual Cross-Task CUDA Optimization via Memory-Augmented In-Context Reinforcement Learningcited by 10
- 2025Do Sparse Autoencoders Generalize? A Case Study of Answerabilitycited by 8
- 2025Large Language Models Think Too Fast To Explore Effectivelycited by 7
- 2025Position: We Need An Algorithmic Understanding of Generative AIcited by 5
- 2025Addressing Longstanding Challenges in Cognitive Science with Language Modelscited by 3
- 2026Towards Interpretable Hallucination Analysis and Mitigation in LVLMs via Contrastive Neuron Steeringcited by 2
- 2026Hierarchical Experimentalist Agentscited by 2
- 2025A circuit for predicting hierarchical structure in-context in Large Language Modelscited by 1
- 2026Hierarchical Experimentalist Agents28 Jun 2026
- 2026Steered Generation via Gradient-Based Optimization on Sparse Query Features21 May 2026
- 2026Generalizing Linear Autoencoder Recommenders with Decoupled Expected Quadratic Loss8 Mar 2026
- 2026KernelBlaster: Continual Cross-Task CUDA Optimization via Memory-Augmented In-Context Reinforcement Learning15 Feb 2026
- 2026Towards Interpretable Hallucination Analysis and Mitigation in LVLMs via Contrastive Neuron Steering31 Jan 2026
- 2025Belief Dynamics Reveal the Dual Nature of In-Context Learning and Activation Steering1 Nov 2025
- 2025Addressing Longstanding Challenges in Cognitive Science with Language Models31 Oct 2025
- 2025A circuit for predicting hierarchical structure in-context in Large Language Models25 Sep 2025
- 2025How does Chain of Thought Think? Mechanistic Interpretability of Chain-of-Thought Reasoning with Sparse Autoencoding24 Jul 2025
- 2025Position: We Need An Algorithmic Understanding of Generative AI10 Jul 2025
- 2025From Flat to Hierarchical: Extracting Sparse Representations with Matching Pursuit3 Jun 2025
- 2025A Snapshot of Influence: A Local Data Attribution Framework for Online Reinforcement Learning25 May 2025
3 more
- 2025From Flat to Hierarchical: Extracting Sparse Representations with Matching Pursuitcited by 45
- 2025Belief Dynamics Reveal the Dual Nature of In-Context Learning and Activation Steeringcited by 24
- 2025A Snapshot of Influence: A Local Data Attribution Framework for Online Reinforcement Learningcited by 11
- 2025Do Sparse Autoencoders Generalize? A Case Study of Answerabilitycited by 8
- 2025Position: We Need An Algorithmic Understanding of Generative AIcited by 5
- 2025Addressing Longstanding Challenges in Cognitive Science with Language Modelscited by 3
- 2026Towards Interpretable Hallucination Analysis and Mitigation in LVLMs via Contrastive Neuron Steeringcited by 2
- 2025A circuit for predicting hierarchical structure in-context in Large Language Modelscited by 1
- 2024ResidualDroppath: Enhancing Feature Reuse over Residual Connectionscited by 0
- 2026Generalizing Linear Autoencoder Recommenders with Decoupled Expected Quadratic Losscited by 0
- 2026Steered Generation via Gradient-Based Optimization on Sparse Query Featurescited by 0
- 2026Steered Generation via Gradient-Based Optimization on Sparse Query Features21 May 2026
- 2026Generalizing Linear Autoencoder Recommenders with Decoupled Expected Quadratic Loss8 Mar 2026
- 2026Towards Interpretable Hallucination Analysis and Mitigation in LVLMs via Contrastive Neuron Steering31 Jan 2026
- 2025Belief Dynamics Reveal the Dual Nature of In-Context Learning and Activation Steering1 Nov 2025
- 2025Addressing Longstanding Challenges in Cognitive Science with Language Models31 Oct 2025
- 2025A circuit for predicting hierarchical structure in-context in Large Language Models25 Sep 2025
- 2025Position: We Need An Algorithmic Understanding of Generative AI10 Jul 2025
- 2025From Flat to Hierarchical: Extracting Sparse Representations with Matching Pursuit3 Jun 2025
- 2025A Snapshot of Influence: A Local Data Attribution Framework for Online Reinforcement Learning25 May 2025
- 2025Do Sparse Autoencoders Generalize? A Case Study of Answerability27 Feb 2025
- 2024ResidualDroppath: Enhancing Feature Reuse over Residual Connections14 Nov 2024