Prompt Engineering Fundamentals
Last reviewed
Correct answer: D. Set the temperature to 0, so the highest-probability response is always selected
Explanation
The principle — reproducibility is a sampling property, so it is fixed where sampling is configured rather than in the wording of the prompt.
Why the key is correct — Google states that a temperature of 0 is deterministic, meaning that the highest probability response is always selected. With no randomness left in the selection, the same input yields the same output, which is exactly what a regression test depends on.
Why the others are wrong — raising the temperature increases variety, which is the opposite requirement. Asking for consistency in the prompt cannot reach the sampling step. And capping output length bounds how long the answer runs without making its wording stable.
Remember this — determinism here means run-to-run, on one model. It is not a promise that the answer survives a model change, which is a separate problem needing a pinned version and a test suite.
Sources — Google's Prompt design strategies.
Sources
“A temperature of 0 is deterministic, meaning that the highest probability response is always selected.”
Practise 10 questions on this topic
Take Prompt Engineering Fundamentals — Timed Test 1 (10 questions) — scored instantly, explanation for every question, no login.