AI Dictionary › Fondamenti AI

Top-k

Definition

Top-k is a sampling technique that narrows the model's options to the k most probable tokens, discarding all others before drawing. If k is 40, the model considers only the 40 highest-probability candidate words and ignores the rest of the vocabulary, however vast. It is like a bouncer who admits only the first 40 on the list and shuts the door on everyone else, regardless of how close they were. Unlike top-p, the count is fixed: always 40, whether the model is very confident or very uncertain. This makes it simple but rigid.

Top-k matters because it is a direct way to stop the model from picking absurd, very low-probability words. Its limit is rigidity: when few options dominate, 40 is too many; when many are valid, too few.

Definizione (italiano)

Il top-k è una tecnica di campionamento che restringe le opzioni del modello ai k token più probabili, scartando tutti gli altri prima di pescare. Se k vale 40, il modello considera solo le 40 parole candidate con la probabilità più alta e ignora il resto del vocabolario, per quanto vasto. È come un buttafuori che lascia entrare in un locale solo i primi 40 in lista e chiude la porta agli altri, indipendentemente da quanto siano vicini. A differenza del top-p, il numero di candidati è fisso: sempre 40, sia che il modello sia sicurissimo sia che sia molto incerto. Questo lo rende semplice ma rigido.

Il top-k conta perché è un modo diretto per evitare che il modello scelga parole assurde a bassissima probabilità. Il limite è la rigidità: quando poche opzioni dominano, 40 candidati sono troppi; quando molte sono valide, sono troppo pochi.

Related terms

More in Fondamenti AI

From our network

INDACO TMS — Transport Management for European Logistics

Shipment tracking, multi-carrier EDI and automated invoicing in one cloud platform. Invoices generated in under 10 seconds.

Visit indacotms.com →

From the Agora Intelligence blog

More on agora-intelligence.com →

📱 Download the Android app (beta) iOS coming soon

Say what you mean. Get what you need.

Grace Certified — the AI coach that trains and certifies your prompt engineering — by Agora Intelligence.