Busca em feixe Decodificação is a busca heurística algorithm commonly used in processamento de linguagem natural (NLP) and tradução automática to generate sequences of outputs, such as sentences or translations. Unlike exhaustive search methods that explore all possible sequences, beam search balances efficiency and accuracy by maintaining a fixed number of the best candidates at each step, known as the ‘beam width’.
O algoritmo começa com um estado inicial and iteratively expands candidates by considering possible next steps. At each iteration, it evaluates all potential continuations of the current sequences and keeps only the top ‘k’ sequences based on their likelihood scores, where ‘k’ is the beam width. This process continues until a stopping criterion is met, such as generating a specific token denoting the end of the sequence.
A principal vantagem da busca em feixe é que ela reduz a carga computacional em comparação com métodos de busca exaustiva, ao mesmo tempo em que fornece sequências de saída robustas e relevantes. No entanto, ela também possui algumas limitações: se a largura do feixe for muito estreita, pode perder a sequência ótima; por outro lado, se for muito ampla, pode levar a um aumento no cálculo sem ganhos significativos na qualidade da saída. Assim, selecionar uma largura de feixe adequada é crucial para equilibrar desempenho e eficiência.
A busca em feixe é amplamente empregada em várias aplicações de IA, incluindo reconhecimento de fala, text generation, and machine translation, where generating coherent and contextually relevant sequences is critical.