[Paper Review] Transformers learn factored representations
This paper shows that transformers pretrained with next-token prediction spontaneously learn factored representations, organizing factors into orthogonal subspaces and achieving exponential dimensional reduction when factors are conditionally independent, with an inductive bias toward factoring even when fidelity suffers.
Transformers pretrained via next token prediction learn to factor their world into parts, representing these factors in orthogonal subspaces of the residual stream. We formalize two representational hypotheses: (1) a representation in the product space of all factors, whose dimension grows exponentially with the number of parts, or (2) a factored representation in orthogonal subspaces, whose dimension grows linearly. The factored representation is lossless when factors are conditionally independent, but sacrifices predictive fidelity otherwise, creating a tradeoff between dimensional efficiency and accuracy. We derive precise predictions about the geometric structure of activations for each, including the number of subspaces, their dimensionality, and the arrangement of context embeddings within them. We test between these hypotheses on transformers trained on synthetic processes with known latent structure. Models learn factored representations when factors are conditionally independent, and continue to favor them early in training even when noise or hidden dependencies undermine conditional independence, reflecting an inductive bias toward factoring at the cost of fidelity. This provides a principled explanation for why transformers decompose the world into parts, and suggests that interpretable low dimensional structure may persist even in models trained on complex data.
Motivation & Objective
- Motivate the question of whether transformers learn to factor their world into discrete parts.
- Formalize two representational hypotheses (joint vs. factored) and derive geometric predictions.
- Test whether transformers learn factored representations on synthetic data with known latent structure.
- Assess whether factoring is an inductive bias and how it behaves when conditional independence is violated.
Proposed method
- Develop a theoretical framework linking latent data structure to activation geometry using generalized Hidden Markov Models (GHMMs).
- Define predictive vectors and analyze their geometry under joint and factored representations.
- Construct synthetic data with five latent factors (three 3-state HMMs and two 3D GHMMs) and train GPT-2 style transformers on next-token prediction.
- Use PCA and vary-one subspace analyses to identify factor-specific subspaces and test orthogonality.
- Introduce controlled violations of conditional independence by adding a noisy channel and observe effects on representations.
- Replicate experiments on RNNs/LSTMs to assess generality.
Experimental results
Research questions
- RQ1Do transformers represent predictive information in a joint tensor-product space or in a factored, orthogonal subspace structure?
- RQ2Under what data-generating conditions do transformers preferentially learn factored representations?
- RQ3Is the factorization an inductive bias of the architecture, even when it reduces predictive fidelity?
- RQ4How do representations change when conditional independence among factors is weakened or broken?
- RQ5Do RNN-based architectures exhibit similar factored representations as transformers?
Key findings
- Transformers learn factored representations when the data-generating process decomposes into conditionally independent factors, achieving exponential dimensional reduction (joint space needs ∏d_n − 1 dimensions vs. factored needs ∑(d_n − 1)).
- Activations organize into N orthogonal subspaces, one per factor, with each factor’s predictive vector lying in its own subspace.
- Factored representations emerge early in training, including at the embedding layer, and persist even when conditional independence is not perfectly satisfied.
- When factors become imperfectly independent due to noise, the model still prefers the factored solution and first dwells in the factored regime before expanding dimensionality to recover fidelity.
- RNNs/LSTMs also show tendencies toward factored representations, indicating a broader architectural phenomenon.
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.