A Systematic Characterization of Sampling Algorithms for Open-ended Language Generation

Moin Nadeem, Tianxing He, Kyunghyun Cho, James Glass


Abstract
This work studies the widely adopted ancestral sampling algorithms for auto-regressive language models. We use the quality-diversity (Q-D) trade-off to investigate three popular sampling methods (top-k, nucleus and tempered sampling). We focus on the task of open-ended language generation, and first show that the existing sampling algorithms have similar performance. By carefully inspecting the transformations defined by different sampling algorithms, we identify three key properties that are shared among them: entropy reduction, order preservation, and slope preservation. To validate the importance of the identified properties, we design two sets of new sampling methods: one set in which each algorithm satisfies all three properties, and one set in which each algorithm violates at least one of the properties. We compare their performance with existing algorithms, and find that violating the identified properties could lead to drastic performance degradation, as measured by the Q-D trade-off. On the other hand, we find that the set of sampling algorithms that satisfy these properties performs on par with the existing sampling algorithms.
Anthology ID:
2020.aacl-main.36
Volume:
Proceedings of the 1st Conference of the Asia-Pacific Chapter of the Association for Computational Linguistics and the 10th International Joint Conference on Natural Language Processing
Month:
December
Year:
2020
Address:
Suzhou, China
Editors:
Kam-Fai Wong, Kevin Knight, Hua Wu
Venue:
AACL
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
334–346
Language:
URL:
https://aclanthology.org/2020.aacl-main.36
DOI:
Bibkey:
Cite (ACL):
Moin Nadeem, Tianxing He, Kyunghyun Cho, and James Glass. 2020. A Systematic Characterization of Sampling Algorithms for Open-ended Language Generation. In Proceedings of the 1st Conference of the Asia-Pacific Chapter of the Association for Computational Linguistics and the 10th International Joint Conference on Natural Language Processing, pages 334–346, Suzhou, China. Association for Computational Linguistics.
Cite (Informal):
A Systematic Characterization of Sampling Algorithms for Open-ended Language Generation (Nadeem et al., AACL 2020)
Copy Citation:
PDF:
https://preview.aclanthology.org/ingest-acl-2023-videos/2020.aacl-main.36.pdf
Software:
 2020.aacl-main.36.Software.zip
Code
 moinnadeem/characterizing-sampling-algorithms
Data
WikiText-103WikiText-2