thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

AI & Machine Learning · Intermediate

Top-k Sampling

Sampling the next token only from the k most probable candidates.

Definition

Top-k removes the long tail of unlikely tokens. A small k yields conservative text; k=1 equals greedy decoding.

Exam tip

Top-k uses a fixed number of candidates; top-p adapts the number to the probability mass.

Related terms