Temperature and sampling: why the same prompt gives different code

Lesson 5 of how the AI thinks: the model picks each next token from a list of likely options. Temperature decides how adventurous that pick is, and…

Aliteq
Sam Ortega · Build Editor

You now understand

The model samples each next token from likely options

You now understand

Temperature controls how adventurous that sampling is

You now understand

Even the lowest setting isn't fully repeatable, and newer Claude models fix it at 1.0

What this means for your app

Asking your AI tool to build the same thing twice will give two different versions. That's normal, not a bug. Don't assume a re-run reproduces a fix. Review what actually changed, and keep the…

Aliteq

Read the full story

Temperature and sampling: why the same prompt gives different code

Read the full story on Aliteq