Plan, Attend, Generate: Planning for Sequence-to-Sequence Models

Çaglar Gülçehre, Francis Dutil, Adam Trischler, Yoshua Bengio

Introduction

Standard sequence-to-sequence (seq2seq) models are inherently "reactive." During tasks like translation, their attention mechanisms decide where to focus on the input sequence one step at a time. While revolutionary, this myopic approach struggles with long sequences, such as character-level translation. Because the model lacks a long-term strategy for traversing the input, it often produces jittery alignments or loses track of global coherence.

This paper introduces Plan, Attend, Generate (PAG), a framework that allows models to "look ahead." By constructing an explicit plan of future alignments, PAG leads to smoother attention, faster convergence, and state-of-the-art results in character-level translation—all while using significantly fewer parameters.

The PAG Architecture

The authors propose augmenting the standard decoder with two novel components to shift from reactive guessing to proactive planning:

  1. Alignment Plan Matrix ($A_t$): Instead of picking a single spot to focus on, the model generates a matrix representing a "template" of where it intends to focus for the next $k$ steps.
  2. Commitment Plan Vector ($c_t$): This acts as a "commitment switch." At each step, the model decides whether to follow its existing plan or scrap it and re-plan.
The Plan, Attend, Generate (PAG) architecture featuring the Alignment Plan Matrix and Commitment Plan.

To make discrete decisions (like whether to re-plan) differentiable for neural network training, the authors employ the Gumbel-Softmax trick.

They also introduce a more efficient variant called rPAG (repeat-PAG). Instead of maintaining a complex matrix, rPAG simply reuses the previous alignment until the commitment switch triggers a move. This mimics how humans might focus on a single source word while generating multiple output characters.

Experiments and Key Insights

The model was evaluated across three distinct domains: Character-level Neural Machine Translation (WMT’15), Algorithmic Reasoning (Eulerian circuits), and Question Generation (SQuAD).

Smoother Alignments and Coherence

By forcing the model to commit to a multi-step plan, it learns to induce coherence. Qualitative analysis shows that standard models often "flicker" their attention to the end-of-sentence token when confused. In contrast, PAG models maintain much smoother, more intuitive alignments, focusing steadily on the relevant source word until its translation is complete.

Comparison of attention alignments demonstrating how PAG models achieve smoother, more coherent focus over long sequences.

Efficiency and Performance

Surprisingly, the planning models outperformed baselines despite having roughly 4 million fewer parameters, suggesting that a better structural process (planning) is more valuable than raw model capacity. To prevent the model from "cheating" by re-planning at every step (which would revert it to a standard reactive model), the authors successfully applied a specific penalty loss term.

  • NMT Performance: On WMT'15 tasks, PAG and rPAG consistently beat the state-of-the-art character-level baseline. For example, in English-to-Finnish, PAG achieved a BLEU score of 12.15 compared to the baseline's 10.93.
  • Algorithmic Mastery: In the Eulerian circuit task (with 7 nodes), the PAG model achieved 100% accuracy, while the standard attention baseline lagged at 90.4%.
  • Convergence: Planning models converged significantly faster during training, reaching lower error rates in fewer updates.

Limitations and Future Work

While highly effective, the framework has limitations. The full PAG model requires storing the alignment plan matrix, increasing memory overhead during training (though rPAG mitigates this). Furthermore, the model currently uses a fixed lookahead window ($k$); dynamic windows could better accommodate complex sentence structures.

Finally, PAG plans where to look (alignments) but not explicitly what to say (content). The authors suggest "generative planning"—deciding on a sequence of future words—as a promising frontier for sequence-to-sequence generation.

Summary updated

BibTeX
@inproceedings{gulcehre2017plan,
  author = {Çaglar Gülçehre and Francis Dutil and Adam Trischler and Yoshua Bengio},
  title = {{Plan, Attend, Generate: Planning for Sequence-to-Sequence Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2017},
}
Figure