Noisy Parallel Approximate Decoding for Conditional Recurrent Language Model

Kyunghyun ChoarXiv 2016

Introduction

Conditional Recurrent Language Models (CRLMs) are the standard architecture for sequence generation tasks such as machine translation and image captioning. While significant research has focused on improving model architectures and training techniques, the decoding phase—the process of generating output sequences—has remained relatively stagnant, relying primarily on greedy search or beam search. Greedy search is computationally efficient but often suboptimal, while beam search, though more effective, is difficult to parallelize in distributed environments due to the high communication overhead required to synchronize top candidates at each step.

This paper introduces Noisy Parallel Approximate Decoding (NPAD), a "meta-algorithm" designed to improve text generation quality while maintaining high computational efficiency. NPAD leverages the observation that the hidden layers of deep neural networks "stretch" the data manifold, meaning that small perturbations in the hidden state space often correspond to semantically similar but distinct configurations in the output space.

Methods

NPAD improves decoding by exploring the semantic manifold through noise injection. The process consists of four main components:

  1. Noise Injection: Instead of standard deterministic transitions, NPAD adds Gaussian noise ($\epsilon_t$) to the hidden state at each time step: $h_t = \phi(h_{t-1} + \epsilon_t, x_t)$.
  2. Noise Annealing: To account for higher uncertainty at the start of a sentence, the noise level ($\sigma_t$) is high initially and decreases as the sentence progresses ($\sigma_t = \sigma_0 / t$).
  3. Parallel Decoding: The system runs $M$ independent decoding chains in parallel. Because these chains do not require inter-processor communication, the algorithm is "embarrassingly parallelizable."
  4. Selection: Once all chains finish, the original non-noisy model scores the candidates. The sequence with the highest log-probability is selected as the final output. To ensure performance is at least as good as standard greedy search, one chain is typically run without noise ($\sigma_0 = 0$).

Experimental Setup

The strategy was evaluated using an attention-based neural machine translation (NMT) model on an English-to-Czech (En→Cz) translation task. The model was trained on a large parallel corpus from WMT’15 (~12 million sentence pairs) and preprocessed using Byte Pair Encoding (BPE) to handle large vocabularies.

Results and Discussion

NPAD demonstrates significant performance gains over baseline decoding strategies. As shown in Table 1, NPAD with an optimal noise level ($\sigma_0 = 0.3$) significantly outperforms both greedy search and stochastic sampling from the output distribution.

Table 1: Comparison of NPAD against greedy search and stochastic sampling. NPAD achieves the best BLEU scores by perturbing the hidden state manifold.

Hidden Space vs. Output Space

A key insight of this work is that injecting noise into the hidden state is far more effective than sampling from the output word distribution. The hidden state space is "denser" with plausible semantic meanings, whereas the output space is sparse, making random sampling more likely to produce nonsensical results.

NPAD is complementary to existing sophisticated decoding methods. It can be used as an "outer loop" for beam search (NPAD+B) to find better global solutions.

Table 3: Performance of NPAD when combined with beam search (NPAD+B). The combination yields improvements over standard beam search across different beam widths.

As illustrated in Table 3, adding NPAD to a beam search with a width of 5 improved the test BLEU from 18.56 to 18.64. This confirms that NPAD's exploration of the semantic manifold provides benefits even when the underlying decoder is already highly optimized.

Conclusion

NPAD offers a robust, parallelizable method for improving decoding in CRLMs. By exploring the hidden state manifold, it achieves substantial BLEU gains over greedy search and outperforms traditional stochastic sampling. While it increases total raw computation, its lack of communication overhead makes it ideal for distributed environments. Future work may explore learned noise schedules or integrating noise during training to further enhance model robustness.

Summary updated

Abstract

Recent advances in conditional recurrent language modelling have mainly focused on network architectures (e.g., attention mechanism), learning algorithms (e.g., scheduled sampling and sequence-level training) and novel applications (e.g., image/video description generation, speech recognition, etc.) On the other hand, we notice that decoding algorithms/strategies have not been investigated as much, and it has become standard to use greedy or beam search. In this paper, we propose a novel decoding strategy motivated by an earlier observation that nonlinear hidden layers of a deep neural network stretch the data manifold. The proposed strategy is embarrassingly parallelizable without any communication overhead, while improving an existing decoding algorithm. We extensively evaluate it with attention-based neural machine translation on the task of En->Cz translation.
BibTeX
@misc{cho2016noisy,
  author = {Kyunghyun Cho},
  title = {{Noisy Parallel Approximate Decoding for Conditional Recurrent Language Model}},
  year = {2016},
  eprint = {1605.03835},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1605.03835},
}
Figure