Sampling — AI Glossary

Sampling is the process of selecting the next token from the probability distribution a language model produces at each generation step. Different sampling strategies — including greedy decoding (always pick the highest probability), temperature scaling, top-p nucleus sampling, and top-k filtering — control the balance between deterministic and creative outputs. The choice of sampling method significantly affects output quality and diversity.