Top-k sampling
Top-k sampling is a probabilistic method used in natural language processing to generate text by selecting the next word from the k most likely options. It balances creativity and coherence in language models by limiting the choice to a subset of probable candidates.