Direct Logit Attribution (DLA) is a linear decomposition technique that attributes the final logit output for a specific token directly to the individual, additive contributions of each attention head and MLP layer in a transformer model. By leveraging the residual stream's linear structure, DLA approximates the logit difference between two tokens as the sum of independent, component-wise effects, enabling precise localization of which parts of the network drove a prediction.
Glossary
Direct Logit Attribution

What is Direct Logit Attribution?
A method for attributing a model's final output logits directly to the individual contributions of its internal components.
The method works by multiplying each component's output written to the residual stream by the model's unembedding matrix, projecting it directly into logit space. This bypasses nonlinear interactions between layers to provide a first-order, causal approximation of a component's direct effect. DLA is a foundational tool in mechanistic interpretability for identifying circuits and is closely related to the logit lens and activation patching techniques.
Key Characteristics of Direct Logit Attribution
Direct Logit Attribution (DLA) is a linear decomposition method that explains a model's final output token prediction by assigning a precise numerical contribution score to every attention head and MLP layer in the transformer architecture.
Linear Additive Decomposition
DLA exploits the residual stream architecture of transformers. Since each component writes its output additively to the residual stream, the final logit for a token can be expressed as the sum of the direct contributions from every attention head and MLP neuron across all layers. This provides a complete accounting of how the final prediction was constructed, with no unexplained variance.
Direct Path via Unembedding
The attribution is computed by taking the output vector of a specific component (e.g., an attention head at layer 12) and multiplying it directly by the model's unembedding matrix. This yields the component's direct effect on the output logits, bypassing all subsequent layers. This isolates what a component writes into the residual stream that directly influences the final prediction, separate from its indirect effects through later layers.
Causal Intervention Baseline
DLA is a zero-ablation method at its core. The contribution of a component is defined as the difference between the logit with the component's output present and the logit with it set to zero. This provides a clean causal interpretation: the score represents what happens when you surgically remove that component's direct output, holding all other computations constant.
Distinct from Accumulated Residual
DLA measures the direct effect, not the total causal effect. A component may write information to the residual stream that is later amplified, suppressed, or copied by downstream layers. DLA intentionally ignores these indirect interactions to provide a clean, layer-by-layer decomposition. For total causal effects, techniques like activation patching or path patching are required.
Head-Specific Token Attribution
For attention heads, DLA can decompose the contribution further by source token. Since an attention head computes a weighted sum of value vectors from previous positions, the logit contribution can be split across each attended token. This reveals which specific input tokens each head is using to influence the final prediction, enabling precise tracing of information flow.
Logit Lens Relationship
DLA is closely related to the logit lens technique. While the logit lens decodes the accumulated residual stream at each layer to see the model's current best guess, DLA decomposes the final logit into the marginal contributions of each component. Together, they provide a complete picture: the logit lens shows the evolving prediction, and DLA shows which components caused each shift.
Frequently Asked Questions
Direct Logit Attribution (DLA) is a linear decomposition technique that attributes the final logit output for a token directly to the individual contributions of each attention head and MLP layer. The following questions address the core mechanisms, applications, and limitations of this foundational interpretability method.
Direct Logit Attribution (DLA) is a linear decomposition technique that attributes the final logit output for a token directly to the individual contributions of each attention head and MLP layer. It works by exploiting the residual stream architecture of transformer models. Since each component writes its output additively to the residual stream, and the final logits are computed by applying the unembedding matrix to the accumulated residual stream, the logit contribution of any component is simply the dot product of its output vector with the unembedding matrix. This provides a first-order, linear approximation of how much each model component directly increases or decreases the logit for a specific output token, without requiring any causal interventions or additional forward passes.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Direct Logit Attribution vs. Related Techniques
A comparison of Direct Logit Attribution with other linear decomposition and probing techniques used to decode transformer internals.
| Feature | Direct Logit Attribution | Logit Lens | Tuned Lens | Activation Patching |
|---|---|---|---|---|
Primary Objective | Attribute final logit to individual attention heads and MLP layers | Decode intermediate residual stream into next-token predictions | Improve decoded prediction accuracy at each layer | Causally isolate the function of a specific component |
Methodology | Linear decomposition of logits using attention output weights and MLP contributions | Apply unembedding matrix directly to residual stream at each layer | Apply learned affine transformation per layer before unembedding | Replace activation with corrupted or alternative forward pass value |
Causal Intervention | ||||
Requires Training | ||||
Granularity | Per-component (head/MLP) contribution to final output | Per-layer next-token distribution | Per-layer next-token distribution | Per-component functional role |
Output Type | Scalar logit contribution per component | Probability distribution over vocabulary | Probability distribution over vocabulary | Change in model behavior or performance metric |
Key Limitation | Assumes linear additivity of component contributions | Decoded predictions are often noisy and low-confidence | Requires curated training data for affine probes | Requires careful experimental design to avoid confounding paths |
Primary Use Case | Identifying which heads and layers drive a specific token prediction | Quickly inspecting how predictions evolve across layers | More accurate layer-wise prediction analysis | Testing causal hypotheses about component function |
Related Terms
Direct Logit Attribution is a foundational technique in the mechanistic interpretability toolkit. Explore the core concepts and methods used alongside it to reverse-engineer transformer computations.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us