0:00
/
0:00

Tip #12 Temperature Isn’t Always Constant—Except When It Is

The teachable power of hyperparameters...

Recently, I’ve been learning how to run local AI models and tweak them using Python. It’s been a rewarding challenge for my brain. Learning to configure models, control outputs, and understand how a few lines of code can completely reshape the way an AI behaves.

One of the first things I came across was something called temperature. Not the weather kind but a hyperparameter that controls how random or predictable the model’s responses are.

Set it to 0.2 and you get safe, stable, predictable output. The AI sticks to the most probable words. This temperature is perfect for instructions, summaries, or technical writing. Set it to 1.2, and suddenly it starts taking creative leaps. New phrasings. Surprising ideas. Sometimes brilliant. Sometimes unusable. But always different.

And here’s what clicked for me: this is exactly the kind of thing we should be teaching in CS classes not just for AI, but for helping students understand constants and hyperparameters in real-world code.

Temperature is a constant. It’s a value you set before a model runs. It doesn’t change during execution. And that constant fundamentally shifts how the system behaves. Just like we teach students to define PI = 3.14159, we can teach them to define temperature = 0.7 and explain how that choice affects creativity, structure, or precision in output.

Most students will never get excited about the word hyperparameter. But they will get curious when they change one value and suddenly the AI’s personality shifts.

It’s not just about randomness. It’s about control. About design. About structure. And that’s the kind of thinking we want students to internalize not just to be users of AI, but builders, tuners, and thinkers who understand how systems work under the hood.

We talk a lot about teaching computational thinking, but this is what it looks like in practice: taking one small constant and using it to open up a conversation about agency in code.

So the next time you are teaching your students about variables and constants don’t just call it syntax. Call it a choice and explain to them about variability in AI models. That’s where the learning happens.