Beam search


In computer science, beam search is a heuristic search algorithm that explores a graph by expanding the most promising node in a limited set. Beam search is an optimization of best-first search that reduces its memory requirements. Best-first search is a graph search which orders all partial solutions according to some heuristic. But in beam search, only a predetermined number of best partial solutions are kept as candidates. It is thus a greedy algorithm.
The term "beam search" was coined by Raj Reddy of Carnegie Mellon University in 1977.

Details

Beam search uses breadth-first search to build its search tree. At each level of the tree, it generates all successors of the states at the current level, sorting them in increasing order of heuristic cost. However, it only stores a predetermined number,, of best states at each level. Only those states are expanded next. The greater the beam width, the fewer states are pruned. With an infinite beam width, no states are pruned and beam search is identical to breadth-first search. The beam width bounds the memory required to perform the search. Since a goal state could potentially be pruned, beam search sacrifices completeness. Beam search is not optimal.
In general, beam search returns the first solution found. Beam search for machine translation is a different case: once reaching the configured maximum search depth, the algorithm will evaluate the solutions found during search at various depths and return the best one.
The beam width can either be fixed or variable. One approach that uses a variable beam width starts with the width at a minimum. If no solution is found, the beam is widened and the procedure is repeated.

Uses

A beam search is most often used to maintain tractability in large systems with insufficient amount of memory to store the entire search tree. For example, it has been used in many machine translation systems.. To select the best translation, each part is processed, and many different ways of translating the words appear. The top best translations according to their sentence structures are kept, and the rest are discarded. The translator then evaluates the translations according to a given criterion, choosing the translation which best keeps the goals. The first use of a beam search was in the Harpy Speech Recognition System, CMU 1976.

Variants

Beam search has been made complete by combining it with depth-first search, resulting in beam stack search and depth-first beam search, and with limited discrepancy search, resulting in beam search using limited discrepancy backtracking. The resulting search algorithms are anytime algorithms that find good but likely sub-optimal solutions quickly, like beam search, then backtrack and continue to find improved solutions until convergence to an optimal solution.
In the context of a local search, we call local beam search a specific algorithm that begins selecting randomly generated states and then, for each level of the search tree, it always considers new states among all the possible successors of the current ones, until it reaches a goal.
Since local beam search often ends up on local maxima, a common solution is to choose the next states in a random way, with a probability dependent from the heuristic evaluation of the states. This kind of search is called stochastic beam search.
Other variants are flexible beam search and recovery beam search.