← Latest papers
💬 NLP

Categorical Perception in Large Language Model Hidden States: Structural Warping at Digit-Count Boundaries

This paper demonstrates that large language models exhibit categorical perception-like geometric warping in their hidden states at digit-count boundaries (e.g., 10 and 100), a phenomenon driven by structural tokenization discontinuities rather than semantic knowledge, which manifests as either explicit categorization or purely geometric distortion depending on the model architecture.

Original authors: Jon-Paul Cacioli

Published 2026-03-31
📖 5 min read🧠 Deep dive

Original authors: Jon-Paul Cacioli

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are looking at a long, smooth road. As you drive down it, the distance between mile markers is perfectly even. This is how a computer usually sees numbers: a smooth, continuous line where 9 is just a tiny bit smaller than 10, and 10 is just a tiny bit smaller than 11.

But this paper discovered something strange happening in the "mind" of modern AI (Large Language Models). When these AIs look at numbers, their internal map of the world suddenly warps at specific spots, just like a rubber sheet being stretched.

Here is the story of that discovery, broken down into simple concepts.

1. The "Rubber Sheet" Effect (Categorical Perception)

In human psychology, there's a famous idea called Categorical Perception. It means our brains treat things differently when they cross a "border."

  • The Analogy: Imagine a color wheel. Red and orange are right next to each other. But if you stand exactly on the line between them, your brain suddenly says, "Whoa, these are totally different colors!" even though the physical change is tiny. You can tell the difference between "Red" and "Orange" much better than you can tell the difference between two shades of Red.

The researchers found that AI models do this exact same thing with numbers, but for a very specific reason: The way the numbers are written.

2. The "Doorway" in the Code

The AI doesn't just see the value of a number; it sees the letters (tokens) that make up the number.

  • The Number 9: Written as "9". That's one character.
  • The Number 10: Written as "10". That's two characters.

To the AI, the jump from 9 to 10 isn't just a small step up in value. It's like walking through a doorway where the floor suddenly changes texture. The "doorway" is the moment a single-digit number becomes a double-digit number.

The study found that inside the AI's brain, the distance between 9 and 10 suddenly stretches out. It's as if the AI thinks 9 and 10 are much further apart than 8 and 9, even though mathematically they are the same distance. This happens again at 99 and 100 (two digits to three digits).

3. The Two Types of "AI Brains"

The researchers tested six different AI models and found two distinct types of reactions to this "doorway":

  • The "Classic" AI (Gemma, Qwen): These models act like a human. They not only have the stretched map (geometry), but they can also tell you the difference. If you ask, "Is this a single-digit or double-digit number?", they will say "Single" or "Double" with high confidence. They know the rule.
  • The "Structural" AI (Llama, Mistral, Phi): These models have the stretched map, but they can't tell you the rule. If you ask them the same question, they might guess randomly or get confused.
    • The Metaphor: Imagine a person who has a perfect internal GPS that shows a huge canyon between 9 and 10. But if you ask them, "Is there a canyon here?" they shrug and say, "I don't know." They feel the difference in their "bones" (the math inside them), but they can't speak about it.

This is a huge discovery: You can have the geometric shape of a category without actually knowing the category exists.

4. The "Hot vs. Cold" Test

To prove this wasn't just about numbers, the researchers tested the AI with temperature.

  • We have words for "Hot" and "Cold." There is a boundary (around 22°C / 72°F) where things switch from cold to hot.
  • The Result: The AI did not stretch its map at this boundary. Why? Because the word "21" and "23" look the same to the AI's tokenizer (the part that breaks text into pieces). There is no "doorway" in the code.
  • The Lesson: The AI isn't stretching the map because it learned that 10 is special. It's stretching it because the format of the input changed (from one digit to two). The "shape" of the data forces the brain to warp.

5. The "Early vs. Late" Layers (The Hidden Work)

AI models have many layers of processing, like floors in a skyscraper.

  • The Top Floors: This is where the AI's internal map looks the most "stretched" and clear. It's the most legible.
  • The Basement: This is where the actual work happens.
  • The Twist: The researchers tried to "poke" the AI's brain at different floors. When they poked the top floors (where the map looked best), nothing happened. But when they poked the basement (early layers), the AI's behavior changed instantly.
  • The Metaphor: It's like looking at a finished painting. The painting looks perfect on the canvas (the top layer). But the artist didn't paint the final strokes there; they did the heavy lifting on the sketchpad in the basement. The "visible" part of the AI's brain isn't where the thinking is actually happening.

Summary: What Does This Mean?

  1. Format is King: AI models create "categories" (like single-digit vs. double-digit) just because the way we write numbers changes format. They don't need to "learn" math to do this; the structure of the text forces their brain to warp.
  2. Feeling vs. Knowing: An AI can have a deep, structural understanding of a boundary (feeling the stretch) without being able to explain it (knowing the rule).
  3. Look Deeper: Just because a part of an AI's brain looks "smart" or "clear" doesn't mean it's doing the work. The real magic often happens in the messy, early layers.

In short, this paper shows that how we write things down changes how machines think about them, creating invisible "walls" in their minds that separate numbers, even if the machine doesn't realize it's doing so.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →