In neural text generation such as neural machine translation, summarization, and image captioning, beam search is widely used to improve the output text quality.
in the neural generation setting, hypotheses can finish in different steps, which makes it difficult to decide when to end beam search to ensure optimality.