---
title: 'Plan-then-Generate: Two-Stage Process'
url: https://www.emergentmind.com/topics/plan-then-generate
type: topic
---

# Plan-then-Generate: Two-Stage Process

Searching arXiv for the specified paper and closely related plan-then-generate work to ground the article.
Plan-then-generate is a family of generation architectures in which a model first produces an explicit intermediate plan and only then realizes a final output conditioned on that plan. Across the literature, the “plan” varies substantially in granularity and ontology: it may be a short-horizon alignment schedule for neural machine translation, an ordered list of slot keys or predicates for data-to-text generation, a sequence of question blueprints for grounded long-form writing, or a symbolic action sequence for automated planning. The common thread is a structural decomposition of generation into at least two stages—planning and realization—motivated by controllability, grounding, faithfulness, or long-horizon coordination rather than by direct end-to-end decoding alone [1706.05087], [2108.13740], [2404.03381].

## 1. Conceptual scope and definitions

In the narrow sense used by "Plan, Attend, Generate: Character-Level Neural Machine Translation with Planning" [1706.05087], plan-then-generate refers to planning **future source-target alignments** before or while generating the next target symbols. In that formulation, the plan is not a discourse outline or semantic sketch; it is a latent alignment schedule inside the decoder. The model first proposes a short-horizon alignment trajectory and then generates target characters while following or revising that plan [1706.05087].

In broader text-generation work, the intermediate plan is often more interpretable. "Plan-then-Generate: Controlled Data-to-Text Generation via Planning" [2108.13740] defines a content plan as an ordered list of slot keys or predicates, encoding both **what content should be mentioned** and **in what order it should be expressed**. "Learning to Plan and Generate Text with Citations" [2404.03381] conceptualizes plans as a sequence of questions serving as blueprints of generated content and its organization. "Text-Blueprint" [2305.00034] likewise uses a sequence of question-answer pairs, or in the interactive variant a sequence of questions, as a blueprint plan for query-focused summarization.

A more formal variant appears in symbolic planning systems. "Plansformer" [2212.08681] treats classical automated planning as a sequence generation problem in which the explicit symbolic plan is itself the generated output. "Plan2Evolve" [2509.21543] places formal PDDL planning before natural-language rationale generation: a domain is generated, a symbolic plan is solved, a symbolic state-transition trace is constructed, and only then is a natural-language chain of thought produced. This suggests that plan-then-generate is better understood as a general design pattern for introducing a structured intermediate artifact between input and final output, rather than as a single architectural template.

## 2. Alignment planning in sequence-to-sequence models

The most technically specific early neural instantiation is PAG, introduced for character-level neural machine translation in [1706.05087]. The underlying motivation is that standard attention-based encoder-decoder models compute alignments locally at each decoding step, which can be limiting for long character sequences because the decoder must repeatedly rediscover alignment structure online. The proposed response is a planning-ahead mechanism: before generating future target symbols, the decoder constructs a plan of future alignments and decides how long to commit to it [1706.05087].

PAG augments a standard attention-based sequence-to-sequence architecture with two planning states: an **alignment plan matrix** and a **commitment plan vector**. The alignment plan matrix stores proposed alignments for the current and several future decoding steps,
$$
\mathbf{A}_t \in \mathbb{R}^{k \times |X|},
$$
where row \(0\) stores the alignment logits to use immediately and later rows encode a rolling horizon of future attentional decisions. The actual alignment is read from the first row,
$$
\alpha_t = \text{softmax}(\mathbf{A}_t[0]).
$$
The commitment vector
$$
\mathbf{c}_t \in \mathbb{R}^k
$$
governs whether the decoder follows the current plan or recomputes a new one [1706.05087].

The model’s recurrent backbone remains conventional:
$$
\mathbf{h}_i = [\mathbf{h}_i^\rightarrow; \mathbf{h}_i^\leftarrow], \qquad
\psi_t = \sum_i^{|X|}\alpha_{ti}\mathbf{h}_i, \qquad
\mathbf{s}_t = f_{\text{dec-rnn}}(\mathbf{s}_{t-1}, \mathbf{y}_t, \psi_t).
$$
What changes is the source of \(\alpha_t\): attention is no longer recomputed purely myopically but is read from a planned structure. The paper also defines a candidate alignment plan \(\bar{\mathbf{A}}_t\), row summaries \(\beta_t^i = f_r(\mathbf{A}_{t-1}[i])\), and update gates that interpolate between old and new plans,
$$
\mathbf{u}_{ti} = f_{\text{up}}(\mathbf{h}_i, \mathbf{s}_{t-1}),
$$
$$
\mathbf{A}_t[:,i] = (1-\mathbf{u}_{ti}) \odot \mathbf{A}_{t-1}[:,i] + \mathbf{u}_{ti} \odot \bar{\mathbf{A}}_t[:,i].
$$
This is not merely additional decoder state; it is an explicit rolling representation of future attentional actions [1706.05087].

The commitment mechanism discretizes a short planning schedule:
$$
\mathbf{c}_t = \mathtt{gumbel\_softmax}(f_c(\mathbf{s}_{t-1})), \qquad
\bar{\mathbf{c}}_t = \mathtt{one\_hot}(\mathbf{c}_t),
$$
with the first element acting as a switch \(g_t = \bar{\mathbf{c}}_t[0]\). If \(g_t = 0\), the model follows the current plan by shifting the plan forward,
$$
\mathbf{A}_t = \rho(\mathbf{A}_{t-1}), \qquad \mathbf{c}_t = \rho(\mathbf{c}_{t-1}).
$$
If \(g_t = 1\), it recomputes the commitment vector and refreshes the alignment plan [1706.05087]. The paper regularizes this behavior with
$$
\mathcal{L}_{\text{com}} = \lambda_{\text{com}} \sum_{t=1}^{|X|}\sum_{i=0}^{k}\left\| \frac{1}{k} - \mathbf{c}_{ti} \right\|_2^2,
$$
so that the model does not immediately collapse back to per-step replanning.

The paper also introduces **rPAG**, a cheaper variant that dispenses with the explicit \(k \times |X|\) plan matrix and simply reuses the current alignment until the commitment switch triggers recomputation:
$$
\alpha_t = \alpha_{t-1}
$$
when \(g_t=0\). PAG is thus an explicit short-horizon planner, whereas rPAG is a lighter reuse policy with an implicit planning mechanism [1706.05087].

## 3. Training and empirical profile of early neural planning models

PAG is trained end to end with conditional negative log-likelihood,
$$
\mathcal{L} = -\frac{1}{N}\sum_{n=1}^N \log p_\theta(\mathbf{y}^{(n)} \mid \mathbf{x}^{(n)}),
$$
augmented by the commitment penalty. The use of Gumbel-Softmax and a straight-through estimator makes the commitment behavior differentiable in practice. The authors note that they tried REINFORCE but found Gumbel-Softmax performed better [1706.05087].

The experiments are on WMT’15 character-level translation tasks—English \(\rightarrow\) German, English \(\rightarrow\) Czech, and English \(\rightarrow\) Finnish—with BPE on the source side and character generation on the target side [1706.05087]. The planning models generally outperform the baseline on almost all language pairs, and the paper emphasizes two efficiency properties: PAG and rPAG were trained for **350K** updates versus **680K** for the baseline, and used about **4M fewer** parameters than the baseline [1706.05087]. The reported qualitative signature is smoother and more intuitive alignments, with the baseline often placing too much attention on the final empty source token after the first few characters of a word, effectively switching into language-model mode once it has guessed the word. PAG and rPAG maintain more coherent source tracking [1706.05087].

The later paper "Plan, Attend, Generate: Planning for Sequence-to-Sequence Models" [1711.10462] extends the same core idea to broader sequence-to-sequence settings. Its abstract states that the model constructs a matrix of proposed future alignments and a commitment vector that governs whether to follow or recompute the plan; that the mechanism is inspired by the strategic attentive reader and writer (STRAW) model; and that it outperforms a strong baseline on character-level translation tasks from WMT’15, the algorithmic task of finding Eulerian circuits of graphs, and question generation from text [1711.10462]. However, the available supplementary fragment for [1711.10462] does not contain the architecture, update equations, objective functions, or numeric results; what it directly shows is that the proposed model, called PAG, learns different and apparently better alignments than a baseline and that these alignments correlate with stronger qualitative translation outputs. This suggests continuity with the explicit alignment-planning mechanism detailed in [1706.05087].

## 4. Content planning for controllable generation

A distinct line of work treats planning as an explicit content-ordering interface. "Plan-then-Generate: Controlled Data-to-Text Generation via Planning" [2108.13740] formulates generation from structured data as a two-stage pipeline. The input dataset is
$$
\mathcal{D}=\{(T, C, S)_i\}_{i=1}^{|D|},
$$
where \(T\) is linearized structured data, \(C\) is a reference content plan, and \(S\) is the reference text. For tabular inputs, each \(t_i\) is a slot key-value pair \(\{k_i, v_i\}\); for graph inputs, each \(t_i\) is an RDF triple \(\{s_i, p_i, o_i\}\). The content plan
$$
C=\{c_1,\ldots,c_{|C|}\}
$$
is an ordered list of slot keys or predicates extracted heuristically by delexicalization,
$$
C=\mathcal{F}(T,S).
$$
This plan makes content selection and ordering explicit [2108.13740].

The planner encodes candidate plan tokens with BERT-base and predicts their ordering with a linear-chain CRF:
$$
P_{\textup{CRF}}(Y|H_C)= \frac{1}{Z}\exp\left(\sum_{i=1}^{|C|}\Phi_{y_i}(h^c_i) + \sum_{i=2}^{|C|}M_{y_{i-1}, y_i}\right),
$$
followed by
$$
\tilde{Y} = \argmax_{Y^{\prime}} P_{\textup{CRF}}(Y^{\prime}|H_C).
$$
The labels represent output positions, with \(\emptyset\) indicating omission of a candidate token. The generator, built on BART-base, conditions on the concatenation \([T:C]\) and is trained with
$$
\mathcal{L}_{\textup{LM}} = -\sum_{i=1}^{|S|}\log P_{G}(S_i|S_{<i}; E([T:C])).
$$
To encourage sequence-level adherence to the plan, the paper adds reinforcement learning,
$$
\mathcal{L}_{\textup{RL}} = -\mathbb{E}_{S^{\prime}\sim P_{\theta}(T, C)}[R(S, S^{\prime}, T, C)],
$$
with the sampled output compared both to the reference text and, via delexicalization, to the desired structure [2108.13740].

This design allows both automatic and user-specified plans. The empirical claim is not only higher quality but controllability over both **intra-sentence** and **inter-sentence** structure on ToTTo and WebNLG. On ToTTo hidden test, the model achieves BLEU **49.2**, PARENT **58.7**, and BLEURT **0.249**; on WebNLG it reports BLEU **60.51** and METEOR **0.46**, outperforming the reported baselines [2108.13740]. Human evaluation on ToTTo shows the controlled version is nearly as faithful and fluent as references, and shuffled plans substantially increase diversity while reducing plan-following accuracy, indicating that the plan is genuinely exerting control rather than functioning as a redundant side channel [2108.13740].

EDU-based summarization provides another content-plan formulation. "Generating EDU Extracts for Plan-Guided Summary Re-Ranking" [2305.17779] defines a content plan as an ordered subset of source EDUs,
$$
D = \{s_1, s_2, \ldots, s_K\}, \qquad S \subset D,
$$
learned with a hierarchical BART-based planner trained by
$$
\mathcal{L}_{plan} = -\log p(S^{oracle} \mid D).
$$
A separate abstractor conditions on the source document marked with the selected EDUs, and the guided abstraction objective includes both a likelihood term under the oracle plan and an unlikelihood term under a random distractor plan:
$$
\mathcal{L}_{GA} = \lambda \log p(R \mid D, S_{oracle}) + \lambda \log\bigl(1 - p(R \mid D, S_{random})\bigr) + \beta \log p(R \mid D).
$$
The resulting plan-guided candidate set yields ROUGE-2 gains of **0.88** on CNN/DailyMail, **2.01** on NYT, and **0.38** on XSum relative to previously published reranking methods [2305.17779]. This suggests that explicit content planning can be used not only for direct controllability but also as a structured diversity mechanism upstream of reranking.

## 5. Blueprint plans, grounded questions, and citation-aware generation

A closely related but more semantically legible representation treats plans as sequences of questions. "Text-Blueprint" [2305.00034] and "Learning to Plan and Generate Text with Citations" [2404.03381] define a **blueprint** as an ordered sequence of questions, or question-answer pairs in earlier formulations, that specify what information should be covered and in what order. In "Text-Blueprint" [2305.00034], the input \(d\) is a query concatenated with one or more relevant documents, and the model generates the concatenation \(b; s\), where \(b\) is the blueprint and \(s\) is the summary. The end-to-end variant linearizes the blueprint as
$$
q_1; a_1; \ldots; q_m; a_m,
$$
while the interactive variant allows a question-only blueprint \(q_1; q_2; \ldots; q_m\), making the plan user-editable. This plan is visible, editable, and aligned to generated summary spans, which shifts planning from an internal inductive bias to a control surface [2305.00034].

"Learning to Plan and Generate Text with Citations" [2404.03381] uses the same high-level idea for retrieval-grounded long-form QA. Given a query \(q\) and retrieved passages
$$
P = \{p_1,\dots,p_n\},
$$
the model generates a summary
$$
S = \{s_1,\dots,s_m\}
$$
with citations, while introducing a blueprint
$$
B = \{b_1,\dots,b_k\}
$$
of ordered questions. The conceptual factorization is
$$
p(B, S, C \mid P, q) \approx p(B \mid P, q)\, p(S, C \mid B, P, q),
$$
implemented by decoding the concatenated sequence \(B;S\) with citation tokens. The paper explores two blueprint variants: an **abstractive** blueprint generated from scratch, and an **extractive** blueprint copied from question inventories attached to retrieved passages. The extractive variant performs best in-domain on AQuAMuSe, with ROUGE-L **72.98**, ANLI **88.01**, AutoAIS **74.35**, and blueprint answerability **97.97** for the attributed model [2404.03381]. A striking result is that post-hoc filtering of unanswerable blueprint questions in the abstractive model raises AutoAIS from **74.16** to **81.25**, showing that the explicit plan can be directly manipulated to improve grounding and citation quality [2404.03381].

These blueprint systems illustrate a recurrent pattern in plan-then-generate research: an explicit plan often functions simultaneously as a semantic bottleneck, a grounding interface, and a controllability handle. This suggests that the value of planning is not limited to optimization or modularity; it can also make the generation process inspectable and correctable.

## 6. Plan-first symbolic systems and broader extensions

Some systems instantiate planning even more literally. "Plansformer" [2212.08681] fine-tunes CodeT5-base to map a serialized symbolic planning problem to a serialized action sequence. The input contains goal facts, initial facts, and action schemas marked with tokens such as `<GOAL>`, `<INIT>`, `<ACTION>`, `<PRE>`, and `<EFFECT>`. The model is evaluated both with string overlap metrics and with planner testing using VAL. On domain-specialized models, reported valid-plan rates are **90.04%** for Blocksworld, **84.97%** for Towers of Hanoi, **82.97%** for Grippers, and **76.56%** for Driverlog, with corresponding optimality rates of **88.44%**, **82.58%**, **69.47%**, and **52.61%** [2212.08681]. Although the symbolic plan is itself the final output rather than an intermediate representation for a later generator, the paper clarifies the importance of execution-based evaluation over text overlap and shows how seq2seq models can act as explicit planning modules.

"Plan-and-Act" [2503.09572] separates a **Planner** from an **Executor** for long-horizon web tasks. The Planner emits structured high-level plans in a format such as
```text
## Step N
Reasoning: ...
Step: ...
```
and the Executor maps these plans plus the current HTML and action history to grounded actions. Dynamic replanning after each step yields the strongest reported system, with **53.94%** success on WebArena-Lite in the provided text, compared to **36.97%** for a no-planner baseline with the best executor [2503.09572]. This suggests that in dynamic environments the intermediate plan may need to be continually revised rather than produced once.

"PlanRAG" [2406.12430] applies the same structural idea to database decision making: first generate an explicit analysis plan, then perform iterative retrieval and reasoning conditioned on that plan. On its DQA benchmark, PlanRAG improves over iterative RAG by **15.8** points in the Locating scenario and **7.4** points in Building, while reducing missed data analysis from **3.3%** to **1.3%** in Locating and from **33.2%** to **21.8%** in Building [2406.12430]. This suggests that planning can improve not only the final surface realization but the quality of retrieval trajectories themselves.

Plan-first pipelines now also appear beyond text. "Pointer-CAD v2" [2606.29301] decouples parameter reasoning from geometric construction by first producing a structured design plan with explicit metric parameters and then generating CAD commands by pointering into parameter and entity dictionaries. Its full loss combines plan-token cross-entropy, command-label cross-entropy, and contrastive retrieval losses:
$$
\mathcal{L} = \lambda_t \cdot \mathcal{L}_t + \lambda_l \cdot \mathcal{L}_l + \lambda_v \cdot \mathcal{L}_v + \lambda_p \cdot \mathcal{L}_p,
$$
with \(\lambda_t = 0.2\), \(\lambda_l = 0.3\), \(\lambda_v = 0.2\), and \(\lambda_p = 0.3\). "CADMorph" [2512.11480] uses a plan–generate–verify loop for geometry-driven CAD editing: P2S cross-attention identifies which sequence segments to mask, an MPP model infills the masks autoregressively,
$$
P(C_{r}^n \mid C^{\text{mask}}_r) = \prod_{t=1}^{T} P(C_{r}^{n,t} \mid C^{\text{mask}}_r, C_{r}^{n,<t}),
$$
and P2S latent distance verifies candidates via
$$
C_r^\prime = \arg\min_{\tilde{C}\in \mathcal{Q}} \|\mathcal{F}(\tilde{C})-E_s(S^\prime)\|_2.
$$
The ablation removing planning reduces IoU from **0.687** to **0.447**, underscoring that explicit localization before generation is not incidental but structurally important [2512.11480].

## 6. Evaluation themes, benefits, and limitations

A recurring empirical pattern across these papers is that explicit plans improve one or more of the following: controllability, grounding, candidate diversity, convergence speed, or long-horizon coordination. In PAG, planning improves alignment quality and efficiency in character-level translation [1706.05087]. In PlanGen for data-to-text, plans improve both automatic metrics and human-rated adherence to desired structure [2108.13740]. In blueprint and citation work, plans improve attribution quality and can be filtered or edited to further improve faithfulness [2404.03381], [2305.00034]. In retrieval-heavy settings such as PlanRAG, planning reduces omitted analysis steps [2406.12430]. In web agents, a strong planner can materially raise a weak executor’s performance [2503.09572].

At the same time, the literature is consistent that plans are not automatically beneficial. Poor plans can mislead downstream modules, and the gap between oracle and predicted plans is often substantial. In PlanGen, oracle plans greatly outperform predicted ones, indicating that planner quality is a major bottleneck [2108.13740]. In Plan-and-Act, early or weak planners underperform no-planner baselines until grounded synthetic supervision is added [2503.09572]. PlanRAG shows that multiple re-plans often correlate with lower success, implying that plan repair becomes harder on more complex tasks even when it is necessary [2406.12430]. Systems using extractive or source-tethered plans often obtain stronger attribution or fidelity but can become more computationally expensive or less flexible [2404.03381].

A common misconception is that plan-then-generate always means a human-readable outline followed by text realization. The surveyed work suggests a broader taxonomy. Plans may be latent alignment schedules [1706.05087], ordered content indices [2108.13740], EDU subsets [2305.17779], question blueprints [2404.03381], symbolic action sequences [2212.08681], structured web subgoals [2503.09572], database-analysis procedures [2406.12430], or typed geometric parameter dictionaries [2606.29301]. What defines the paradigm is not the ontology of the plan but the insertion of a structured intermediate object that causally constrains later generation.

A plausible implication is that the most durable contribution of this line of work is methodological rather than domain-specific. These papers collectively show that useful planning can occur at many representational levels—attention, content order, retrieval policy, symbolic action, or geometric parameterization—and that explicit intermediate structures can improve not only quality but also observability and editability. In that sense, plan-then-generate is best understood as an architectural principle for decomposing generation into controllable stages, rather than as a fixed algorithm or a single type of planner [1706.05087], [2108.13740], [2404.03381].

Source: https://www.emergentmind.com/topics/plan-then-generate