[Paper Review] A Primer on the Inner Workings of Transformer-based Language Models
This primer provides a concise technical introduction to transformer-based language model interpretability, focusing on decoder-only (GPT-like) LMs, and offers a comprehensive overview of known internal mechanisms, methods, and tools for analysis.
The rapid progress of research aimed at interpreting the inner workings of advanced language models has highlighted a need for contextualizing the insights gained from years of work in this area. This primer provides a concise technical introduction to the current techniques used to interpret the inner workings of Transformer-based language models, focusing on the generative decoder-only architecture. We conclude by presenting a comprehensive overview of the known internal mechanisms implemented by these models, uncovering connections across popular approaches and active research directions in this area.
Motivation & Objective
- Contextualize interpretability insights for transformer-based LMs within a unified framework.
- Present a concise technical introduction to techniques used to interpret inner workings of decoder-only LMs.
- Unify notation and categorize interpretability approaches along input localization and representation decoding axes.
- Provide a comprehensive overview of known internal mechanisms and connections across interpretability methods.
- Survey available tools to conduct interpretability analyses on transformer LMs.
Proposed method
- Describe the decoder-only Transformer architecture and residual-stream perspective for analyzing LMs.
- Detail key components and computations, including LayerNorm/RMSNorm, Attention, and FFN blocks, with OV (output-value) circuit decompositions.
- Introduce prediction-time logit and probability decompositions, enabling component-wise attribution (DLA, DLDA) and path-based analyses (OV, Q/K composition).
- Explain localizing model behavior via input attribution (gradient-based, perturbation, and context-mixing methods) and model-component attribution (logit attribution and causal interventions).
- Present causal-intervention frameworks (activation patching, do-operations, and subspace activation patching) to quantify component contributions.
- Outline circuit analysis approaches within mechanistic interpretability to identify interacting subgraphs that solve tasks.
Experimental results
Research questions
- RQ1What interpretability techniques are used to analyze decoder-only Transformer language models?
- RQ2How can we localize contributions to predictions from inputs and from specific model components?
- RQ3What internal mechanisms and circuits are known or hypothesized in Transformer LMs, and how do various methods relate to them?
- RQ4What tools and methodological practices best support interpretability analyses of Transformer LMs?
Key findings
- The paper provides a unified, notation-focused overview of Transformer LM interpretability methods and their connections.
- It categorizes interpretability approaches along input localization and representation decoding, linking many techniques to residual-stream dynamics.
- It presents concrete decompositions (e.g., logit attribution and path-based contributions) that enable component-wise analysis of predictions.
- It synthesizes known internal mechanisms and circuits in Transformer LMs, highlighting relationships between attention, FFN, and OV circuits.
- It surveys a broad set of tools and causal/interventional methodologies used to probe inner workings, offering guidance for future research directions.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.