Beam search is a heuristic search algorithm used during inference to improve the quality of generated translations by exploring multiple possible output sequences at each step of the decoding process. Instead of greedily selecting the most likely word at each step, beam search maintains a "beam" of B candidate sequences, where B is the beam size. At each step, the model generates probabilities for all possible words in the vocabulary. For each of the B candidate sequences in the beam, beam search considers the top K most likely words and extends the candidate s....
Log in to view the answer