Diverse beam search is a decoding method that splits the beam into several groups and searches with a penalty that lowers the score of later groups when they choose the same word as earlier groups, producing multiple candidate sentences that differ from one another. It was proposed by Vijayakumar et al. (2018). Its computation and memory are almost the same as those of ordinary beam search.
Ordinary beam search can also output as many sentences as the beam width . However, candidates branching off from a single high-probability partial sentence tend to dominate the top, so the outputs are often nearly identical sentences that differ only at the end. The paper points out that this is a problem for the following reasons.
- Wasted computation: Nearly the same computation is repeated for nearly identical sentences.
- Weak on tasks without a single answer: In tasks with many correct answers, such as image captioning and dialogue responses, being able to produce a variety of candidates matters.
Diverse beam search solves this problem by adding a term representing "the differences between candidates" to the beam search objective (the probability of the whole sentence) and optimizing it group by group in turn.

