Large Language Models (LLMs) present a curious paradox: they frequently fail at basic arithmetic despite possessing highly accurate internal representations of numbers. Recent research investigates this "black box" to map how models like Llama, OLMo, and Phi encode, move, and eventually misinterpret numeric information. The study reveals that LLMs across different families converge on a universal, sinusoidal language for representing numbers, and that mathematical errors are often localized to specific "broken" layers.
The Universal Language of Numbers
One of the paper's most striking findings is convergent evolution. Despite being trained on different datasets by different organizations (Meta, AllenAI, Microsoft), these models independently "discovered" the same trigonometric method for encoding numeric values. Representational Similarity Analysis (RSA) and cross-model probing show near-perfect agreement in how these models "see" numbers.
This internal language is remarkably consistent. A probe trained to extract numbers from an early layer of one model can often accurately read numbers from a much later layer in a different model. This suggests the "residual stream" in Transformer architectures acts as a consistent highway for numeric data, maintaining a stable representation as information flows through the network.
Fourier Decomposition and Sinusoidal Probes
To decode this internal language, researchers employed probes with a "sinusoidal inductive bias." This approach assumes numbers are represented as points on a circle or helix, aligning with how Fourier transforms handle periodic data. By analyzing the hidden states, the authors identified dominant "frequencies" shared across all tested models.
This sinusoidal representation allows models to implement a "superposition" algorithm for multi-token numbers. For a number like "127," the embedding for the final digit ("7") contains compressed information about the preceding digits ("1" and "2"), allowing the model to maintain the full value even when tokenized into separate pieces.
The "Broken" Layer Theory
The gap between internal knowledge and external output is significant. In division tasks, while the model's text output was often incorrect, sinusoidal probes revealed that the model held the correct result internally in 94.4% of error cases.
Errors are typically not a result of gradual noise accumulation. Instead, specific layers act as "bottlenecks" or "breakers" where the sinusoidal representation is violated. In a surgical experiment on Llama 3.2 3B, identifying and removing the three most problematic layers (layers 5, 9, and 11) resulted in an error reduction of 27–64% in division tasks without retraining the model.
Conclusion and Future Directions
While identifying and removing "broken" layers is a powerful diagnostic tool, it remains a blunt instrument that may affect general language performance. However, this work paves the way for "model steering"—using interpretability-based probes to force a model to maintain its internal "correct" representation through to the final output layer. Future research will explore how these sinusoidal patterns scale to extremely large numbers and floating-point values.
Summary updated