TL;DR
Large Language Models (LLMs) from entirely different families independently converge on a nearly identical, universal sinusoidal representation for numbers across their internal layers. By exploiting this periodic structure, researchers developed a specialized probe that can accurately track numeric processing, decode multi-token numbers, and even steer internal activations to fix arithmetic errors on the fly.
What Problem Does This Paper Address?
Despite the empirical success of LLMs in tackling math problems, their mathematical reasoning remains notoriously brittle. To make these models more reliable, we need to understand how they internally represent and manipulate numeric information.
Prior work dropped hints that numbers evoke periodic, wave-like patterns in model embeddings. However, these studies were highly constrained—focusing only on isolated tokens, synthetic math contexts, or single model families. Crucially, standard general-purpose interpretability tools (like TunedLens) assume linear representations, which fail to capture the periodic nature of numbers. This paper addresses these gaps by asking: Is this sinusoidal structure truly universal across different model families and layers, and can we use this knowledge to better understand and improve LLM arithmetic?
Methods
The authors explore the geometry of numbers in LLMs using a mix of similarity analysis, custom probing, and mechanistic interventions:
- Representational Similarity Analysis (RSA) & Fourier Decomposition: Used to compare the mathematical topology and dominant frequencies of number embeddings across diverse model families (including Llama 3, OLMo 2, and Phi 4).
- Parametric Sinusoidal Probing (
param-sin): The authors introduce a novel probe that strictly constrains the classification matrix to a set of learnable sine waves. By optimizing the frequency, amplitude, and phase-shift of each wave, the probe acts as a highly accurate mathematical "lens" tailored to periodic data. - Activation Steering: To prove a causal link between sinusoidal precision and output accuracy, the authors design "patch" embeddings that fit the expected sinusoidal pattern. They then interpolate these patches into the model's hidden states to correct unfolding arithmetic errors.
Datasets
Unlike previous work relying on synthetic templates, this study extracts representations from natural language contexts across ~700,000 samples spanning four domains:
- Culinary: Recipe NLG Lite, FoodRecipe-ImageCaptioning
- Temporal: TimeLineExtraction
- Arithmetic: MetaMathQA, DROP, AQuA-RAT
- Medical: ICD-10 Codes, ICD-10-CM
For testing multi-token numbers, they utilize a subset of recent BBC News data published after the models' respective knowledge cutoff dates.
Key Insights and Ideas
- Universal Convergence: LLMs of completely different sizes and architectures independently discover the exact same dominant frequencies to represent numbers. This shared topology suggests that sinusoidal representation is a causal consequence of optimization, not a random artifact.
- Cross-Layer Interchangeability: This sinusoidal structure isn't just an input quirk; it is preserved systematically throughout the model's intermediate layers, largely sustained by the residual stream. A probe trained on one layer can successfully decode numbers from an entirely different layer.
- The Superposition of Multi-Token Numbers: When dealing with large numbers (e.g., 1,234,567), the model superposes previous digits into the activation space of the last token.
- General Tools Blindspot: General-purpose linear interpretability tools like TunedLens drastically underestimate how much numeric information is retained in hidden states because they fail to account for this wave-like superposition.
Key Results
- High-Accuracy Decoding: The specialized
param-sinprobe achieves over 80–90% accuracy in decoding numeric values from internal layers across all tested models.
- Unraveling Multi-Token Digits: The sinusoidal probe successfully extracts preceding tokens from a single trailing token representation with up to 99% accuracy for the immediate predecessor, vastly outperforming TunedLens.
- Mechanistic Error Correction: By steering internal activations toward the clean sinusoidal pattern during incorrect arithmetic runs, the authors successfully corrected up to 30% of errors in multiplication and up to 42% of errors in division.
- Generalization to Ordinal Data: The same sinusoidal properties apply to other circular, ordinal concepts. The probe achieved high validation accuracy decoding days of the week and months of the year, even when trained on tiny datasets ($n=7$ and $n=12$).
Limitations and Future Work
- Scale and Language Scope: The study was limited to English-centric models under 30B parameters. How these periodic structures manifest in frontier-scale models or languages with myriad-based number systems (like Chinese or Japanese) remains an open question.
- The "Zero" Blind Spot: The probe consistently struggles with the first position of ordinal sequences (e.g., Monday, January). The authors suspect that a zero value acts as a geometric blind spot due to the current probe parameterization, which will need to be addressed in future iterations.
Summary updated