A prompt is generating repetitive, predictable text. Which inference parameter samples only from the smallest set of tokens covering a cumulative probability mass — adding controlled diversity?
A.top-p (nucleus sampling)
Probability-mass sampling = top-p. Correct.
B.max_tokens
max_tokens limits output length — not diversity.
C.stop_sequences
Stop sequences end generation — unrelated to token diversity.
D.model weight decay
Weight decay is a TRAINING regularizer — not an inference param.
Why this answer
top-p (nucleus sampling) restricts token selection to the smallest pool whose cumulative probability exceeds p — a dynamic cutoff that adapts diversity. temperature scales randomness; top-k is a fixed count; max_tokens/stop_sequences control length.
Correct answer: A · Last reviewed 2026-11-05
Official AWS references
Practice this interactively
Answer without seeing the solution first in the Generative AI Concepts practice session.
Practice Generative AI Concepts