AI Dictionary › Fondamenti AI

Sampling

Campionamento

Definition

Sampling is how a language model chooses the next word among many possibilities. At each step the model produces not a single certain answer but a probability distribution over candidate tokens: "cat" 40%, "dog" 25%, "horse" 10% and so on. Sampling is the act of drawing from this weighted bag. It is like rolling loaded dice where likely faces appear more often, but not always. Raising or lowering randomness yields more creative, unpredictable text or more cautious, repetitive text. Techniques like top-p, top-k and temperature are all variants of how this draw is performed.

Sampling matters because it sets the character of an output: two identical calls can differ. Tuning it well separates a dull assistant from a lively one, and reliability from hallucination.

Definizione (italiano)

Il campionamento è il modo in cui un modello linguistico sceglie la parola successiva tra le tante possibili. A ogni passo il modello non produce una sola risposta certa, ma una distribuzione di probabilità su tutti i token candidati: "gatto" 40%, "cane" 25%, "cavallo" 10% e così via. Il campionamento è l'atto di pescare da questo sacchetto pesato. È come lanciare dei dadi truccati in cui le facce più probabili escono più spesso, ma non sempre. Alzando o abbassando la casualità si ottengono testi più creativi e imprevedibili oppure più prudenti e ripetitivi. Le tecniche come top-p, top-k e temperatura sono tutte varianti di come si effettua questo prelievo.

Il campionamento conta perché determina il carattere di un output: due chiamate identiche possono dare risposte diverse. Regolarlo bene è la differenza tra un assistente noioso e uno vivace, o tra affidabilità e allucinazioni.

Related terms

More in Fondamenti AI

From our network

AGORÀ Intelligence — Enterprise AI Governance Platform

Govern AI at scale: policies, adoption and measurable results on your data. Built for boards and C-suite.

Visit agora-intelligence.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.