Module 8 · LLM Concepts · Lesson 18 of 34

Generation settings, limits and choosing a model

Temperature and top-p, hallucination, knowledge cut-offs, reasoning models and how to pick one.

In this lesson · about 20 minutes

  • Choose temperature and top-p for a task
  • Explain why models hallucinate and how to reduce it
  • Pick a model by weighing quality, speed, cost and context size

At each step the model produces a score for every token; softmax turns those scores into probabilities. Two settings shape the choice:

  • Temperature divides the scores before softmax. Below 1 sharpens the distribution (the favourite wins more often); above 1 flattens it (long shots get a chance).
  • Top-p (nucleus sampling) keeps only the most likely tokens whose probabilities add up to p, then picks among those. It cuts off the unlikely tail.

Use low temperature for extraction, classification, code and anything that must be consistent; moderate for chat; higher for brainstorming and creative variety. Change one setting at a time. Some newer models fix these values themselves, so check your provider's guidance.

Try it · simulator

Temperature and top-p, up close

Start from “The model”. Set top-p to 0.6 and watch tokens get cut; then raise the temperature and see the bars flatten.

The cat▍

Next-token probabilities after “cat”

sat50%
slept30%
purred17%
coded3%
A real model does exactly this, one token at a time, but scores about 100,000 possible tokens at every step using everything written so far, not just the last word. Try temperature 0.1 and press Finish a few times (almost always the same sentence), then 2.0 (odd choices like “cat coded”).

Choosing a model

Providers usually offer a family: a large, most capable model; a mid-size all-rounder; and a small, fast, cheap one. Many also offer reasoning (or "thinking") modes that spend extra tokens working through a problem before answering: slower and pricier, much better on hard multi-step problems.

NeedUsually pick
Routing, tagging, short extraction at high volumeSmall, fast model
Everyday chat, summaries, RAG answersMid-size model
Complex coding, analysis, agents with many stepsLargest model, often with reasoning
Data that must stay on your own serversAn open-weight model you host

Do not guess: build a small evaluation set (Module 9) and try two or three models on it. The cheapest model that passes is the right one.

Sorting drill

Low or high temperature?

Which setting suits each task?

  • Pull invoice totals into JSON
  • Classify tickets into 6 categories
  • Friendly help-desk replies
  • Brainstorm 30 product names
  • Generate SQL from a question

0 of 5 sorted

Check your understanding0 of 3 correct

Question 1

1.With top-p = 0.9, which tokens can be chosen?

Question 2

2.A model cites a research paper that does not exist. What is this called, and the best fix?

Question 3

3.How should you choose between three models for your app?

Pick the model settings for your project.

Consider these questions and write down your thoughts. What you write stays on this device.

Quiz score: 0 of 3

Tip: answer every quiz question correctly first.

Written by Noviq Academy in its own words. The simulators are small teaching models that keep the real idea and leave out the scale; their numbers (prices, speeds, scores) are illustrative. Model names, prices and features change quickly, so check your provider's current documentation before you build. Read-aloud uses your device's built-in voices.