Skip to main content
QUICK REVIEW

[Paper Review] Bidirectional Beam Search: Forward-Backward Inference in Neural Sequence Models for Fill-in-the-Blank Image Captioning

Qing Sun, Stefan Lee|arXiv (Cornell University)|May 24, 2017
Multimodal Machine Learning ApplicationsComputer Science31 references5 citations
TL;DR

This paper introduces Bidirectional Beam Search (BiBS), the first efficient approximate inference algorithm for 1-Best and M-Best decoding in bidirectional neural sequence models, enabling joint consideration of past and future context during sequence generation. Evaluated on a novel fill-in-the-blank image captioning task and Visual Madlibs, BiBS significantly outperforms unidirectional beam search and prior methods, achieving state-of-the-art results on BLEU-1 and BLEU-2 metrics by effectively leveraging bidirectional context for more coherent and accurate sequence completion.

ABSTRACT

We develop the first approximate inference algorithm for 1-Best (and M-Best) decoding in bidirectional neural sequence models by extending Beam Search (BS) to reason about both forward and backward time dependencies. Beam Search (BS) is a widely used approximate inference algorithm for decoding sequences from unidirectional neural sequence models. Interestingly, approximate inference in bidirectional models remains an open problem, despite their significant advantage in modeling information from both the past and future. To enable the use of bidirectional models, we present Bidirectional Beam Search (BiBS), an efficient algorithm for approximate bidirectional inference.To evaluate our method and as an interesting problem in its own right, we introduce a novel Fill-in-the-Blank Image Captioning task which requires reasoning about both past and future sentence structure to reconstruct sensible image descriptions. We use this task as well as the Visual Madlibs dataset to demonstrate the effectiveness of our approach, consistently outperforming all baseline methods.

Motivation & Objective

  • To address the lack of efficient approximate inference algorithms for bidirectional neural sequence models, which can model both past and future context but remain underutilized due to inference challenges.
  • To develop a novel inference method that enables 1-Best and M-Best decoding in bidirectional RNNs by extending beam search to reason about forward and backward dependencies.
  • To create a challenging new benchmark—fill-in-the-blank image captioning—that tests a model's ability to integrate context from both sides of a missing span.
  • To demonstrate that standard beam search fails on this task due to its unidirectional context limitation, producing grammatically incorrect or incoherent completions.
  • To evaluate BiBS on real-world sequence completion tasks, showing consistent gains over strong baselines including retrieval-based methods.

Proposed method

  • BiBS extends traditional beam search by maintaining forward and backward hidden states at each time step, allowing the model to condition on both past and future context during decoding.
  • The algorithm approximates the joint distribution over output sequences by combining forward and backward probabilities, enabling efficient computation of sequence scores.
  • At each beam step, BiBS expands partial sequences using both forward and backward RNN states, then selects the top-B sequences based on combined scores.
  • The method supports both 1-Best and M-Best decoding by maintaining multiple candidate sequences throughout the beam search process.
  • It uses a joint scoring function that combines forward and backward likelihoods: P(y_t | h^f_t, h^b_t) ≈ P(y_t | h^f_t) × P(y_t | h^b_t), adjusted for consistency.
  • The approach is integrated into a CNN+LSTM framework for image captioning, with training and inference performed end-to-end on visual and linguistic inputs.

Experimental results

Research questions

  • RQ1Can an efficient approximate inference algorithm be developed for bidirectional RNNs that supports 1-Best and M-Best decoding?
  • RQ2How does joint modeling of forward and backward dependencies improve sequence completion in fill-in-the-blank tasks?
  • RQ3Does BiBS outperform unidirectional beam search and retrieval-based baselines on sequence completion benchmarks like Visual Madlibs?
  • RQ4Can BiBS generate more grammatically correct and contextually coherent completions than standard beam search in settings with missing spans?
  • RQ5What is the impact of unknown blank length on the performance of BiBS compared to other methods?

Key findings

  • On the Visual Madlibs dataset with known blank length, BiBS achieved a BLEU-2 score of 0.216, outperforming all generation-based baselines and surpassing the nCCA oracle method.
  • For unknown blank length, BiBS achieved a BLEU-2 score of 0.190, outperforming all generation-based baselines and remaining competitive with retrieval methods.
  • BiBS significantly reduced grammatical errors and abrupt transitions—such as 'with a how to'—common in unidirectional beam search outputs.
  • The method achieved state-of-the-art performance on both type-7 (object affordance) and type-12 (pair relationship) Visual Madlibs question types.
  • BiBS demonstrated robustness across varying blank lengths and consistently improved over unidirectional beam search and other baselines in both known and unknown length settings.
  • The results confirm that bidirectional modeling with proper inference is essential for coherent sequence completion, and BiBS enables this in practice.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.