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:
- 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)$.
- 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$).
- 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."
- 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.
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.
Integration with Beam Search
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.
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