Skip to content

AI Fundamentals

Top-K Sampling

A decoding method that restricts token selection to the K most likely next tokens at each step. It is often used alongside top-p to reduce nonsensical outputs in code generation.