Although neural language models like GPT-2, trained with a maximum-likelihood objective, have achieved remarkable success, generating text directly using the "maximum probability" strategy (i.e., greedy search or beam search) produces problems such as repetition, blandness, and outputs that do not align with human expectations. Before Top-p, the common approach was Top-k sampling. The shortcoming of Top-k is that its fixed k value is inflexible: the shape of the probability distribution over tokens varies dramatically across different contexts. In some cases, only 2–3 tokens are reasonable (e.g., for the sentence "The capital of France is ___"), and k=10 would introduce many inappropriate candidates. In other cases, dozens of tokens may all be plausible (e.g., at the beginning of a story), and k=10 would overly constrain diversity.