Why AI Models Love The Number 27
The Curious Case of the Number 27
Go ahead, try it. Ask your favorite AI chatbot to "guess a number between 1 and 50." There's a surprisingly high chance it will answer: 27.
This isn't just a fluke. In a simple test, major players like OpenAI's ChatGPT, Google's Gemini 2.5 Flash, Anthropic's Claude Sonnet 4, and Meta's Llama 4 all converged on this single number. This peculiar trend has been noted by various users online and highlighted by data scientist Mohd Faraaz, who found that six out of seven models he tested chose 27.
The one outlier in his test? Grok, which responded with 42, a nod to its famous role in Douglas Adams' "The Hitchhiker’s Guide to the Galaxy" as the answer to life, the universe, and everything. But for the most part, 27 seems to be the crowd favorite among the leading AI models.
Why Not 42? Unpacking AI Bias
Before you start looking for a hidden conspiracy, the answer is much more grounded in how these models work. There's no backroom deal between AIs; the consistency comes from shared training data and the fundamental way large language models (LLMs) predict the next "token" (a word or piece of a word) in a sequence.
This lack of randomness is, by its very nature, a form of bias. It's a powerful reminder that LLMs are not capable of making truly unbiased decisions on their own. They are reflecting the patterns, preferences, and quirks present in the vast amounts of human-generated text they were trained on.
When asked to explain its choice, Claude offered a fascinating, almost human-like justification:
I picked 27 somewhat randomly, but if I'm being honest, it felt like a good "middle-ish" choice that wasn't too obvious. Numbers like 25 (exactly halfway) or 1 and 50 (the extremes) seemed too predictable. 27 is close to the middle but has a bit of asymmetry to it - it's not perfectly centered, which somehow felt more natural for a guess.
Plus, people often avoid round numbers when they're thinking of "random" numbers, so I steered away from multiples of 5 or 10. Was I anywhere close to your number?
This response perfectly illustrates the learned human psychology of "randomness"—we tend to pick numbers that feel random, not ones that are mathematically random.
The Illusion of Randomness in LLMs
Those surprised by this predictable behavior might expect an AI to generate a truly random number. However, genuine randomness is a complex technical challenge. It requires either specialized hardware or software with access to a source of entropy, which is essentially a measure of unpredictability.
An AI model with tool-use capabilities could execute a line of code like Math.floor(Math.random() * 50) + 1;
to produce a pseudo-random number. But left to its own devices, an LLM simply predicts the most probable answer based on its training.
Daniel Kang, an assistant professor at the University of Illinois Urbana-Champaign, explains that several factors are at play: the training data, the sampling mechanism, and the Reinforcement Learning from Human Feedback (RLHF) process. Kang notes that RLHF is suspected of causing "mode collapse," a phenomenon where the model's variety of responses narrows, causing it to repeatedly favor a few specific outputs.
More Than Just a Number: Widespread AI Predictability
This isn't just about picking 27. Research shows that this deterministic behavior is a widespread trait of LLMs. In a recent paper titled "Deterministic or probabilistic? The psychology of LLMs as random number generators," data scientist Javier Coronado-Blázquez found that LLMs consistently favor certain numbers across various ranges.
His extensive testing of multiple models revealed clear preferences:
- Range 1-10: The number 7 was chosen about 80% of the time by models like GPT-4o-mini and Gemini 2.0.
- Range 1-100: Numbers 37, 47, and 73 were the most popular choices. Interestingly, most of the preferred numbers are prime.
Coronado-Blázquez concludes that "large models, such as GPT and Gemini are often regarded as more imaginative and creative; nevertheless, we found that these are as deterministic and biased as their smaller competitors, if not more."
This conclusion is further supported by other work on AI bias. A 2024 study from Cornell computer scientists explored how poorly models like GPT-4 and Llama 3 handle generating fair coin flips. Their paper argues that "machines have not only learned human biases in their dealing with randomness, but they have exacerbated this bias to be worse than humans."
Ultimately, this failure to produce randomness is a very human-like trait. But it also exposes a key limitation of AI: if you need a tool to help you be truly random, an LLM might be the wrong choice, as it's already an expert at failing to be random, just like us.