QUESTION 4 OF 10

How does top-k sampling constrain generation?

Reveal the answer and explore the explanation.

04
MediumHigh priority

How does top-k sampling constrain generation?

Answer
Answer

Restricts sampling to the k highest-probability tokens.

Practical example

Avoid drawing from very low-ranked candidate tokens.

Reference: Further reading ↗

Last 30 min revisionHigh-yield interview Q&As