Salvato in:
Dettagli Bibliografici
Autori principali: Kasai, Jungo, Sakaguchi, Keisuke, Bras, Ronan Le, Radev, Dragomir, Choi, Yejin, Smith, Noah A.
Natura: Preprint
Pubblicazione: 2022
Soggetti:
Accesso online:https://arxiv.org/abs/2204.05424
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866913245560832000
author Kasai, Jungo
Sakaguchi, Keisuke
Bras, Ronan Le
Radev, Dragomir
Choi, Yejin
Smith, Noah A.
author_facet Kasai, Jungo
Sakaguchi, Keisuke
Bras, Ronan Le
Radev, Dragomir
Choi, Yejin
Smith, Noah A.
contents Text generation with beam search has proven successful in a wide range of applications. We point out that, though largely overlooked in the literature, the commonly-used implementation of beam decoding (e.g., Hugging Face Transformers and fairseq) uses a first come, first served heuristic: it keeps a set of already completed sequences over time steps and stops when the size of this set reaches the beam size. Based on this finding, we introduce a patience factor, a simple modification to this beam decoding implementation, that generalizes the stopping criterion and provides flexibility to the depth of search. Empirical results demonstrate that adjusting this patience factor improves decoding performance of strong pretrained models on news text summarization and machine translation over diverse language pairs, with a negligible inference slowdown. Our approach only modifies one line of code and can be thus readily incorporated in any implementation. Further, we find that different versions of beam decoding result in large performance differences in summarization, demonstrating the need for clarity in specifying the beam search implementation in research work. Our code will be available upon publication.
format Preprint
id arxiv_https___arxiv_org_abs_2204_05424
institution arXiv
publishDate 2022
record_format arxiv
spellingShingle A Call for Clarity in Beam Search: How It Works and When It Stops
Kasai, Jungo
Sakaguchi, Keisuke
Bras, Ronan Le
Radev, Dragomir
Choi, Yejin
Smith, Noah A.
Computation and Language
Text generation with beam search has proven successful in a wide range of applications. We point out that, though largely overlooked in the literature, the commonly-used implementation of beam decoding (e.g., Hugging Face Transformers and fairseq) uses a first come, first served heuristic: it keeps a set of already completed sequences over time steps and stops when the size of this set reaches the beam size. Based on this finding, we introduce a patience factor, a simple modification to this beam decoding implementation, that generalizes the stopping criterion and provides flexibility to the depth of search. Empirical results demonstrate that adjusting this patience factor improves decoding performance of strong pretrained models on news text summarization and machine translation over diverse language pairs, with a negligible inference slowdown. Our approach only modifies one line of code and can be thus readily incorporated in any implementation. Further, we find that different versions of beam decoding result in large performance differences in summarization, demonstrating the need for clarity in specifying the beam search implementation in research work. Our code will be available upon publication.
title A Call for Clarity in Beam Search: How It Works and When It Stops
topic Computation and Language
url https://arxiv.org/abs/2204.05424