A continuaciónSiguiente guía
Muestreo típico
Idioma IA
GUÍA de IA en idiomas
Top-k and nucleus (top-p) sampling are stochastic decoding methods that truncate a model’s next-token distribution before drawing a token.
Escuche esta guíaNarrado por IA · ~2 min
Temperature rescales logits and changes distribution sharpness; none of these settings guarantees factual accuracy.
Holtzman et al. identify a gap between likelihood training and open-ended generation: likelihood-maximizing decoding can produce bland and repetitive text in their experiments. Nucleus sampling retains a dynamic set of tokens containing most probability mass and samples from it, trimming the unreliable tail. Top-k instead fixes the number of candidates. Later analysis explains properties and limitations of truncation heuristics; their findings are scoped to the studied models and tasks. For a no-sampling baseline, greedy decoding selects the highest-scoring next token directly. This removes token-sampling randomness for a fixed model and input; it does not guarantee correct code, and deployment-level reproducibility can also depend on system details.
Top-k keeps a fixed number of high-probability tokens at a step.
Top-p keeps the smallest probability-ranked set whose cumulative mass reaches the chosen threshold.
Temperature changes the relative sharpness of the distribution before sampling.
When evaluating open-ended outputs, compare decoding settings on diversity, coherence and repetition rather than assuming one setting is best.
Choose decoding settings by task-specific evaluation and record the model, prompt and sampling parameters for reproducibility. Assess diversity and coherence alongside task success. The cited papers do not establish a universal default or guarantee that sampling prevents repetition or errors.
Boletín gratuito
Tres noticias verificadas sobre IA cada mañana de lunes a viernes, explicadas con claridad. Gratis para siempre y sin anuncios.
Un correo cada día laborable. Date de baja con un clic. Nunca vendemos ni compartimos tu dirección.
Ponte a prueba
Corrección inmediata en cada respuesta y un certificado para compartir, con un ID verificable, cuando apruebas un curso.
Apoya la educación gratuita sobre IA. AI Understanding es una organización sin fines de lucro 501(c)(3): sin anuncios ni muros de pago, nunca. Hacer una donación
Top-k and nucleus (top-p) sampling are stochastic decoding methods that truncate a model’s next-token distribution before drawing a token. Temperature rescales logits and changes distribution sharpness; none of these settings guarantees factual accuracy.
Top-k trunca la distribución a un número fijo k de los tokens más probables, los renormaliza y toma muestras de ellos.
Top-p mantiene el grupo más pequeño de tokens superiores cuya probabilidad acumulada alcanza el umbral p, luego realiza muestras entre ellos.
El conjunto de candidatos de top-p se reduce cuando el modelo tiene confianza y crece cuando es incierto, a diferencia del recuento fijo de top-k.
La temperatura más baja concentra la probabilidad en las fichas superiores (más determinista); una temperatura más alta lo aplana (más diverso).
Holtzman et al. report that sampling from the dynamic nucleus produced more diverse generations while retaining fluency and coherence in their evaluated setups; this is not a universal guarantee.
sigue aprendiendo
Más guías seleccionadas para este tema.
A continuaciónSiguiente guía
Muestreo típico
Idioma IA