New Tool Radar

AI Concepts

How to Set a Low Temperature for Factual Answers

Turn the temperature down for factual answers, so the model picks the most likely wording instead of an inventive one.

Schematic illustration with three step boxes: learn what temperature does, set it low for facts, and check the answers.

Temperature controls the randomness of sampling: lower values make the model more deterministic, higher values make it more random, and 0 gives greedy sampling. For factual answers, a low temperature keeps the model on the most likely tokens, which is where the facts usually are. The NVIDIA sampling reference lists the default temperature as 1.0, which is too high for a factual task.

Before you start

An API or local inference setup where you can set the temperature, and a set of factual questions with known answers.

Learn what temperature does

Temperature reshapes the token probabilities before sampling: a low temperature sharpens the distribution so the top token wins almost every time, while a high temperature flattens it so unlikely tokens get picked more often.

A temperature of 0 means greedy decoding: the model always picks the most likely next token. That is the most predictable setting, and the right starting point for facts.

Set it low for factual work

Set the temperature to 0 or 0.1 for factual questions, data extraction and summaries that must stay faithful to a source. Published guidance puts math and logic at 0.0 to 0.2 and code at 0.1 to 0.3.

Do not set a high temperature and hope the facts survive: creativity helps brainstorming, not a refund policy.

Check the answers, not the setting

Run the same 20 factual questions at temperature 0 and at temperature 1.0, and count the correct answers at each. If the low setting wins, keep it; if both tie, keep the low one anyway, because it is more stable across runs.

Record the setting with the test date and the model name, so a later change can be compared.

Practice check: fictional Maple Corner factual set, 20 questions

The table below is fictional practice material, worked out by hand from the stated settings. It is the expected result for the practice set, not a run of any model.

Temperature Correct answers Different answers on repeat Verdict
0.0 18 of 20 0 of 20 Pass – stable and accurate
0.7 16 of 20 6 of 20 Pass, less stable
1.2 12 of 20 14 of 20 Fail – too random

Temperature 0 answers 18 of 20 and never changes on repeat, while 1.2 answers only 12 and changes on 14 of 20 repeats. Low temperature wins on accuracy and on stability.

Expected result. UNTESTED: the scores in the practice table are worked out by hand, not measured by running a model. Run your own 20 factual questions at temperature 0 and 1.0, count the correct answers, and repeat a few to check stability.

Limits

  • Temperature 0 is deterministic for one model and one version, not across model versions or providers.
  • Low temperature does not make the model truthful: it makes it consistent, and a consistently wrong answer is still wrong.

Sources

See all