Abstract
Sequence-to-sequence (seq2seq) neural networks are standard for language applications, yet traditional decoding strategies like beam search often fail to produce high-quality responses. Standard models typically generate text in a "regular" left-to-right order, which can lead to generic or irrelevant outputs. This paper proposes leveraging a "reverse" right-to-left language model to provide a complementary perspective on path-finding. We introduce two bidirectional strategies, BidiS and BidiA, which combine forward and backward models to improve response generation. Our approaches demonstrate superior performance in both relevance and diversity compared to unidirectional beam search.
The Challenge of Unidirectional Decoding
Modern chatbots powered by seq2seq models frequently suffer from a lack of diversity, often defaulting to "safe" but dull responses like "I don't know." This issue stems from three primary constraints in standard beam search:
- Likelihood Bias: Selection based purely on probability often favors generic sequences.
- Unidirectional Dependencies: Left-to-right models cannot account for how the end of a sentence should logically constrain its beginning.
- Vanishing Input Influence: In long responses, the influence of the initial prompt often fades, leading to irrelevant endings.
Proposed Bidirectional Strategies
To address these issues, we utilize a reverse decoder—a model trained to output sentences from right-to-left—sharing a single encoder with the regular model to maintain efficiency. We propose two algorithms:
- BidiS (Bidirectional Scoring): A re-ranking approach where the regular model generates candidates, and the reverse model scores them. This penalizes sentences that start strong but lose relevance or coherence by the end.
- BidiA (Bidirectional Agreement): A "meeting in the middle" strategy. Candidates are generated from both regular and reverse models. The system then selects the pair that shows the highest similarity based on metrics like BLEU or Word Mover’s Distance (WMD), ensuring the response is robust from both directions.
Experimental Results
Performance and Scalability
We evaluated our models on the Switchboard Dialogue Act (SwDA) and Cornell Movie datasets. BidiA achieved relative improvements in BLEU-4 scores of 9% on Cornell and 5% on SwDA compared to Vanilla Beam Search (VBS). Notably, while VBS often plateaus as beam size ($N_B$) increases, bidirectional strategies continue to improve, demonstrating better scalability.
Response Diversity
Beyond relevance, bidirectional strategies significantly enhance the diversity of generated text. By requiring agreement between two different models, the system effectively filters out generic "noise." As shown in the table below, the bidirectional models consistently achieved higher "distinct-n" scores, indicating a wider variety of unique words and phrases.
Conclusion
By incorporating a reverse-order perspective, bidirectional beam search strategies overcome the inherent limitations of unidirectional decoding. These methods produce responses that are not only more relevant to the prompt but also significantly more diverse. Furthermore, BidiA offers computational efficiency gains by reducing the total number of paths that must be explored and sorted compared to large-scale vanilla beam searches.
Summary updated