DiffSampling: Enhancing Diversity and Accuracy in Neural Text Generation

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Franceschelli, Giorgio, Musolesi, Mirco
Natura: Preprint
Pubblicazione: 2025
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866909990047973376
author Franceschelli, Giorgio
Musolesi, Mirco
author_facet Franceschelli, Giorgio
Musolesi, Mirco
contents Despite their growing capabilities, language models still frequently reproduce content from their training data, generate repetitive text, and favor common grammatical patterns and vocabulary. A possible cause is the decoding strategy: the most common strategies either consider only the most probable tokens, which reduces output diversity, or increase the likelihood of unlikely tokens, compromising output accuracy and correctness. In this paper, we propose DiffSampling, a new decoding method that leverages a mathematical analysis of the token probability distribution to ensure the generation of contextually appropriate text. In particular, the difference between consecutive, sorted probabilities can be used to truncate incorrect tokens. In addition, we also propose two variations of the proposed method that aim to correct the subtle inconsistencies of common sampling strategies. Experiments involving four different text-generation tasks demonstrate that our approach consistently performs at least on par with the existing methods it builds upon in terms of quality, despite sampling from a larger set of tokens.
format Preprint
id arxiv_https___arxiv_org_abs_2502_14037
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle DiffSampling: Enhancing Diversity and Accuracy in Neural Text Generation
Franceschelli, Giorgio
Musolesi, Mirco
Computation and Language
Artificial Intelligence
Machine Learning
Despite their growing capabilities, language models still frequently reproduce content from their training data, generate repetitive text, and favor common grammatical patterns and vocabulary. A possible cause is the decoding strategy: the most common strategies either consider only the most probable tokens, which reduces output diversity, or increase the likelihood of unlikely tokens, compromising output accuracy and correctness. In this paper, we propose DiffSampling, a new decoding method that leverages a mathematical analysis of the token probability distribution to ensure the generation of contextually appropriate text. In particular, the difference between consecutive, sorted probabilities can be used to truncate incorrect tokens. In addition, we also propose two variations of the proposed method that aim to correct the subtle inconsistencies of common sampling strategies. Experiments involving four different text-generation tasks demonstrate that our approach consistently performs at least on par with the existing methods it builds upon in terms of quality, despite sampling from a larger set of tokens.
title DiffSampling: Enhancing Diversity and Accuracy in Neural Text Generation
topic Computation and Language
Artificial Intelligence
Machine Learning
url https://arxiv.org/abs/2502.14037