Source-linked AI summary
Convergent Evolution: How Different Language Models Learn Similar Number Representations
Deqing Fu, Tianyi Zhou, Mikhail Belkin, Vatsal Sharan, Robin Jia
TL;DR
The paper asks why periodic Fourier structure in number representations does not always yield functional modular geometry. It combines theoretical analysis with controlled comparisons across models and training conditions, finding universal spectral convergence but selective geometric convergence shaped by data, architecture, optimizer, and tokenizer.
Problem
The central question is whether universal Fourier spikes indicate functional numerical structure, since only some systems make n mod T linearly decodable.
Method
The paper proves the relation between Fourier spikes and mod-T probing, then uses controlled experiments across architectures, optimizers, data, tokenizers, and addition tasks.
Results
Fourier spikes at T = 2, 5, 10 are universal, but linearly separable mod-T classes emerge only under aligned training conditions; multi-token addition provides one route, unlike single-token addition.
Takeaways & Limitations
Visible periodic structure can be a statistical artifact rather than functional organization, so representation diagnostics should distinguish spectral from geometric convergence.
Takeaways & Limitations
Whether the spectral-geometric dissociation extends beyond numerical representations to days, months, and other cyclic concepts remains an open next step.
Abstract
from arXiv · showhide
Language models trained on natural text learn to represent numbers using periodic features with dominant periods at $T=2, 5, 10$. In this paper, we identify a two-tiered hierarchy of these features: while Transformers, Linear RNNs, LSTMs, and classical word embeddings trained in different ways all learn features that have period-$T$ spikes in the Fourier domain, only some learn geometrically separable features that can be used to linearly classify a number mod-$T$. To explain this incongruity, we prove that Fourier domain sparsity is necessary but not sufficient for mod-$T$ geometric separability. Empirically, we investigate when model training yields geometrically separable features, finding that the data, architecture, optimizer, and tokenizer all play key roles. In particular, we identify two different routes through which models can acquire geometrically separable features: they can learn them from complementary co-occurrence signals in general language data, including text-number co-occurrence and cross-number interaction, or from multi-token (but not single-token) addition problems. Overall, our results highlight the phenomenon of convergent evolution in feature learning: A diverse range of models learn similar features from different training signals.
1 Introduction
Periodic number features appear across architectures and embedding methods, but only some systems organize them into linearly separable modular representations. The paper investigates how data, architecture, optimizer, and tokenizer shape this distinction.
- Universality of periodic features: Number representations across Transformer, non-Transformer, and classical embeddings exhibit Fourier spikes at periods T = 2, 5, and 10.The same periodic spectrum also appears in raw number-token frequencies from the training corpus.
- Spectral and geometric convergence: Fourier spikes are universal, but only some systems make residue classes n mod T linearly decodable from embeddings.The paper calls these two levels spectral convergence and geometric convergence, respectively.
- Factors shaping geometric convergence: Transformers and linear RNNs trained on large-scale language data develop linearly separable mod-T classes, whereas LSTMs can show stronger Fourier spikes yet remain at chance-level probing.The paper frames this contrast as evidence that architecture contributes to geometric convergence beyond spectral structure.
- Spectral and geometric convergence: Fourier sparsity is necessary but not sufficient for accurate mod-T probing.The paper establishes this claim theoretically and empirically, including comparisons between models with similar spectra but different probing accuracy.
- Factors shaping geometric convergence: Controlled experiments examine how data, architecture, and optimizer jointly determine whether modular classes become linearly separable.The paper describes these perturbations as structure attribution for learned representations.
- Arithmetic task pressure: Multi-token addition forces modular subproblems that produce circular representations, while single-token addition permits multiple optimizer-dependent strategies.This identifies arithmetic training as a second route to geometric convergence whose outcome depends on tokenization.
2 Related Work
Prior work connects Fourier-like and geometric structures to numerical and cyclical representations, while probing studies ask whether learned concepts are linearly accessible. This paper extends those lines by empirically attributing separable geometry to specific training conditions.
- Fourier Features: Fourier features have long been used as designed detectors or input components in vision, positional encoding, and spatial or numerical tasks.The paper situates emergent numerical Fourier structure within this broader history of Fourier-feature research.
- Mechanistic Interpretability: Mechanistic interpretability uses probing to test whether high-level concepts are linearly decodable from model representations.The related work notes that number representations are not uniformly linearly encoded across prior studies.
- Mechanistic Interpretability: Prior work finds analogous winding geometries for cyclical concepts and links them theoretically to translation symmetry in co-occurrence statistics.This paper complements that literature by testing how data, architecture, tokenization, and optimizer choices affect numerical geometry.
3 Problem Setup and Preliminary Analysis
The paper tests whether periodic structure in number embeddings supports modular arithmetic, and shows that Fourier spikes alone do not guarantee linearly separable residue classes.
- Problem Setup: Number embeddings are analyzed for periodic structure using Fourier spectra and linear probes predicting n mod T.The setup studies numbers 0 through N − 1, with N = 1000 corresponding to single-token integers in the Llama-3 tokenizer.
- Spectral Versus Geometric Structure: Fourier power is necessary but insufficient for mod-T linear probing: some systems with similar spikes classify residues well, while others remain at chance.In the controlled comparison, the Transformer and Gated DeltaNet achieve high Cohen’s κ, whereas the LSTM and raw token distribution remain at chance.
- Theorem 1: Theorem 1 shows that ΦT = 0 prevents above-chance classification, but arbitrarily large ΦT can coexist with accuracy no more than 1/T + ε.Thus, Fourier power establishes between-class variation without ensuring geometric separability.
- Theorem 1: Linear separability depends on the alignment between between-class scatter SB and within-class scatter SW, not on Fourier power alone.Highly anisotropic within-class scatter can bury periodic signal and reduce the relevant Fisher discriminant despite larger Fourier power.
- Geometric Convergence: Geometric Convergence is selective across data, architecture, and optimizer, but aligned systems achieve near-perfect mod-2, 5, and 10 probes across model scales.The reported robustness spans models from 124M to 671B parameters and includes multi-token numbers.
4 Convergent Evolution in Language Model Pretraining
Geometric convergence depends on complementary data signals, architecture, and optimizer, even though spectral convergence is widespread and largely unchanged across conditions.
- Data signals: Controlled data perturbations isolate how co-occurrence signals affect spectral and geometric convergence.The experiments vary one data factor at a time while fixing a 300M Transformer and Muon optimizer.
- Data signals: Nearly identical Fourier spectra across all perturbations show that token frequencies suffice for spectral convergence, without co-occurrence information.Unigram Replace preserves the periodic frequency distribution while destroying all co-occurrence structure.
- Data signals: Swap Numbers reduces mod-10 probing from κ = 85.4 to 28.8, showing that text-number co-occurrence contributes to geometric convergence.The metric is Cohen’s κ for balanced mod-T classes.
- Data signals: Broader context and more numbers per sequence improve probing, indicating additional contributions from longer-range co-occurrence and cross-number interaction.For mod 10, context lengths 2, 4, 8, and 64 yield κ = 40.6, 47.4, 51.7, and 72.0; Isolate-k reaches κ = 45.0, 53.0, and 77.2 for k = 1, 2, and 8.
- Architecture and optimizer: Transformers, Gated DeltaNet, and Mamba-2 achieve strong geometric convergence, whereas LSTMs remain near chance despite prominent Fourier spikes.PPMI and word2vec fall between these groups.
- Architecture and optimizer: Optimizer effects are architecture-dependent: Muon improves Transformer and Gated DeltaNet probing, while AdamW slightly improves Mamba-2.At T = 10, the reported κ values are 85.4 vs 72.1 for Transformer, 77.8 vs 69.7 for Gated DeltaNet, and 80.1 vs 76.7 for Mamba-2.
- Training dynamics: Spectral and geometric convergence increase smoothly during Transformer pretraining without a phase transition.The paper tracks both Fourier structure and probe accuracy for T = 2, 5, and 10.
5 Convergent Evolution in Training on Arithmetic
Arithmetic training produces convergent representations when multi-tokenization imposes modular subproblems, but single-token addition leaves representations seed- and optimizer-dependent.
- Experimental setup: The arithmetic experiments train 300M Transformers on masked-loss addition examples under Muon and AdamW, comparing multi-token 9-digit with single-token 3-digit addition.Each setting uses two random seeds.
- 9-digit addition: Both optimizers converge to sharp Fourier peaks and near-perfect κ for mod 2, 5, and 10 in 9-digit addition.The multi-token setting provides constraints strong enough for both spectral and geometric convergence.
- 3-digit addition: In 3-digit addition, Fourier spectra vary across optimizers and seeds while κ remains near chance for all moduli.AdamW generalizes under one seed but not the other.
- Why tokenization matters: Multi-token arithmetic creates mod-1000 classification subproblems at output positions, especially the least significant position without carry.With tied embeddings, output logits directly pressure the embedding matrix toward periodic structure.
- Numeral systems: The numeral base selects the moduli under arithmetic pressure: base 10 supports mod 2, 5, and 10, while base 15 supports mod 3, 5, and 15.Base 16 lacks the relevant coprime factorization, producing arbitrary Fourier peaks and chance-level probes.
6 Conclusion and Discussion
The paper identifies a two-tiered convergence in periodic number representations: Fourier spikes are widespread, but linearly separable mod-T classes emerge only under aligned training conditions. It also frames controlled perturbations as a way to distinguish learned representation structure from statistical artifacts and identifies extension to other cyclic concepts as an open question.
- Fourier spikes are universal, but linearly separable mod-T classes emerge only when data, architecture, and optimizer align.
- Controlled perturbations attribute learned representations to structural properties of the data distribution rather than individual training examples.
- Whether the spectral-geometric dissociation extends to days, months, and other cyclic concepts remains a natural next step.
A Proof of Theorem 1
The theorem establishes that Fourier power is necessary for above-chance mod-T classification but does not guarantee it. Its proof connects Fourier coefficients to between-class scatter and uses variance identities to derive both claims.
- If ΦT = 0, then between-class scatter SB = 0 and no linear probe can classify n mod T above chance.
- For any T ≥ 2, C > 0, and ε > 0, there exist embeddings with ΦT > C but no T-class linear classifier exceeds accuracy 1/T + ε.
- The proof connects class means to Fourier coefficients by re-indexing numbers as n = mT + r and matching the resulting sums to DFT frequencies.
- The proof derives the result using identities for between-class and within-class variance together with the rank and positive-semidefinite properties of the scatter matrices.
A.3 Insufficiency condition
The insufficiency construction separates Fourier power from linear separability by independently controlling residue-class spacing and block drift. Its bounds explain why identical spectral power can coexist with very different probing accuracy.
- In e(n) = A(n mod T) + B⌊n/T⌋, A controls Fourier power while B controls interleaving that defeats linear classifiers.
- When B > (T−1)A, sorting produces repeated residue cycles, so contiguous classifier intervals contain all classes and approach chance accuracy.
- For T = 10 and N = 1000, the construction retains the ν = 0.1 Fourier peak while best linear accuracy falls to approximately 1/T + ε with ε = 0.9%.
- The empirical token-frequency distribution likewise shows Fourier spikes while LSTM probing remains at chance for all moduli.
- The Fourier spectrum fixes ΦT, but within-class covariance direction and cond(SW) can vary, producing different generalized-eigenvalue bounds and probe accuracies.
B.3 Data Perturbation Details
The perturbation experiments vary how number tokens interact with context while preserving or disrupting different training signals. They also compare context length and architectural changes to track spectral and geometric emergence.
- Isolate-k partitions sequences into segments containing at most k number tokens, restricting cross-segment causal attention without modifying the training data.
- Fourier spikes and probing co-emerge gradually during pretraining, with both metrics increasing smoothly rather than showing a grokking-like phase transition.
- Context windows of ℓ = 2, 4, 8, and 64 restrict attention to independent subsequences, testing how broader context contributes to representation formation.
- Swap Numbers preserves text tokens and natural number n-gram statistics while replacing number subsequences with contiguous slices from other documents.
- Unigram replace independently redraws every number token from its corpus-wide marginal distribution, destroying sequential and contextual number structure while preserving token frequencies.
B.4 Training Dynamics
During language pretraining, Fourier power and linear-probe accuracy for T = 2, 5, 10 rise smoothly from the start, unlike abrupt grokking. Addition training can instead show optimizer- and seed-dependent generalization in some settings.
- Fourier power Φ_T and linear-probe accuracy for T = 2, 5, 10 increase smoothly throughout language pretraining, without a sudden phase transition.This differs from grokking in modular arithmetic, where structured representations emerge abruptly after prolonged memorization.
- 9-digit addition reaches near-perfect train and test accuracy smoothly with both Muon and AdamW, with no grokking phase.
- In 3-digit addition, AdamW groks quickly under seed 42, whereas generalization remains seed-dependent and does not grok under seed 123.Both optimizers reach 100% training accuracy under seed 42, but test performance differs.
- Only the Original pretrained model exhibits geometric convergence and learns 6-digit and 9-digit addition faster than the Unigram-Replace model.
B.5 Relation to Downstream Tasks
Spectral and geometric convergence relate to downstream arithmetic learning, while the numeral base determines which modular classes become separable. Base-10, base-15, and base-16 training produce distinct modular outcomes.
- Base-10 training learns mod-2, mod-5, and mod-10 structure, whereas base-15 training learns mod-3, mod-5, and mod-15 structure.These patterns follow the factorization of the numeral base described by the Chinese Remainder Theorem.
- Base-16 training learns neither Fourier spikes nor modular probes.
- The Original pretrained model converges much faster than Unigram Replace on both 6-digit and 9-digit addition.The comparison suggests that stronger spectral and geometric convergence is associated with better downstream performance.
B.7 Further Experiments on Effects of Tokenizers
Tokenization strongly affects whether arithmetic training yields periodic and geometrically separable number representations. Multi-token numbers support modular structure across several pretrained architectures and sequence lengths.
- The 3-digit tokenizer learns the T = 2, 5, 10 Fourier spectrum and mod-T probes, while the 6-digit single-tokenizer learns neither.For 6-digit addition, the 3-digit tokenizer splits numbers into two tokens, whereas the 6-digit tokenizer usually uses single tokens.
- Mod-2, mod-5, and mod-10 are near-perfect across eight pretrained models spanning Transformers, SSMs, and an MoE.Mod-3, mod-7, and mod-9 are mostly at chance in smaller models but become decodable with scale or newer models, reaching κ=84.4 for mod 7 and κ=92.0 for mod 9 in DeepSeek-V3.
- For multi-token numbers up to 999,999, middle-layer probes remain near-perfect on mod-2, mod-5, mod-10, and mod-100, and separability extends to mod-1000 and mod-10000.Mod-7 remains at chance, matching the single-token pattern for moduli coprime to 10.
- Circular probes project number-token embeddings onto a normalized 2-D unit circle and classify residues by cosine similarity to learned anchor directions.