What do temperature and top-p do at generation time?
easy- Temperature scales logits before softmax: low T (e.g., 0-0.3) makes outputs sharp and deterministic — use for factual answers and code.
- High T (0.7-1.2) makes outputs more diverse — use for creative writing.
- Top-p (nucleus) restricts sampling to the smallest set of tokens whose cumulative probability exceeds p.
- Combined: ', temperature=0.7' is a common balanced default.