Skip to content

What does temperature mean in AI code generation?

Temperature controls how "creative" or random the model's output is. A temperature of 0 makes the model deterministic — it always picks the most probable token — which is ideal for code generation where correctness matters. Higher temperatures (0.7–1.0) introduce more variation, useful for brainstorming but risky for generating compilable code.