top-k sampling

top-k sampling

/ˌtɒp ˈkeɪ ˌsæmplɪŋ/

Generative AI

Limiting word choices to the k most likely options

Top-k sampling prevents the model from choosing unlikely tokens.

Origin: Modern English compound; top (highest) + k (mathematical variable) + sample from Latin exemplum