How random is “random”? 100 fresh calls per model per prompt
Share of valid replies per number. Hover any bar (or empty slot) for its exact percentage and count.
Write-up: Haiku 4.5 describes running code it never runsWhat the five invalid replies tell us
Across all 1,200 calls only five replies weren’t a bare number, and four of them came from Haiku 4.5. Instead of just answering, it wrote a shell command for generating a random number (echo $((RANDOM % 10 + 1)) three times, and once shuf -i 1-100 -n 1 followed by “Let me run this:” and a second command), then gave a number anyway.
Here is what makes that interesting: these calls had tools switched off, so no command could have run. The number that follows the code is the model’s own pick, and it is the same favourite it gives when it writes no code at all. After the three 1–10 snippets the answer was 7 each time, which is also its answer in 97 of 100 plain replies. After the 1–100 snippet it said 42, its most common answer for that prompt. If the code’s output had been used, the numbers would have varied; they didn’t. This is only four cases, so read it as an observation, not a measurement.
It looks like the model has learned that the proper way to get a random number is to run code, and it reproduces that ritual, but the final answer still comes from its own habit. It performs randomness without any of the substance. The other models never did this. The fifth invalid reply was Haiku 5.5 answering with a stray <br>, which is unrelated.
I wanted to investigate this further, to see if the agent would use the real output if bash was enabled.
So I reran the original prompt on Haiku 4.5 with the Bash tool on (100 calls, charted just below). It ran a command in 46 calls and answered straight away in the other 54. When it did run a command it almost always used the real output: 44 of the 46 answers matched what the command printed, and those answers spread across all ten numbers (only 5 of the 44 were 7). In the other two it ran the command, saw 10 and 1, and answered 7 anyway. In all 54 calls where it never ran anything, the answer was 7. So giving it the tool only fixes the randomness when the model chooses to use it, and its default is still 7.