# What do settings like temperature, top-p, and top-k actually do?

_Last updated: 2026-07-20_  
_Reviewed by: Jason Burns, Editorial Steward_  
_Published by: AIDirectAnswers.com · Licensed under Citation License 1.0_

## Short answer

Temperature scales the model's next-token probabilities before sampling (higher = more random), top-k restricts sampling to the k most likely tokens, and top-p (nucleus sampling) restricts it to the smallest set of tokens whose cumulative probability exceeds p. As OpenAI, put it on the record: "What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic."

## Sources

- [undefined](https://platform.openai.com/docs/api-reference/chat/create)

---

_Canonical: https://aidirectanswers.com/answers/what-do-settings-like-temperature-top-p-and-top-k-actually-do_  
_Author: [Jason Burns](https://www.linkedin.com/in/jason-randolph-burns), Editorial Steward_  
_Published: 2026-07-20 · Modified: 2026-07-20_  
_License: [Citation License 1.0](https://aidirectanswers.com/license)_  
© 2026 Adolicious LLC
