TL;DR Researchers have discovered that the "linear" way large language models (LLMs) represent facts is directly tied to how often those facts appear in their pretraining data. By identifying specific co-occurrence thresholds (e.g., seeing a subject and object together ~1,000 times), we can predict when a model will develop a structured internal representation, and even use a model's weights to "reverse-engineer" how much it saw a specific term during training.
The Problem: Internal Geometry and Pretraining Data
We know that more data generally leads to better performance, but we don't fully understand how pretraining statistics shape the internal geometry of a language model. Specifically, why are some concepts represented as simple "linear" relationships (where a single vector can transform "France" into "Paris") while others remain messy and non-linear?
The authors investigate the "Linear Representation Hypothesis"—the idea that LLMs represent concepts as directions in space—and seek to find the "when" and "why" behind these structures. Understanding this connection is vital for model interpretability, "steering" model behavior, and auditing the training data of closed-source models.
Measuring Linearity and Data Frequency
The study centers on Linear Relational Embeddings (LREs). An LRE approximates the complex, multi-layer computation of an LLM as a simple affine transformation ($Ws + b$). If an LRE can accurately map a subject (like "Miles Davis") to an object ("trumpet"), the representation is considered "linear."
To measure this, the authors used two primary metrics:
- Faithfulness: Does the linear approximation produce the same output as the full model?
- Causality: If we "edit" the subject's representation using the linear map, does the model's output change to the expected object?
The team also developed Batch Search, a high-performance tool designed to count exact token co-occurrences across trillions of training tokens. This allowed them to precisely correlate internal model structures with the exact data the model saw during training. They evaluated OLMo (1B and 7B) and GPT-J (6B) against a subset of the RELATIONS dataset, containing over 10,000 unique subject-object pairs across 25 factual relations.
The Emergence of Linear Representations
- The Tipping Point: Linear representations don't emerge gradually; they tend to form consistently once a specific frequency threshold is met. For 6B-7B models, this is roughly 1,000 to 2,000 co-occurrences. Smaller models (1B) require more exposure (~4,000 times) to form the same structures.
- Timing Doesn't Matter: It doesn't matter if a model sees a fact at the beginning or the end of its pretraining. Once the cumulative co-occurrence count hits the threshold, the linear representation forms.
- Representations as Data Signatures: Because linearity is so tied to frequency, the authors could train a regression model to look at an LLM's internal states and predict how often a word appeared in its training set.
- Beyond Probabilities: Interestingly, these linear representation metrics are much better predictors of training data frequency than the model's output probabilities or few-shot accuracy.
Key Findings and Data Auditing
- Strong Correlation: There is a high correlation ($r = 0.82$) between subject-object co-occurrence frequency and the "Causality" score of the linear representation.
- Data Auditing Accuracy: Their regression model achieved ~70% accuracy in predicting term frequencies within one order of magnitude.
- Generalization: A frequency-prediction model trained on OLMo's representations worked surprisingly well when tested on GPT-J, despite the models having different architectures and training sets. This suggests that the relationship between data frequency and internal linearity is a fundamental property of transformer-based LLMs.
Limitations and Future Directions
The authors acknowledge that while the correlation is striking, they cannot strictly claim causality without performing expensive "counterfactual" training (e.g., intentionally removing specific facts to see if the linear structure disappears).
The study also focused primarily on factual, "triplet" style relations. Future work could explore whether more abstract concepts or complex reasoning paths follow similar frequency-based "linearization" rules. Finally, this research opens the door for "data curation by design"—intentionally upsampling rare but important facts to ensure they reach the threshold required for the model to represent them robustly.
Summary updated