TL;DR
How much of a transformer's capability comes from training versus its raw architecture? This paper demonstrates that randomly initialized transformers can solve complex algorithmic tasks—like modular arithmetic, multi-digit addition, and parenthesis balancing—by training only their embedding and unembedding layers. This reveals that the transformer architecture possesses a powerful intrinsic inductive bias, pre-configuring computational circuits that merely need to be "steered" into the right subspace to be utilized.
What Problem Does This Paper Address?
When a transformer language model learns to perform arithmetic or track code syntax, does it build those computational circuits from scratch via gradient descent, or does the architecture itself make those circuits naturally easy to find?
To disentangle the role of the architecture from the role of the training data, the authors ask a radical question: What can a completely random transformer do if we freeze all its internal weights and only optimize how data enters and leaves the model? If this "embedding-only" training succeeds, it implies that the randomly initialized model already implements the target computation, and training simply finds an encoding scheme that surfaces this latent behavior.
Methods
The authors use standard decoder-only transformer models but freeze all intermediate layers (attention weights, feed-forward networks, and layer normalizations) at their random initializations. They only optimize:
- The token embedding matrix ($E_{token}$)
- The positional embedding matrix ($E_{pos}$)
- The final unembedding matrix ($U$)
To understand the geometry of how these random networks compute, the authors analyze the hidden representations using Principal Component Analysis (PCA). This allows them to test the hypothesis of subspace selection: the idea that embedding training works by steering inputs into low-dimensional linear subspaces where the random weights already happen to perform the correct mathematical operations.
Datasets
The approach was evaluated across seven diverse synthetic and natural text benchmarks:
- Modular Addition: Computing $(a + b) \pmod{199}$.
- Needle-in-a-Haystack: An associative recall task requiring the model to retrieve a value associated with a specific marker from a long sequence.
- Decimal Addition: Adding two 10-digit numbers represented as sequences of digits.
- Parenthesis Balancing (Dyck Recognition): Determining if a string of parentheses is well-formed.
- Memorization: Learning an arbitrary, unstructured key-value map.
- Language Modeling: Evaluated on the TinyStories dataset, a benchmark of synthetic, fluent children's stories designed to test grammar and basic reasoning.
- Circuit Imitation: Training the random model to mimic the output distribution of a separate, smaller random target transformer.
Key Insights and Ideas
- Subspace Selection over Sparsification: Unlike the famous Lottery Ticket Hypothesis—which suggests that random networks contain sparse subnetworks that can match trained performance—this paper finds that random transformers use distributed representations. They don't turn off neurons; instead, they project data into specific low-dimensional subspaces where the random weights naturally align with the target task.
- Inherent Inductive Biases: The fact that frozen, random weights can perform multi-digit decimal addition or match nested parentheses shows that the transformer architecture is fundamentally biased toward structured, algorithmic operations.
- Emergent Interpretable Mechanisms: Even though the internal weights are completely random, the optimized embeddings force the model to exhibit classic, interpretable transformer mechanisms. For example, the model naturally forms "induction heads" for associative recall and arranges numbers into geometric circles for modular math.

Key Results
- Perfect Algorithmic Performance: A random transformer with a hidden dimension of 1024 achieved 100% test accuracy on modular addition, needle-in-a-haystack, decimal addition, and parenthesis balancing.
- Outperforming Fully Trained LSTMs: On the 10-digit decimal addition task, the embedding-only random transformer achieved 100% accuracy, significantly outperforming a fully trained LSTM, which only managed 53.0% accuracy.
- Generation of Grammatical Text: When evaluated on TinyStories, a 512-width random transformer achieved a cross-entropy loss of 2.64. While it required a larger hidden dimension than a fully trained counterpart to achieve this, it successfully generated text that was topically appropriate and largely grammatical.
Limitations and Future Work
- Parameter Inefficiency: Random transformers require much larger hidden dimensions (e.g., width 1024 vs. width 16) to match the performance of fully trained models, making them computationally expensive.
- Poor Unstructured Memorization: While excellent at algorithmic tasks, random transformers struggle with pure memorization (only memorizing 5% of arbitrary key-value pairs compared to 80% for fully trained models), showing they are better at exploiting structured functions than storing raw data.
- Linear Assumptions: The authors' analysis of "subspace selection" focused primarily on linear subspaces via PCA; non-linear latent semantics remain unexamined.
- The Training Trajectory Mystery: The paper leaves open an intriguing question for future interpretability research: during full training, do models gradually refine these initial random pathways, or do they abandon them entirely for different computational mechanisms?
Summary updated