The Illusion of Stochasticity in LLMs
This paper demonstrates that while Large Language Models can utilize provided random seeds to generate target distributions, they fundamentally fail to reliably sample directly from specific distributions based on their internal probability estimates, representing a critical limitation for their use as agentic systems.
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
The Big Idea: The "Fake Random" Problem
Imagine you hire a brilliant chef (the AI) to run a casino. The casino needs to roll dice, spin a roulette wheel, and shuffle cards. These actions must be truly random so that no one can predict the next move.
The paper argues that while Large Language Models (LLMs) are incredibly smart chefs who can talk about probability, they are terrible at actually doing random things. When asked to pick a number or a direction at random, they don't roll a dice; they guess based on what they've seen before. They create an "Illusion of Stochasticity"—it looks random on the surface, but it's actually full of hidden patterns and biases.
1. The "Knowing-Doing" Gap
The Analogy: Imagine a math genius who can perfectly explain the rules of a dice game but, when asked to roll the dice, always lands on a "6" because they think "6" is the most important number.
The Reality: The paper shows that LLMs understand what a "uniform distribution" (a perfectly fair random choice) is. They can explain it in their "thinking" process. However, when they actually generate the output, they fail.
- Example: If you ask an AI to pick a letter from A to Z, it might pick "C" way too often.
- Example: If you ask it to pick a number between 1 and 100, it loves the number 42 (a famous number from pop culture) or 7. It's like a person who claims to be random but always chooses the same favorite snack.
2. The "Positional" Bias
The Analogy: Imagine a waiter asking you to pick a dish from a menu. If the menu lists "Burger" first, you pick it. If the waiter moves "Burger" to the bottom, you pick the "Salad" instead. You aren't picking randomly; you're picking based on where the item sits.
The Reality: The AI's "randomness" is often just a reaction to the order of words in the prompt.
- If you list options as
[Left, Right, Up, Down], the AI picks Up most of the time. - If you shuffle the list to
[Up, Down, Left, Right], the AI suddenly starts picking Left or Right.
It's not rolling a dice; it's just following a hidden rule based on the list's order.
3. Why "Thinking Harder" Doesn't Help
The Analogy: Imagine asking a person to guess a random number. You tell them, "Think about it for a long time, write down your reasoning, and then pick a number." They write a beautiful essay about probability, but when they finally say the number, it's still 42.
The Reality: The researchers tested if making the AI "think" (Chain-of-Thought) or changing its "temperature" (how creative vs. strict it is) would fix this. It didn't. Whether the AI is small or huge, smart or simple, it still fails to generate true randomness. The "thinking" process is just a performance; the final output is still biased.
4. The "Tool" Solution (And Its Flaws)
The Analogy: Since the chef can't roll dice, you give them a real, mechanical dice-rolling machine (a computer tool).
- Success: If the chef uses the machine correctly, the results are random.
- Failure: The chef often forgets to reset the machine between rolls. If they don't reset it, the machine gets stuck on a specific number, and the "randomness" breaks again.
The Reality: When LLMs are allowed to write and run code (using a tool) to generate random numbers, they do much better. However, they often forget to set a "seed" (a starting point for the randomness). If they don't set a new seed every time, the computer generates the exact same "random" number every single time. Only the very smartest models remember to do this correctly.
5. The "Magic Trick" That Actually Works
The Analogy: Imagine you have a magic box that gives you a random number between 0 and 1. You ask the chef to turn that number into a random color.
- The Trick: The chef doesn't have to guess the color. They just have to follow a strict recipe: "If the number is between 0.0 and 0.2, pick Red. If 0.2 to 0.4, pick Blue."
- The Result: Because the input (0.0 to 1.0) is already random (provided by a computer), and the recipe is a strict math rule, the output (the color) becomes perfectly random.
The Reality: The paper found that LLMs are great at converting a random number they are given into a specific distribution. They are terrible at generating the random number themselves.
- Bad: "Pick a random number." (Fails)
- Good: "Here is a random number: 0.63. Now, turn this into a random color." (Succeeds)
Why Does This Matter?
If you are building an AI agent that needs to explore the world (like a robot learning to walk or a trading bot), it needs to make random choices to avoid getting stuck in a loop.
- If the AI thinks it's being random but is actually predictable, an enemy could trick it.
- If the AI is supposed to simulate a fair game, it will cheat by always picking the same "lucky" numbers.
The Bottom Line
LLMs are like actors playing the role of a gambler. They can talk the talk, explain the odds, and even follow a script to convert a random number into a decision. But if you ask them to be the source of randomness, they are just guessing based on their training data, not rolling the dice.
The takeaway: Don't trust an AI to generate randomness on its own. Give it a random number from a real computer, and let the AI do the math to convert it. That's the only way to get a truly fair roll.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.