r/LocalLLaMA • u/VoidRippah • 6d ago
Discussion How do you choose temperature?
I'm wondering how do you determine the temperature you your models at?
Are using a constant value or do you keep adjusting it based on something?
So overall what's you process for handling the temp setting?
7
Upvotes
4
u/misterflyer 6d ago
Trial and error.
When you work with the same model families, you get a ballpark feel for the vibe of where to set the settings. Some models are more useful at low temp, some are solid at mid temp, and others work better at high temps.
Plus, a lot of it depends on your use case (e.g., creative projects tend to work better at high temps, STEM projects tend to work pretty well at low temps).
A quick test would be to run your own custom test prompt(s) at a variety of temps to see what works best for your given use case/topic: 1.0, 0.75, 0.5, 0.3, 0.1 or whatever. Then, see which temp or temp range tends to work best over a handful of your custom test prompts.
Also, as everyone's saying... whatever the model card says tends to be the best default, or starting point.
67
u/FullstackSensei 6d ago
I read the model's recommended params and just use those.
14
u/DragonfruitIll660 6d ago
Like others are saying just using recommended samplers from the model page. If its a lower quant I might slightly lower the temps to help it out a bit.
23
u/jacek2023 llama.cpp 6d ago
Don't use recommended temperature, turn it up to make model crazy
9
u/EvolvingDior 6d ago
About the only thing I regularly mess with is repetition_penalty for highly quantized models.
2
u/jikilan_ 6d ago
Typically we don’t need to touch the temperature as per the recommended value.
3
u/Equivalent-Ear-8016 6d ago
Usa the recommended temperature by the quant or model maker. It's either 0.6 for coding or 1.0, it doesn't vary much more than that
1
u/mrazster 6d ago
I start with the modelcard. And the adjust if needed.
For agentic work and coding, I usually go lower, around 0.6, and for creative writing RP 1.0 or higher, depending on the RP.
1
u/dark_sylinc 6d ago
I use the recommended one.
However because temperature makes the model more "creative" and willing to explore more; it helps to experiment lowering temperature when doing agentic coding if the model (e.g. Qwen 3.8, looking at you) overthinks and overthinks... and keeps overthinking. I lowered the temp from 0.78 which helps reducing the token count.
On the opposite, if you're trying to do creative work and you keep getting the same output after tweaking your prompt and doing multiple passes, raise the temp.
1
u/my_name_isnt_clever 6d ago
Temp adjustment was a user-facing setting in the early LLM days, but ever since reasoning models became the norm it's best to just use whatever the model card says and worry about other things.
1
u/ag789 6d ago
lower temperature: less variance in the top p results
for coding typically I'd use lower temperature e.g. 0.3-0.6, some used 0.1 as I've seen
for some variance I tend to use 1.0 for "general"
then that it depends on your model, for some models, they simply require low temperatures or they'd give you "nonsense" results.
temp above 1, tend to degrade cause "wrong" results for a prompt
there are some papers that study this parameter
1
u/arbv 6d ago
It is usually documented.
1
u/_THiiiRD 6d ago
I've (done my best 😂) to built an open-weight PyTorch harness to test ~2/3-layer decode-only activation steering and memory isolation on different models, one feature being a steering vector that the instance itself controls (to an extent). I've noticed it's allowed me to play with temp more and still get coherent results. If you're interested I can send you the Colab link 🫶
1
u/mech-me-feel 5d ago
Using prism-ml/Ternary-Bonsai-2.5-27B-GGUF:Q2_0 at temperatur 1.3. It's chaos. I like it.
-1
u/jirka642 6d ago
Always use the recommended value. You will get subpar results otherwise.
-1
u/Salty_Hedgehog_6931 6d ago
Better off using temperature 0.0 to understand the model deterministically.