Best-k Search Algorithm for Neural Text Generation
Jiacheng Xu, Caiming Xiong, Silvio Savarese, Yingbo Zhou
Abstract
Modern natural language generation paradigms require a decoding strategy to obtain quality sequences out of the model. Beam search yields high-quality but low diversity outputs; stochastic approaches suffer from high variance and sometimes low quality. In this work, we propose a deterministic search algorithm balancing both quality and diversity. We first investigate the vanilla best-first search (BFS) algorithm and then propose the best-k search algorithm. Inspired by BFS, we greedily expand the top k nodes, instead of the first node, to boost efficiency and diversity. Upweighting recently discovered nodes accompanied by heap pruning ensures the completeness of the search procedure. Experiments on four NLG tasks show that best-k search yields more diverse and natural outputs compared to strong baselines, while our approach maintains high text quality. The proposed algorithm is parameter-free, lightweight, efficient, and easy-to-use. 1
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
1 top-tier paper has cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Prompt Sketching for Large Language Models cites The Curious Case of Neural Text Degeneration
- Neural Text Generation With Unlikelihood Training cites The Curious Case of Neural Text Degeneration
- The Curious Case of Neural Text Degeneration cites Neural Text Generation With Unlikelihood Training
- RealToxicityPrompts: Evaluating Neural Toxic Degeneration in Language Models cites Neural Text Generation With Unlikelihood Training
- RealToxicityPrompts: Evaluating Neural Toxic Degeneration in Language Models cites The Curious Case of Neural Text Degeneration
- Language Models are Few-Shot Learners cites The Curious Case of Neural Text Degeneration
Cited by top-tier papers1
Builds on16
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- The Curious Case of Neural Text DegenerationAri Holtzman, Jan Buys, Li Du, Maxwell Forbes et al.ICLR 2020 · 4,112 citations
- BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and ComprehensionMike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad et al.ACL 2020 · 1,224 citations
- RealToxicityPrompts: Evaluating Neural Toxic Degeneration in Language ModelsSamuel Gehman, Suchin Gururangan, Maarten Sap, Yejin Choi et al.EMNLP Findings 2020 · 692 citations
- Neural Text Generation With Unlikelihood TrainingSean Welleck, Ilia Kulikov, Stephen Roller, Emily Dinan et al.ICLR 2020 · 683 citations
Related papers
- Conditional Poisson Stochastic BeamsClara Meister, Afra Amini, Tim Vieira, Ryan CotterellEMNLP 2021
- Generating Diverse and High-Quality Texts by Minimum Bayes Risk DecodingYuu Jinnai, Ukyo Honda, Tetsuro Morimura, Peinan ZhangACL Findings 2024 · 2 citations
- Follow the Wisdom of the Crowd: Effective Text Generation via Minimum Bayes Risk DecodingMirac Suzgun, Luke Melas-Kyriazi, Dan JurafskyACL Findings 2023 · 12 citations
- Determinantal Beam SearchClara Meister, Martina Forster, Ryan CotterellACL 2021
- Local Normalization Distortion and the Thermodynamic Formalism of Decoding Strategies for Large Language ModelsTom Kempton, Stuart BurrellEMNLP Findings 2025
