179 questions
No questions match those filters.
Is beam search the same kind of search as BFS or DFS? W...
This is one of the questions in the full AI/ML interview bank. Pro unlocks all 1789 questions; Premium includes the same bank plus the highest daily Practice limit.
See plansBFS and DFS are complete search strategies: given enough time and memory, they will examine the entire reachable search space and are guaranteed to find a solution if one exists (and, with the right cost tracking, an optimal one). Neither algorithm ever discards a branch except once it’s fully explored or provably irrelevant.
Beam search does something fundamentally different: at every decoding step, it ranks all candidate continuations of every current beam by probability and keeps only the top-k (the beam width), permanently throwing away every other branch regardless of whether it might have led somewhere better several steps later. This makes it a greedy, pruned heuristic search rather than an exhaustive one — closer in spirit to beam search’s namesake in classical AI search literature than to BFS or DFS.
The reason this trade is necessary rather than a shortcut of convenience is scale: the search space for generating even a short sequence is vocabulary_size^sequence_length, which is far too large for BFS or DFS to touch. Beam search accepts that it may prune away the true best sequence in exchange for making the problem tractable at all — wider beams reduce (but never eliminate) that risk at higher computational cost, while a beam width of 1 degenerates exactly into greedy search.