ruizheliUOA/Awesome-Interpretability-in-Large-Language-Models

This repository collects all relevant resources about interpretability in LLMs

407

56 commits

updated Nov 1, 2024

See the code

README

Awesome Interpretability in Large Language Models

The area of interpretability in large language models (LLMs) has been growing rapidly in recent years. This repository tries to collect all relevant resources to help beginners quickly get started in this area and help researchers to keep up with the latest research progress.

This is an active repository and welcome to open a new issue if I miss any relevant resources. If you have any questions or suggestions, please feel free to contact me via email: ruizhe.li@abdn.ac.uk.


Table of Contents


Awesome Interpretability Libraries

  • GitHub Repo stars TransformerLens: A Library for Mechanistic Interpretability of Generative Language Models. (Doc, Tutorial, Demo)
  • GitHub Repo stars nnsight: enables interpreting and manipulating the internals of deep learned models. (Doc, Tutorial, Paper)
  • GitHub Repo stars SAE Lens: train and analyse SAE. (Doc, Tutorial, Blog)
  • Github Repo stars EleutherAI: sae: train SAE on very large model based on the method and released code of the openAI SAE paper
  • GitHub Repo stars Automatic Circuit DisCovery: automatically build circuit for mechanistic interpretability. (Paper, Demo)
  • GitHub Repo stars Pyvene: A Library for Understanding and Improving PyTorch Models via Interventions. (Paper, Demo)
  • GitHub Repo stars pyreft: A Powerful, Efficient and Interpretable fine-tuning method. (Paper, Demo)
  • GitHub Repo stars repeng: A Python library for generating control vectors with representation engineering. (Paper, Blog)
  • GitHub Repo stars Penzai: a JAX library for writing models as legible, functional pytree data structures, along with tools for visualizing, modifying, and analyzing them. (Paper, Doc, Tutorial)
  • GitHub Repo stars LXT: LRP eXplains Transformers: Layer-wise Relevance Propagation (LRP) extended to handle attention layers in Large Language Models (LLMs) and Vision Transformers (ViTs). (Paper, Doc)
  • GitHub Repo stars Tuned Lens: Tools for understanding how transformer predictions are built layer-by-layer. (Paper, Doc)
  • GitHub Repo stars Inseq: Pytorch-based toolkit for common post-hoc interpretability analyses of sequence generation models. (Paper, Doc)
  • GitHub Repo stars shap: Python library for computing SHAP feature / token importance for any black box model. Works with hugginface, pytorch, tensorflow models, including LLMs. (Paper, Doc)
  • GitHub Repo stars captum: Model interpretability and understanding library for PyTorch (Paper, Doc)

Awesome Interpretability Blogs & Videos

Awesome Interpretability Tutorials

Awesome Interpretability Forums & Worhshops

Awesome Interpretability Tools

  • GitHub Repo stars Transformer Debugger: investigate specific behaviors of small LLMs
  • GitHub Repo stars LLM Transparency Tool (Demo)
  • GitHub Repo stars sae_vis: a tool to replicate Anthropic's sparse autoencoder visualisations (Demo)
  • Neuronpedia: an open platform for interpretability research. (Doc)
  • GitHub Repo stars Comgra: A tool to analyze and debug neural networks in pytorch. Use a GUI to traverse the computation graph and view the data from many different angles at the click of a button. (Paper)

Awesome Interpretability Programs

  • ML Alignment & Theory Scholars (MATS): an independent research and educational seminar program that connects talented scholars with top mentors in the fields of AI alignment, interpretability, and governance.

Awesome Interpretability Papers

Survey Papers

Position Papers

Interpretable Analysis of LLMs

TitleVenueDateCodeBlog
Interpreting Context Look-ups in Transformers: Investigating Attention-MLP Interactions
EMNLP2024-10-23--
GitHub Repo stars
Towards Interpretable Sequence Continuation: Analyzing Shared Circuits in Large Language Models
EMNLP2024-10-04Github-
GitHub Repo stars
How Alignment and Jailbreak Work: Explain LLM Safety through Intermediate Hidden States
EMNLP2024-10-01Github-
GitHub Repo stars
Information Flow Routes: Automatically Interpreting Language Models at Scale
EMNLP2024-10-01Github-
GitHub Repo stars
MMNeuron: Discovering Neuron-Level Domain-Specific Interpretation in Multimodal Large Language Model
EMNLP2024-10-01Github-
GitHub Repo stars
Interpreting Arithmetic Mechanism in Large Language Models through Comparative Neuron Analysis
EMNLP2024-09-12Github-
Why Are My Prompts Leaked? Unraveling Prompt Extraction Threats in Customized Large Language Models
-2024-08-05Github-
Learning Syntax Without Planting Trees: Understanding When and Why Transformers Generalize Hierarchically
MechInterp@ICML2024-07-15--
GitHub Repo stars
Compact Proofs of Model Performance via Mechanistic Interpretability
MechInterp@ICML2024-07-15Github-
Learning to grok: Emergence of in-context learning and skill composition in modular arithmetic tasks
MechInterp@ICML2024-07-15--
How Do Llamas Process Multilingual Text? A Latent Exploration through Activation Patching
MechInterp@ICML2024-07-15--
Look Before You Leap: A Universal Emergent Decomposition of Retrieval Tasks in Language Models
MechInterp@ICML2024-07-15--
What Makes and Breaks Safety Fine-tuning? Mechanistic Study
MechInterp@ICML2024-07-15--
Using Degeneracy in the Loss Landscape for Mechanistic Interpretability
MechInterp@ICML2024-07-15--
Loss in the Crowd: Hidden Breakthroughs in Language Model Training
MechInterp@ICML2024-07-15--
Robust Knowledge Unlearning via Mechanistic Localizations
MechInterp@ICML2024-07-15--
Language Models Linearly Represent Sentiment
MechInterp@ICML2024-07-15--
GitHub Repo stars
Have Faith in Faithfulness: Going Beyond Circuit Overlap When Finding Model Mechanisms
MechInterp@ICML2024-07-15Github-
Learning and Unlearning of Fabricated Knowledge in Language Models
MechInterp@ICML2024-07-15--
Faithful and Fast Influence Function via Advanced Sampling
MechInterp@ICML2024-07-15--
Hypothesis Testing the Circuit Hypothesis in LLMs
MechInterp@ICML2024-07-15--
GitHub Repo stars
The Geometry of Categorical and Hierarchical Concepts in Large Language Models
MechInterp@ICML2024-07-15Github-
GitHub Repo stars
InversionView: A General-Purpose Method for Reading Information from Neural Activations
MechInterp@ICML2024-07-15Github-
Missed Causes and Ambiguous Effects: Counterfactuals Pose Challenges for Interpreting Neural Networks
MechInterp@ICML2024-07-15--
Functional Faithfulness in the Wild: Circuit Discovery with Differentiable Computation Graph Pruning
arXiv2024-07-04--
GitHub Repo stars
Model Internals-based Answer Attribution for Trustworthy Retrieval-Augmented Generation
arXiv2024-07-01Github-
GitHub Repo stars
Recovering the Pre-Fine-Tuning Weights of Generative Models
ICML2024-07-01GithubBlog
GitHub Repo stars
Token Erasure as a Footprint of Implicit Vocabulary Items in LLMs
arXiv2024-06-28GithubBlog
GitHub Repo stars
Observable Propagation: Uncovering Feature Vectors in Transformers
ICML2024-06-25Github-
GitHub Repo stars
Multi-property Steering of Large Language Models with Dynamic Activation Composition
arXiv2024-06-25Github-
What Do the Circuits Mean? A Knowledge Edit View
arXiv2024-06-25--
Confidence Regulation Neurons in Language Models
arXiv2024-06-24--
GitHub Repo stars
Compact Proofs of Model Performance via Mechanistic Interpretability
arXiv2024-06-24Github-
GitHub Repo stars
Preference Tuning For Toxicity Mitigation Generalizes Across Languages
arXiv2024-06-23Github-
Unlocking the Future: Exploring Look-Ahead Planning Mechanistic Interpretability in Large Language Models
arXiv2024-06-23--
GitHub Repo stars
Estimating Knowledge in Large Language Models Without Generating a Single Token
arXiv2024-06-18Github-
Mechanistic Understanding and Mitigation of Language Model Non-Factual Hallucinations
arXiv2024-06-17--
GitHub Repo stars
Transcoders Find Interpretable LLM Feature Circuits
MechInterp@ICML2024-06-17Github-
GitHub Repo stars
Model Editing Harms General Abilities of Large Language Models: Regularization to the Rescue
arXiv2024-06-16Github-
GitHub Repo stars
Context versus Prior Knowledge in Language Models
ACL2024-06-16Github-
Talking Heads: Understanding Inter-layer Communication in Transformer Language Models
arXiv2024-06-13--
GitHub Repo stars
MambaLRP: Explaining Selective State Space Sequence Models
arXiv2024-06-11Github-
GitHub Repo stars
Patchscopes: A Unifying Framework for Inspecting Hidden Representations of Language Models
ICML2024-06-06GithubBlog
GitHub Repo stars
Competition of Mechanisms: Tracing How Language Models Handle Facts and Counterfactuals
ACL2024-06-06Github-
Learned feature representations are biased by complexity, learning order, position, and more
arXiv2024-06-06Demo-
Iteration Head: A Mechanistic Study of Chain-of-Thought
arXiv2024-06-05--
Activation Addition: Steering Language Models Without Optimization
arXiv2024-06-04Code-
Interpretability Illusions in the Generalization of Simplified Models
arXiv2024-06-04--
GitHub Repo stars
SyntaxShap: Syntax-aware Explainability Method for Text Generation
arXiv2024-06-03GithubBlog
Calibrating Reasoning in Language Models with Internal Consistency
arXiv2024-05-29--
Black-Box Access is Insufficient for Rigorous AI Audits
FAccT2024-05-29--
Dual Process Learning: Controlling Use of In-Context vs. In-Weights Strategies with Weight Forgetting
arXiv2024-05-28--
GitHub Repo stars
From Neurons to Neutrons: A Case Study in Interpretability
ICML2024-05-27Github-
GitHub Repo stars
Grokked Transformers are Implicit Reasoners: A Mechanistic Journey to the Edge of Generalization
MechInterp@ICML2024-05-27Github-
GitHub Repo stars
Explorations of Self-Repair in Language Models
ICML2024-05-26Github-
Emergence of a High-Dimensional Abstraction Phase in Language Transformers
arXiv2024-05-24--
GitHub Repo stars
Anchored Answers: Unravelling Positional Bias in GPT-2's Multiple-Choice Questions
arXiv2024-05-23Github-
GitHub Repo stars
Not All Language Model Features Are Linear
arXiv2024-05-23Github-
Using Degeneracy in the Loss Landscape for Mechanistic Interpretability
arXiv2024-05-20--
GitHub Repo stars
Your Transformer is Secretly Linear
arXiv2024-05-19Github-
GitHub Repo stars
Are self-explanations from Large Language Models faithful?
ACL2024-05-16Github-
Faithfulness vs. Plausibility: On the (Un)Reliability of Explanations from Large Language Models
arXiv2024-05-14--
GitHub Repo stars
Steering Llama 2 via Contrastive Activation Addition
arXiv2024-05-07Github-
GitHub Repo stars
How does GPT-2 Predict Acronyms? Extracting and Understanding a Circuit via Mechanistic Interpretability
AISTATS2024-05-07Github-
GitHub Repo stars
How to think step-by-step: A mechanistic understanding of chain-of-thought reasoning
arXiv2024-05-06Github-
GitHub Repo stars
Circuit Component Reuse Across Tasks in Transformer Language Models
ICLR2024-05-06Github-
GitHub Repo stars
LLMCheckup: Conversational Examination of Large Language Models via Interpretability Tools and Self-Explanations
HCI+NLP@NAACL2024-04-24Github-
How to use and interpret activation patching
arXiv2024-04-23--
Understanding Addition in Transformers
arXiv2024-04-23--
Towards Uncovering How Large Language Model Works: An Explainability Perspective
arXiv2024-04-15--
GitHub Repo stars
What needs to go right for an induction head? A mechanistic study of in-context learning circuits and their formation
ICML2024-04-10Github-
Does Transformer Interpretability Transfer to RNNs?
arXiv2024-04-09--
GitHub Repo stars
Locating and Editing Factual Associations in Mamba
arXiv2024-04-04GithubDemo
Eliciting Latent Knowledge from Quirky Language Models
ME-FoMo@ICLR2024-04-03--
Do language models plan ahead for future tokens?
arXiv2024-04-01--
GitHub Repo stars
Sparse Feature Circuits: Discovering and Editing Interpretable Causal Graphs in Language Models
arXiv2024-03-31GithubDemo
Have Faith in Faithfulness: Going Beyond Circuit Overlap When Finding Model Mechanisms
arXiv2024-03-26--
GitHub Repo stars
What does the Knowledge Neuron Thesis Have to do with Knowledge?
ICLR2024-03-16Github-
GitHub Repo stars
Language Models Represent Space and Time
ICLR2024-03-04Github-
AtP*: An efficient and scalable method for localizing LLM behaviour to components
arXiv2024-03-01--
A Mechanistic Analysis of a Transformer Trained on a Symbolic Multi-Step Reasoning Task
arXiv2024-02-28--
GitHub Repo stars
Function Vectors in Large Language Models
ICLR2024-02-25GithubBlog
A Language Model's Guide Through Latent Space
arXiv2024-02-22--
Interpreting Shared Circuits for Ordered Sequence Prediction in a Large Language Model
arXiv2024-02-22--
GitHub Repo stars
Fine-Tuning Enhances Existing Mechanisms: A Case Study on Entity Tracking
ICLR2024-02-22GithubBlog
GitHub Repo stars
Fine-grained Hallucination Detection and Editing for Language Models
arXiv2024-02-21GithubBlog
GitHub Repo stars
Enhanced Hallucination Detection in Neural Machine Translation through Simple Detector Aggregation
arXiv2024-02-20Github-
Identifying Semantic Induction Heads to Understand In-Context Learning
arXiv2024-02-20--
Backward Lens: Projecting Language Model Gradients into the Vocabulary Space
arXiv2024-02-20--
Show Me How It's Done: The Role of Explanations in Fine-Tuning Language Models
ACML2024-02-12--
GitHub Repo stars
Model Editing with Canonical Examples
arXiv2024-02-09Github-
GitHub Repo stars
Opening the AI black box: program synthesis via mechanistic interpretability
arXiv2024-02-07Github-
INSIDE: LLMs' Internal States Retain the Power of Hallucination Detection
ICLR2024-02-06--
GitHub Repo stars
In-Context Language Learning: Architectures and Algorithms
arXiv2024-01-30Github-
Gradient-Based Language Model Red Teaming
EACL2024-01-30Github-
The Calibration Gap between Model and Human Confidence in Large Language Models
arXiv2024-01-24--
GitHub Repo stars
Universal Neurons in GPT2 Language Models
arXiv2024-01-22Github-
The mechanistic basis of data dependence and abrupt learning in an in-context classification task
ICLR2024-01-16--
GitHub Repo stars
Overthinking the Truth: Understanding how Language Models Process False Demonstrations
ICLR2024-01-16Github-
Mechanistically analyzing the effects of fine-tuning on procedurally defined tasks
ICLR2024-01-16--
Feature emergence via margin maximization: case studies in algebraic tasks
ICLR2024-01-16--
Successor Heads: Recurring, Interpretable Attention Heads In The Wild
ICLR2024-01-16--
Towards Best Practices of Activation Patching in Language Models: Metrics and Methods
ICLR2024-01-16--
GitHub Repo stars
A Mechanistic Understanding of Alignment Algorithms: A Case Study on DPO and Toxicity
ICML2024-01-03Github-
GitHub Repo stars
Forbidden Facts: An Investigation of Competing Objectives in Llama-2
ATTRIB@NeurIPS2023-12-31GithubBlog
GitHub Repo stars
The Geometry of Truth: Emergent Linear Structure in Large Language Model Representations of True/False Datasets
arXiv2023-12-08GithubBlog
GitHub Repo stars
Is This the Subspace You Are Looking for? An Interpretability Illusion for Subspace Activation Patching
ATTRIB@NeurIPS2023-12-06Github-
GitHub Repo stars
Structured World Representations in Maze-Solving Transformers
UniReps@NeurIPS2023-12-05Github-
Generating Interpretable Networks using Hypernetworks
arXiv2023-12-05--
GitHub Repo stars
The Clock and the Pizza: Two Stories in Mechanistic Explanation of Neural Networks
NeurIPS2023-11-21Github-
GitHub Repo stars
Attribution Patching Outperforms Automated Circuit Discovery
ATTRIB@NeurIPS2023-11-20Github-
GitHub Repo stars
Tracr: Compiled Transformers as a Laboratory for Interpretability
NeurIPS2023-11-03Github-
GitHub Repo stars
How does GPT-2 compute greater-than?: Interpreting mathematical abilities in a pre-trained language model
NeurIPS2023-11-02Github-
GitHub Repo stars
Learning Transformer Programs
NeurIPS2023-10-31Github-
GitHub Repo stars
Towards Automated Circuit Discovery for Mechanistic Interpretability
NeurIPS2023-10-28Github-
GitHub Repo stars
Towards a Mechanistic Interpretation of Multi-Step Reasoning Capabilities of Language Models
EMNLP2023-10-23Github-
GitHub Repo stars
Inference-Time Intervention: Eliciting Truthful Answers from a Language Model
NeurIPS2023-10-20Github-
GitHub Repo stars
Progress measures for grokking via mechanistic interpretability
ICLR2023-10-19GithubBlog
GitHub Repo stars
Copy Suppression: Comprehensively Understanding an Attention Head
arXiv2023-10-06GithubBlog & Demo
GitHub Repo stars
Does Localization Inform Editing? Surprising Differences in Causality-Based Localization vs. Knowledge Editing in Language Models
NeurIPS2023-09-21Github-
GitHub Repo stars
Interpretability at Scale: Identifying Causal Mechanisms in Alpaca
NeurIPS2023-09-21Github-
GitHub Repo stars
Emergent Linear Representations in World Models of Self-Supervised Sequence Models
BlackboxNLP@EMNLP2023-09-07GithubBlog
GitHub Repo stars
Finding Neurons in a Haystack: Case Studies with Sparse Probing
arXiv2023-06-02Github-
GitHub Repo stars
Efficient Shapley Values Estimation by Amortization for Text Classification
ACL2023-05-31GithubVideo
GitHub Repo stars
A Toy Model of Universality: Reverse Engineering How Networks Learn Group Operations
ICML2023-05-24Github-
Localizing Model Behavior with Path Patching
arXiv2023-05-16--
Language models can explain neurons in language models
OpenAI2023-05-09--
N2G: A Scalable Approach for Quantifying Interpretable Neuron Representations in Large Language Models
ICLR Workshop2023-04-22--
GitHub Repo stars
Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 small
ICLR2023-01-20Github-
Interpreting Neural Networks through the Polytope Lens
arXiv2022-11-22--
Scaling Laws and Interpretability of Learning from Repeated Data
arXiv2022-05-21--
In-context Learning and Induction Heads
Anthropic2022-03-08--
A Mathematical Framework for Transformer Circuits
Anthropic2021-12-22--
GitHub Repo stars
Thinking Like Transformers
ICML2021-07-19GithubMini Tutorial

SAE, Dictionary Learning and Superposition

TitleVenueDateCodeBlog
Sparse Autoencoders Match Supervised Features for Model Steering on the IOI Task
MechInterp@ICML2024-07-15--
Measuring Progress in Dictionary Learning for Language Model Interpretability with Board Game Models
MechInterp@ICML2024-07-15--
Interpreting Attention Layer Outputs with Sparse Autoencoders
MechInterp@ICML2024-06-25-Demo
GitHub Repo stars
Identifying Functionally Important Features with End-to-End Sparse Dictionary Learning
MechInterp@ICML2024-05-24Github-
Improving Language Models Trained with Translated Data via Continual Pre-Training and Dictionary Learning Analysis
arXiv2024-05-23--
Automatically Identifying Local and Global Circuits with Linear Computation Graphs
arXiv2024-05-22--
Scaling Monosemanticity: Extracting Interpretable Features from Claude 3 Sonnet
Anthropic2024-05-21-Demo
Sparse Autoencoders Enable Scalable and Reliable Circuit Identification in Language Models
arXiv2024-05-21--
Towards Principled Evaluations of Sparse Autoencoders for Interpretability and Control
arXiv2024-05-20--
GitHub Repo stars
The Local Interaction Basis: Identifying Computationally-Relevant and Sparsely Interacting Features in Neural Networks
arXiv2024-05-20Github-
Improving Dictionary Learning with Gated Sparse Autoencoders
arXiv2024-04-30--
Towards Multimodal Interpretability: Learning Sparse Interpretable Features in Vision Transformers
LessWrong2024-04-29-Demo
Activation Steering with SAEs
LessWrong2024-04-19--
SAE reconstruction errors are (empirically) pathological
LessWrong2024-03-29--
GitHub Repo stars
Sparse autoencoders find composed features in small toy models
LessWrong2024-03-14Github-
GitHub Repo stars
Research Report: Sparse Autoencoders find only 9/180 board state features in OthelloGPT
LessWrong2024-03-05Github-
Do sparse autoencoders find "true features"?
LessWrong2024-02-12--
Dictionary Learning Improves Patch-Free Circuit Discovery in Mechanistic Interpretability: A Case Study on Othello-GPT
arXiv2024-02-19--
Toward A Mathematical Framework for Computation in Superposition
LessWrong2024-01-18--
Sparse Autoencoders Work on Attention Layer Outputs
LessWrong2024-01-16-Demo
GitHub Repo stars
Sparse Autoencoders Find Highly Interpretable Features in Language Models
ICLR2024-01-16Github-
GitHub Repo stars
Codebook Features: Sparse and Discrete Interpretability for Neural Networks
arXiv2023-10-26GithubDemo
GitHub Repo stars
Towards Monosemanticity: Decomposing Language Models With Dictionary Learning
Anthropic2023-10-04GithubDemo-1, Demo-2, Tutorial
Polysemanticity and Capacity in Neural Networks
arXiv2023-07-12--
Distributed Representations: Composition & Superposition
Anthropic2023-05-04--
Superposition, Memorization, and Double Descent
Anthropic2023-01-05--
GitHub Repo stars
Engineering Monosemanticity in Toy Models
arXiv2022-11-16Github-
GitHub Repo stars
Toy Models of Superposition
Anthropic2022-09-14GithubDemo
Softmax Linear Units
Anthropic2022-06-27--
GitHub Repo stars
Transformer visualization via dictionary learning: contextualized embedding as a linear superposition of transformer factors
DeeLIO@NAACL2021-03-29Github-
Zoom In: An Introduction to Circuits
Distill2020-03-10--

Interpretability in Vision LLMs

Benchmarking Interpretability

Enhancing Interpretability

Others

Other Awesome Interpretability Resources

dictionary-learning
interpretability-and-explainability
mechanistic-interpretability
sparse-autoencoder

Contributors

ruizheliUOA

47 commits

fan2goa1

2 commits

LetiP

2 commits

Ki-Seki

1 commits

ruizheliUOA/Awesome-Interpretability-in-Large-Language-Models

This repository collects all relevant resources about interpretability in LLMs

407

56 commits

updated Nov 1, 2024

See the code

README

Awesome Interpretability in Large Language Models

The area of interpretability in large language models (LLMs) has been growing rapidly in recent years. This repository tries to collect all relevant resources to help beginners quickly get started in this area and help researchers to keep up with the latest research progress.

This is an active repository and welcome to open a new issue if I miss any relevant resources. If you have any questions or suggestions, please feel free to contact me via email: ruizhe.li@abdn.ac.uk.


Table of Contents


Awesome Interpretability Libraries

  • GitHub Repo stars TransformerLens: A Library for Mechanistic Interpretability of Generative Language Models. (Doc, Tutorial, Demo)
  • GitHub Repo stars nnsight: enables interpreting and manipulating the internals of deep learned models. (Doc, Tutorial, Paper)
  • GitHub Repo stars SAE Lens: train and analyse SAE. (Doc, Tutorial, Blog)
  • Github Repo stars EleutherAI: sae: train SAE on very large model based on the method and released code of the openAI SAE paper
  • GitHub Repo stars Automatic Circuit DisCovery: automatically build circuit for mechanistic interpretability. (Paper, Demo)
  • GitHub Repo stars Pyvene: A Library for Understanding and Improving PyTorch Models via Interventions. (Paper, Demo)
  • GitHub Repo stars pyreft: A Powerful, Efficient and Interpretable fine-tuning method. (Paper, Demo)
  • GitHub Repo stars repeng: A Python library for generating control vectors with representation engineering. (Paper, Blog)
  • GitHub Repo stars Penzai: a JAX library for writing models as legible, functional pytree data structures, along with tools for visualizing, modifying, and analyzing them. (Paper, Doc, Tutorial)
  • GitHub Repo stars LXT: LRP eXplains Transformers: Layer-wise Relevance Propagation (LRP) extended to handle attention layers in Large Language Models (LLMs) and Vision Transformers (ViTs). (Paper, Doc)
  • GitHub Repo stars Tuned Lens: Tools for understanding how transformer predictions are built layer-by-layer. (Paper, Doc)
  • GitHub Repo stars Inseq: Pytorch-based toolkit for common post-hoc interpretability analyses of sequence generation models. (Paper, Doc)
  • GitHub Repo stars shap: Python library for computing SHAP feature / token importance for any black box model. Works with hugginface, pytorch, tensorflow models, including LLMs. (Paper, Doc)
  • GitHub Repo stars captum: Model interpretability and understanding library for PyTorch (Paper, Doc)

Awesome Interpretability Blogs & Videos

Awesome Interpretability Tutorials

Awesome Interpretability Forums & Worhshops

Awesome Interpretability Tools

  • GitHub Repo stars Transformer Debugger: investigate specific behaviors of small LLMs
  • GitHub Repo stars LLM Transparency Tool (Demo)
  • GitHub Repo stars sae_vis: a tool to replicate Anthropic's sparse autoencoder visualisations (Demo)
  • Neuronpedia: an open platform for interpretability research. (Doc)
  • GitHub Repo stars Comgra: A tool to analyze and debug neural networks in pytorch. Use a GUI to traverse the computation graph and view the data from many different angles at the click of a button. (Paper)

Awesome Interpretability Programs

  • ML Alignment & Theory Scholars (MATS): an independent research and educational seminar program that connects talented scholars with top mentors in the fields of AI alignment, interpretability, and governance.

Awesome Interpretability Papers

Survey Papers

Position Papers

Interpretable Analysis of LLMs

TitleVenueDateCodeBlog
Interpreting Context Look-ups in Transformers: Investigating Attention-MLP Interactions
EMNLP2024-10-23--
GitHub Repo stars
Towards Interpretable Sequence Continuation: Analyzing Shared Circuits in Large Language Models
EMNLP2024-10-04Github-
GitHub Repo stars
How Alignment and Jailbreak Work: Explain LLM Safety through Intermediate Hidden States
EMNLP2024-10-01Github-
GitHub Repo stars
Information Flow Routes: Automatically Interpreting Language Models at Scale
EMNLP2024-10-01Github-
GitHub Repo stars
MMNeuron: Discovering Neuron-Level Domain-Specific Interpretation in Multimodal Large Language Model
EMNLP2024-10-01Github-
GitHub Repo stars
Interpreting Arithmetic Mechanism in Large Language Models through Comparative Neuron Analysis
EMNLP2024-09-12Github-
Why Are My Prompts Leaked? Unraveling Prompt Extraction Threats in Customized Large Language Models
-2024-08-05Github-
Learning Syntax Without Planting Trees: Understanding When and Why Transformers Generalize Hierarchically
MechInterp@ICML2024-07-15--
GitHub Repo stars
Compact Proofs of Model Performance via Mechanistic Interpretability
MechInterp@ICML2024-07-15Github-
Learning to grok: Emergence of in-context learning and skill composition in modular arithmetic tasks
MechInterp@ICML2024-07-15--
How Do Llamas Process Multilingual Text? A Latent Exploration through Activation Patching
MechInterp@ICML2024-07-15--
Look Before You Leap: A Universal Emergent Decomposition of Retrieval Tasks in Language Models
MechInterp@ICML2024-07-15--
What Makes and Breaks Safety Fine-tuning? Mechanistic Study
MechInterp@ICML2024-07-15--
Using Degeneracy in the Loss Landscape for Mechanistic Interpretability
MechInterp@ICML2024-07-15--
Loss in the Crowd: Hidden Breakthroughs in Language Model Training
MechInterp@ICML2024-07-15--
Robust Knowledge Unlearning via Mechanistic Localizations
MechInterp@ICML2024-07-15--
Language Models Linearly Represent Sentiment
MechInterp@ICML2024-07-15--
GitHub Repo stars
Have Faith in Faithfulness: Going Beyond Circuit Overlap When Finding Model Mechanisms
MechInterp@ICML2024-07-15Github-
Learning and Unlearning of Fabricated Knowledge in Language Models
MechInterp@ICML2024-07-15--
Faithful and Fast Influence Function via Advanced Sampling
MechInterp@ICML2024-07-15--
Hypothesis Testing the Circuit Hypothesis in LLMs
MechInterp@ICML2024-07-15--
GitHub Repo stars
The Geometry of Categorical and Hierarchical Concepts in Large Language Models
MechInterp@ICML2024-07-15Github-
GitHub Repo stars
InversionView: A General-Purpose Method for Reading Information from Neural Activations
MechInterp@ICML2024-07-15Github-
Missed Causes and Ambiguous Effects: Counterfactuals Pose Challenges for Interpreting Neural Networks
MechInterp@ICML2024-07-15--
Functional Faithfulness in the Wild: Circuit Discovery with Differentiable Computation Graph Pruning
arXiv2024-07-04--
GitHub Repo stars
Model Internals-based Answer Attribution for Trustworthy Retrieval-Augmented Generation
arXiv2024-07-01Github-
GitHub Repo stars
Recovering the Pre-Fine-Tuning Weights of Generative Models
ICML2024-07-01GithubBlog
GitHub Repo stars
Token Erasure as a Footprint of Implicit Vocabulary Items in LLMs
arXiv2024-06-28GithubBlog
GitHub Repo stars
Observable Propagation: Uncovering Feature Vectors in Transformers
ICML2024-06-25Github-
GitHub Repo stars
Multi-property Steering of Large Language Models with Dynamic Activation Composition
arXiv2024-06-25Github-
What Do the Circuits Mean? A Knowledge Edit View
arXiv2024-06-25--
Confidence Regulation Neurons in Language Models
arXiv2024-06-24--
GitHub Repo stars
Compact Proofs of Model Performance via Mechanistic Interpretability
arXiv2024-06-24Github-
GitHub Repo stars
Preference Tuning For Toxicity Mitigation Generalizes Across Languages
arXiv2024-06-23Github-
Unlocking the Future: Exploring Look-Ahead Planning Mechanistic Interpretability in Large Language Models
arXiv2024-06-23--
GitHub Repo stars
Estimating Knowledge in Large Language Models Without Generating a Single Token
arXiv2024-06-18Github-
Mechanistic Understanding and Mitigation of Language Model Non-Factual Hallucinations
arXiv2024-06-17--
GitHub Repo stars
Transcoders Find Interpretable LLM Feature Circuits
MechInterp@ICML2024-06-17Github-
GitHub Repo stars
Model Editing Harms General Abilities of Large Language Models: Regularization to the Rescue
arXiv2024-06-16Github-
GitHub Repo stars
Context versus Prior Knowledge in Language Models
ACL2024-06-16Github-
Talking Heads: Understanding Inter-layer Communication in Transformer Language Models
arXiv2024-06-13--
GitHub Repo stars
MambaLRP: Explaining Selective State Space Sequence Models
arXiv2024-06-11Github-
GitHub Repo stars
Patchscopes: A Unifying Framework for Inspecting Hidden Representations of Language Models
ICML2024-06-06GithubBlog
GitHub Repo stars
Competition of Mechanisms: Tracing How Language Models Handle Facts and Counterfactuals
ACL2024-06-06Github-
Learned feature representations are biased by complexity, learning order, position, and more
arXiv2024-06-06Demo-
Iteration Head: A Mechanistic Study of Chain-of-Thought
arXiv2024-06-05--
Activation Addition: Steering Language Models Without Optimization
arXiv2024-06-04Code-
Interpretability Illusions in the Generalization of Simplified Models
arXiv2024-06-04--
GitHub Repo stars
SyntaxShap: Syntax-aware Explainability Method for Text Generation
arXiv2024-06-03GithubBlog
Calibrating Reasoning in Language Models with Internal Consistency
arXiv2024-05-29--
Black-Box Access is Insufficient for Rigorous AI Audits
FAccT2024-05-29--
Dual Process Learning: Controlling Use of In-Context vs. In-Weights Strategies with Weight Forgetting
arXiv2024-05-28--
GitHub Repo stars
From Neurons to Neutrons: A Case Study in Interpretability
ICML2024-05-27Github-
GitHub Repo stars
Grokked Transformers are Implicit Reasoners: A Mechanistic Journey to the Edge of Generalization
MechInterp@ICML2024-05-27Github-
GitHub Repo stars
Explorations of Self-Repair in Language Models
ICML2024-05-26Github-
Emergence of a High-Dimensional Abstraction Phase in Language Transformers
arXiv2024-05-24--
GitHub Repo stars
Anchored Answers: Unravelling Positional Bias in GPT-2's Multiple-Choice Questions
arXiv2024-05-23Github-
GitHub Repo stars
Not All Language Model Features Are Linear
arXiv2024-05-23Github-
Using Degeneracy in the Loss Landscape for Mechanistic Interpretability
arXiv2024-05-20--
GitHub Repo stars
Your Transformer is Secretly Linear
arXiv2024-05-19Github-
GitHub Repo stars
Are self-explanations from Large Language Models faithful?
ACL2024-05-16Github-
Faithfulness vs. Plausibility: On the (Un)Reliability of Explanations from Large Language Models
arXiv2024-05-14--
GitHub Repo stars
Steering Llama 2 via Contrastive Activation Addition
arXiv2024-05-07Github-
GitHub Repo stars
How does GPT-2 Predict Acronyms? Extracting and Understanding a Circuit via Mechanistic Interpretability
AISTATS2024-05-07Github-
GitHub Repo stars
How to think step-by-step: A mechanistic understanding of chain-of-thought reasoning
arXiv2024-05-06Github-
GitHub Repo stars
Circuit Component Reuse Across Tasks in Transformer Language Models
ICLR2024-05-06Github-
GitHub Repo stars
LLMCheckup: Conversational Examination of Large Language Models via Interpretability Tools and Self-Explanations
HCI+NLP@NAACL2024-04-24Github-
How to use and interpret activation patching
arXiv2024-04-23--
Understanding Addition in Transformers
arXiv2024-04-23--
Towards Uncovering How Large Language Model Works: An Explainability Perspective
arXiv2024-04-15--
GitHub Repo stars
What needs to go right for an induction head? A mechanistic study of in-context learning circuits and their formation
ICML2024-04-10Github-
Does Transformer Interpretability Transfer to RNNs?
arXiv2024-04-09--
GitHub Repo stars
Locating and Editing Factual Associations in Mamba
arXiv2024-04-04GithubDemo
Eliciting Latent Knowledge from Quirky Language Models
ME-FoMo@ICLR2024-04-03--
Do language models plan ahead for future tokens?
arXiv2024-04-01--
GitHub Repo stars
Sparse Feature Circuits: Discovering and Editing Interpretable Causal Graphs in Language Models
arXiv2024-03-31GithubDemo
Have Faith in Faithfulness: Going Beyond Circuit Overlap When Finding Model Mechanisms
arXiv2024-03-26--
GitHub Repo stars
What does the Knowledge Neuron Thesis Have to do with Knowledge?
ICLR2024-03-16Github-
GitHub Repo stars
Language Models Represent Space and Time
ICLR2024-03-04Github-
AtP*: An efficient and scalable method for localizing LLM behaviour to components
arXiv2024-03-01--
A Mechanistic Analysis of a Transformer Trained on a Symbolic Multi-Step Reasoning Task
arXiv2024-02-28--
GitHub Repo stars
Function Vectors in Large Language Models
ICLR2024-02-25GithubBlog
A Language Model's Guide Through Latent Space
arXiv2024-02-22--
Interpreting Shared Circuits for Ordered Sequence Prediction in a Large Language Model
arXiv2024-02-22--
GitHub Repo stars
Fine-Tuning Enhances Existing Mechanisms: A Case Study on Entity Tracking
ICLR2024-02-22GithubBlog
GitHub Repo stars
Fine-grained Hallucination Detection and Editing for Language Models
arXiv2024-02-21GithubBlog
GitHub Repo stars
Enhanced Hallucination Detection in Neural Machine Translation through Simple Detector Aggregation
arXiv2024-02-20Github-
Identifying Semantic Induction Heads to Understand In-Context Learning
arXiv2024-02-20--
Backward Lens: Projecting Language Model Gradients into the Vocabulary Space
arXiv2024-02-20--
Show Me How It's Done: The Role of Explanations in Fine-Tuning Language Models
ACML2024-02-12--
GitHub Repo stars
Model Editing with Canonical Examples
arXiv2024-02-09Github-
GitHub Repo stars
Opening the AI black box: program synthesis via mechanistic interpretability
arXiv2024-02-07Github-
INSIDE: LLMs' Internal States Retain the Power of Hallucination Detection
ICLR2024-02-06--
GitHub Repo stars
In-Context Language Learning: Architectures and Algorithms
arXiv2024-01-30Github-
Gradient-Based Language Model Red Teaming
EACL2024-01-30Github-
The Calibration Gap between Model and Human Confidence in Large Language Models
arXiv2024-01-24--
GitHub Repo stars
Universal Neurons in GPT2 Language Models
arXiv2024-01-22Github-
The mechanistic basis of data dependence and abrupt learning in an in-context classification task
ICLR2024-01-16--
GitHub Repo stars
Overthinking the Truth: Understanding how Language Models Process False Demonstrations
ICLR2024-01-16Github-
Mechanistically analyzing the effects of fine-tuning on procedurally defined tasks
ICLR2024-01-16--
Feature emergence via margin maximization: case studies in algebraic tasks
ICLR2024-01-16--
Successor Heads: Recurring, Interpretable Attention Heads In The Wild
ICLR2024-01-16--
Towards Best Practices of Activation Patching in Language Models: Metrics and Methods
ICLR2024-01-16--
GitHub Repo stars
A Mechanistic Understanding of Alignment Algorithms: A Case Study on DPO and Toxicity
ICML2024-01-03Github-
GitHub Repo stars
Forbidden Facts: An Investigation of Competing Objectives in Llama-2
ATTRIB@NeurIPS2023-12-31GithubBlog
GitHub Repo stars
The Geometry of Truth: Emergent Linear Structure in Large Language Model Representations of True/False Datasets
arXiv2023-12-08GithubBlog
GitHub Repo stars
Is This the Subspace You Are Looking for? An Interpretability Illusion for Subspace Activation Patching
ATTRIB@NeurIPS2023-12-06Github-
GitHub Repo stars
Structured World Representations in Maze-Solving Transformers
UniReps@NeurIPS2023-12-05Github-
Generating Interpretable Networks using Hypernetworks
arXiv2023-12-05--
GitHub Repo stars
The Clock and the Pizza: Two Stories in Mechanistic Explanation of Neural Networks
NeurIPS2023-11-21Github-
GitHub Repo stars
Attribution Patching Outperforms Automated Circuit Discovery
ATTRIB@NeurIPS2023-11-20Github-
GitHub Repo stars
Tracr: Compiled Transformers as a Laboratory for Interpretability
NeurIPS2023-11-03Github-
GitHub Repo stars
How does GPT-2 compute greater-than?: Interpreting mathematical abilities in a pre-trained language model
NeurIPS2023-11-02Github-
GitHub Repo stars
Learning Transformer Programs
NeurIPS2023-10-31Github-
GitHub Repo stars
Towards Automated Circuit Discovery for Mechanistic Interpretability
NeurIPS2023-10-28Github-
GitHub Repo stars
Towards a Mechanistic Interpretation of Multi-Step Reasoning Capabilities of Language Models
EMNLP2023-10-23Github-
GitHub Repo stars
Inference-Time Intervention: Eliciting Truthful Answers from a Language Model
NeurIPS2023-10-20Github-
GitHub Repo stars
Progress measures for grokking via mechanistic interpretability
ICLR2023-10-19GithubBlog
GitHub Repo stars
Copy Suppression: Comprehensively Understanding an Attention Head
arXiv2023-10-06GithubBlog & Demo
GitHub Repo stars
Does Localization Inform Editing? Surprising Differences in Causality-Based Localization vs. Knowledge Editing in Language Models
NeurIPS2023-09-21Github-
GitHub Repo stars
Interpretability at Scale: Identifying Causal Mechanisms in Alpaca
NeurIPS2023-09-21Github-
GitHub Repo stars
Emergent Linear Representations in World Models of Self-Supervised Sequence Models
BlackboxNLP@EMNLP2023-09-07GithubBlog
GitHub Repo stars
Finding Neurons in a Haystack: Case Studies with Sparse Probing
arXiv2023-06-02Github-
GitHub Repo stars
Efficient Shapley Values Estimation by Amortization for Text Classification
ACL2023-05-31GithubVideo
GitHub Repo stars
A Toy Model of Universality: Reverse Engineering How Networks Learn Group Operations
ICML2023-05-24Github-
Localizing Model Behavior with Path Patching
arXiv2023-05-16--
Language models can explain neurons in language models
OpenAI2023-05-09--
N2G: A Scalable Approach for Quantifying Interpretable Neuron Representations in Large Language Models
ICLR Workshop2023-04-22--
GitHub Repo stars
Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 small
ICLR2023-01-20Github-
Interpreting Neural Networks through the Polytope Lens
arXiv2022-11-22--
Scaling Laws and Interpretability of Learning from Repeated Data
arXiv2022-05-21--
In-context Learning and Induction Heads
Anthropic2022-03-08--
A Mathematical Framework for Transformer Circuits
Anthropic2021-12-22--
GitHub Repo stars
Thinking Like Transformers
ICML2021-07-19GithubMini Tutorial

SAE, Dictionary Learning and Superposition

TitleVenueDateCodeBlog
Sparse Autoencoders Match Supervised Features for Model Steering on the IOI Task
MechInterp@ICML2024-07-15--
Measuring Progress in Dictionary Learning for Language Model Interpretability with Board Game Models
MechInterp@ICML2024-07-15--
Interpreting Attention Layer Outputs with Sparse Autoencoders
MechInterp@ICML2024-06-25-Demo
GitHub Repo stars
Identifying Functionally Important Features with End-to-End Sparse Dictionary Learning
MechInterp@ICML2024-05-24Github-
Improving Language Models Trained with Translated Data via Continual Pre-Training and Dictionary Learning Analysis
arXiv2024-05-23--
Automatically Identifying Local and Global Circuits with Linear Computation Graphs
arXiv2024-05-22--
Scaling Monosemanticity: Extracting Interpretable Features from Claude 3 Sonnet
Anthropic2024-05-21-Demo
Sparse Autoencoders Enable Scalable and Reliable Circuit Identification in Language Models
arXiv2024-05-21--
Towards Principled Evaluations of Sparse Autoencoders for Interpretability and Control
arXiv2024-05-20--
GitHub Repo stars
The Local Interaction Basis: Identifying Computationally-Relevant and Sparsely Interacting Features in Neural Networks
arXiv2024-05-20Github-
Improving Dictionary Learning with Gated Sparse Autoencoders
arXiv2024-04-30--
Towards Multimodal Interpretability: Learning Sparse Interpretable Features in Vision Transformers
LessWrong2024-04-29-Demo
Activation Steering with SAEs
LessWrong2024-04-19--
SAE reconstruction errors are (empirically) pathological
LessWrong2024-03-29--
GitHub Repo stars
Sparse autoencoders find composed features in small toy models
LessWrong2024-03-14Github-
GitHub Repo stars
Research Report: Sparse Autoencoders find only 9/180 board state features in OthelloGPT
LessWrong2024-03-05Github-
Do sparse autoencoders find "true features"?
LessWrong2024-02-12--
Dictionary Learning Improves Patch-Free Circuit Discovery in Mechanistic Interpretability: A Case Study on Othello-GPT
arXiv2024-02-19--
Toward A Mathematical Framework for Computation in Superposition
LessWrong2024-01-18--
Sparse Autoencoders Work on Attention Layer Outputs
LessWrong2024-01-16-Demo
GitHub Repo stars
Sparse Autoencoders Find Highly Interpretable Features in Language Models
ICLR2024-01-16Github-
GitHub Repo stars
Codebook Features: Sparse and Discrete Interpretability for Neural Networks
arXiv2023-10-26GithubDemo
GitHub Repo stars
Towards Monosemanticity: Decomposing Language Models With Dictionary Learning
Anthropic2023-10-04GithubDemo-1, Demo-2, Tutorial
Polysemanticity and Capacity in Neural Networks
arXiv2023-07-12--
Distributed Representations: Composition & Superposition
Anthropic2023-05-04--
Superposition, Memorization, and Double Descent
Anthropic2023-01-05--
GitHub Repo stars
Engineering Monosemanticity in Toy Models
arXiv2022-11-16Github-
GitHub Repo stars
Toy Models of Superposition
Anthropic2022-09-14GithubDemo
Softmax Linear Units
Anthropic2022-06-27--
GitHub Repo stars
Transformer visualization via dictionary learning: contextualized embedding as a linear superposition of transformer factors
DeeLIO@NAACL2021-03-29Github-
Zoom In: An Introduction to Circuits
Distill2020-03-10--

Interpretability in Vision LLMs

Benchmarking Interpretability

Enhancing Interpretability

Others

Other Awesome Interpretability Resources

dictionary-learning
interpretability-and-explainability
mechanistic-interpretability
sparse-autoencoder

Contributors

ruizheliUOA

47 commits

fan2goa1

2 commits

LetiP

2 commits

Ki-Seki

1 commits