Search algorithm for generation that keeps top-k partial sequences; can improve likelihood but reduce diversity.
AdvertisementAd space — term-top
Why It Matters
Beam search is essential in applications like machine translation and text generation, where generating coherent and contextually relevant sequences is critical. By balancing the trade-off between quality and diversity, beam search enhances the performance of AI models, making them more effective in real-world tasks.
Beam search is a heuristic search algorithm used in sequence generation tasks, such as natural language processing and machine translation. It maintains a fixed number of the most promising partial sequences, known as beams, at each step of the decoding process. The algorithm expands these beams by generating possible next tokens and selecting the top-k sequences based on their cumulative probabilities, thus balancing exploration and exploitation. Mathematically, beam search can be described as maintaining a set of sequences S_t at time t, where |S_t| = k, and updating S_{t+1} by evaluating the likelihood of extending each sequence in S_t. While beam search improves the likelihood of generated sequences, it can lead to reduced diversity, as it may favor more probable sequences at the expense of exploring less likely but potentially more creative outputs. This technique is closely related to other decoding strategies, such as greedy search and sampling methods.
Beam search is like a smart way of exploring different paths when trying to find the best route on a map. Instead of looking at every possible route, it keeps track of a few of the best options at each step. In AI, this means when generating sentences or sequences, beam search looks at the most promising choices and builds on them, rather than just picking the first one it sees. This helps create better and more accurate results, but sometimes it can miss out on more creative or unique options.