Generation, Decoding, and Hallucinations
Generation, Decoding, and Hallucinations
Key jargon
| Term | Plain-language meaning |
|---|---|
| Logit | An unnormalized score the model assigns to a possible next token. S1 |
| Temperature | A setting that reshapes the token probability distribution before sampling. S1 |
| Top-p sampling | Sampling from the smallest high-probability token set whose cumulative mass reaches a threshold. S1 |
| Hallucination | A fluent output that is false, fabricated, or unsupported by the available evidence. S1 |
Key concepts
- Generation is an iterative next-token process; decoding policy changes which continuation is selected. S1
- Grounding and verification reduce unsupported answers, but prompting alone cannot guarantee truth. S1
Concept map
flowchart LR
A["Model emits logits"] --> B["Decoder forms probabilities"]
B --> C["Select next token"]
C --> D["Verify claims and repeat"]Diagram semantics verified against S1 and S2 on 2026-09-02.
Mental model
A language model produces a probability distribution over possible next tokens. A decoding strategy selects one, appends it, and repeats. Greedy decoding, temperature, top-p sampling, beam search, and constrained decoding trade diversity, determinism, and computational cost. S1
A hallucination is an unsupported or false output presented as though grounded. It is not a single bug with one universal fix. Causes include absent knowledge, ambiguous prompts, misleading context, retrieval failure, pressure to answer, or an evaluation that rewards style over evidence. S1
Reliability ladder
- Ask whether generation is needed at all. S1
- Supply relevant, authoritative context. S1
- Require structured output when software will consume it. S1
- Validate types, citations, calculations, and permissions outside the model. S1
- Let the model abstain. S1
- Evaluate on representative failures. S1
- Require human approval for consequential decisions or effects. S1
Exercise
Ask the same factual question five times at two temperature settings. Compare wording variability with factual support. Then provide a short source passage and require sentence-level citations.
Misconception
Temperature zero improves repeatability but does not make unsupported statements true. S1