Artificial Intelligence

Sampling Strategy

The method used to select the next token during text generation. Different strategies (greedy, top-k, top-p, temperature-based) produce different tradeoffs between quality and diversity.

Why It Matters

The sampling strategy determines the personality of your AI output — conservative and precise versus creative and surprising. Matching strategy to use case is critical.

Example

Using greedy decoding (always pick the most likely token) for factual Q&A, but top-p sampling with temperature 0.8 for creative writing.

Think of it like...

Like choosing how adventurous to be at a restaurant — always ordering the most popular dish (greedy) versus trying something new from the specials (sampling).

Related Terms