Singular Value Decomposition (SVD) is a matrix factorization method that decomposes a matrix $W$ into three matrices: $W = U \Sigma V^T$, where $U$ and $V$ are orthogonal matrices containing left and right singular vectors, and $\Sigma$ is a diagonal matrix of non-negative singular values. This decomposition reveals the fundamental geometric structure of the linear transformation, identifying the orthogonal axes of maximum stretching.
Glossary
Singular Value Decomposition (SVD)

What is Singular Value Decomposition (SVD)?
A foundational linear algebra technique that factorizes any matrix into constituent components, revealing the principal directions of variance and enabling the compression and interpretation of complex transformations.
In transformer mechanistic analysis, SVD is applied to weight matrices—specifically the OV (Output-Value) circuit and QK (Query-Key) circuit—to decompose them into a sum of rank-one components. Each rank-one component represents an independent information pathway, allowing researchers to isolate and interpret the principal semantic directions along which an attention head reads from and writes to the residual stream.
Key Properties of SVD for Circuit Analysis
Singular Value Decomposition (SVD) factorizes a weight matrix into interpretable rank-one components, revealing the principal directions of information transformation in transformer circuits.
Decomposing OV and QK Circuits
SVD factorizes a weight matrix W into UΣVᵀ. In the OV circuit (W_O W_V), the right singular vectors (columns of V) represent the directions in the residual stream that the head reads from, while the left singular vectors (columns of U) represent the directions it writes to. The singular values in Σ quantify the strength of each read-write pair. For QK circuits (W_Qᵀ W_K), SVD reveals the principal query-key directions that dominate attention score computation.
Identifying Principal Semantic Axes
The top singular vectors of an attention head's OV matrix often correspond to interpretable semantic operations:
- Copying behavior: A head that copies token information will have a dominant singular vector aligned with the identity-like mapping in the residual stream.
- Inhibition: Negative singular values (or vectors with opposing signs) can reveal how a head suppresses specific token representations.
- Concept subspaces: The span of the top-k singular vectors defines the low-dimensional subspace in which the head performs its primary function, filtering out noise.
Rank Analysis and Head Specialization
The effective rank of a weight matrix—the number of singular values above a noise threshold—indicates how many independent read-write operations an attention head performs:
- Rank-1 heads: Often correspond to simple copying or primitive operations. Induction heads frequently exhibit near rank-1 OV matrices.
- High-rank heads: Perform more complex, compositional transformations, potentially multiplexing multiple functions.
- Singular value decay: A sharp drop-off after the first few singular values suggests the head's behavior is dominated by a small number of principal directions, making it amenable to mechanistic interpretation.
SVD for Weight Matrix Editing
SVD enables precise surgical interventions on model weights:
- Rank-one updates: The ROME (Rank-One Model Editing) technique uses SVD to insert new factual associations into MLP layers by adding a rank-one matrix to W_proj, modifying only the singular vectors associated with the target knowledge.
- Pruning: Zeroing out small singular values compresses the matrix while preserving its dominant behavior, useful for removing redundant or noisy components.
- Subspace projection: Projecting activations onto or away from specific singular vector subspaces allows causal testing of whether a particular direction is necessary for a behavior.
Comparing Heads via Singular Vector Alignment
The canonical correlation or subspace alignment between the singular vectors of different attention heads quantifies functional similarity:
- Heads with highly aligned top singular vectors likely perform redundant or synergistic operations.
- Orthogonal singular vector subspaces indicate heads that specialize in distinct, non-interfering functions.
- This alignment metric is used in circuit discovery to cluster heads into functional groups and identify the minimal set of heads required for a specific task.
SVD of the Embedding and Unembedding Matrices
Applying SVD to the embedding matrix W_E and unembedding matrix W_U reveals the principal semantic axes of the token vocabulary:
- The singular vectors of W_E define the directions along which token semantics vary most significantly.
- The Logit Lens technique effectively projects intermediate residual stream states onto the singular vectors of W_U to interpret the model's evolving predictions.
- The alignment between W_E and W_U singular vectors (often tied via weight tying) shows how the model maps input semantics to output logits through a shared representational space.
Frequently Asked Questions
Core questions about applying matrix factorization to decode the principal directions of information flow in transformer weight matrices.
Singular Value Decomposition (SVD) is a matrix factorization technique that decomposes a weight matrix ( W ) into three matrices—( U ), ( \Sigma ), and ( V^T )—such that ( W = U \Sigma V^T ). In mechanistic interpretability, this decomposition reveals the principal directions of information transformation within a neural network layer. The left singular vectors (columns of ( U )) form an orthonormal basis for the output space, the right singular vectors (rows of ( V^T )) form an orthonormal basis for the input space, and the diagonal matrix ( \Sigma ) contains the singular values ( \sigma_i ), which quantify the strength or importance of each corresponding rank-one component. By analyzing the top singular vectors, researchers can identify the dominant linear transformations performed by OV circuits (output-value pathways) and QK circuits (query-key pathways) in transformer attention heads, effectively separating a complex weight matrix into a sum of interpretable, independent operations.
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.
Related Terms
Explore the core concepts used alongside SVD to decompose and interpret the internal computations of transformer models.
OV Circuit
The computational pathway formed by the Output and Value projection matrices. SVD is often applied to the OV matrix (the product of the output and value weights) to decompose it into rank-one components, revealing the principal semantic directions an attention head writes into the residual stream.
QK Circuit
The pathway formed by the Query and Key projection matrices that computes attention scores. Decomposing the QK matrix with SVD reveals the dominant matchmaking patterns an attention head uses to decide which previous tokens to attend to, often isolating specific syntactic or positional behaviors.
Dictionary Learning
A decomposition method that learns an overcomplete basis of vectors to represent activations as a sparse linear combination of interpretable features. While often implemented with Sparse Autoencoders, the goal is similar to SVD: to find a set of principal directions that explain the variance in the data in a more interpretable format.
Superposition Hypothesis
The theory that neural networks represent more independent features than they have dimensions by encoding them in almost-orthogonal directions. SVD is a critical tool for investigating this, as it can identify the primary axes of variation in a weight matrix and reveal how the model compresses information into a lower-dimensional space.
Causal Tracing
A method for locating where factual knowledge is stored by restoring clean hidden states one layer at a time. SVD can be applied to the weight matrices identified by causal tracing to further decompose the factual association into its constituent rank-one components, isolating the specific vector responsible for a stored fact.
Rank-One Model Editing (ROME)
A precise model editing technique that treats an MLP layer as a linear associative memory. ROME uses a rank-one update to a weight matrix, a concept directly rooted in SVD, to surgically insert a new fact by modifying the principal singular vectors without corrupting unrelated knowledge.

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