Practice

Sampling settings

A starting point

{\n  "temperature": 0.35,\n  "top_p": 0.75,\n  "max_tokens": 4000,\n  "frequency_penalty": 0.3,\n  "presence_penalty": 0.3\n}
  • Temperature 0.3–0.5 — direct, still coherent
  • Top-p ≤ 0.8 — less wandering
  • Frequency penalty 0.2–0.4 — less repeated scolding
  • Presence penalty 0.2–0.4 — keep new points arriving
TaskTemperatureNote
Code0.3Precision
Creative draft0.45Or use a dream, then verify
Urgent0.35Raise presence penalty toward 0.5

Quiz

What temperature does the lesson recommend for code?

Back to chapter
Next