[KongchangAI]
· 2 min read· 1,026 words

Plan-and-Patch: Agentic Planning and Local Repair with Diffusion Language Models

Plan-and-Patch: Agentic Planning and Local Repair with Diffusion Language Models

Plan-and-Patch uses diffusion LMs to locally patch agent plans, achieving 2x repair success and ~40% lower latency vs. autoregressive models.

A new arXiv paper, Plan-and-Patch, addresses the challenge of dynamic plan revision in long-horizon AI agents by using diffusion language models (dLLMs) as the core planner. Leveraging parallel unmasking, dLLMs generate structured plans and can repair only the affected regions by filling masked segments conditioned on preserved prefix and suffix context. Experiments comparing 8B-scale DreamReasoner-8B (diffusion) and Qwen3-8B (autoregressive) show that without task training, the diffusion model achieves 53.7% repair success vs. 27.0% for AR; after training on ALFWorld and TextCraft, success rates converge but the diffusion planner still reduces latency by 39–46%.

The Planning Challenge for Long-Horizon Agents

When an AI agent needs to complete complex, multi-step tasks in real-world environments, simply generating a plan isn't enough. During execution, the environment may change, tools may return unexpected results, or individual actions may fail outright. This means a capable agent must not only know how to make a plan — it must also know how to fix one.

A new paper on arXiv, Plan-and-Patch: Diffusion Language Models for Agentic Planning, proposes a solution to exactly this problem. The researchers identified a key observation: when a plan needs revision, typically only a portion of it is affected — the surrounding structure can largely be preserved. Given this, rather than scrapping the entire plan and risking unnecessary changes, it makes more sense to apply a targeted "patch" to only the affected region.

Plan-and-Patch paper source

The Core Idea Behind Plan-and-Patch

Plan-and-Patch is a plan-and-act framework built around diffusion language models (dLLMs) for both generating and repairing plans.

Unlike traditional autoregressive models that generate text token by token, diffusion language models produce a structured, program-like plan all at once through parallel unmasking. This generation style is naturally suited to structured outputs and unlocks a unique advantage: when a plan needs repair, the model can fill in only the selected regions while leaving the surrounding steps untouched.

This is the fundamental difference from autoregressive models. Autoregressive generation is a strictly left-to-right process — if a step goes wrong in the middle, it's difficult to make precise corrections without disturbing the content that follows. Diffusion models, by contrast, operate via a mask-and-fill mechanism: a segment of the plan can be "erased," then regenerated conditioned on the preserved prefix and suffix, enabling true local repair.

What is a Diffusion Language Model (dLLM)? dLLMs are a class of generative models inspired by diffusion models from image generation, but applied to discrete text sequences. Unlike autoregressive models (like the GPT family) that predict tokens left-to-right, dLLMs are trained by randomly replacing words with [MASK] tokens (the "noising" process) and then learning to recover the original text (the "denoising" process). At inference time, the model starts from a fully masked sequence and iteratively unmasks positions over multiple rounds until the full output is produced. Since all positions can in principle be processed in parallel, dLLMs are often faster than autoregressive models for fixed-length sequences. Moreover, the mask-and-fill mechanism naturally supports "fill-in-the-blank" operations: by masking a specific segment while keeping the rest intact, the model can regenerate just that segment under the constraint of the surrounding context — which is precisely the technical foundation for Plan-and-Patch's local repair capability.

Experimental Results: Diffusion Models Excel at Plan Repair

The research team compared two 8B-scale models: DreamReasoner-8B as the diffusion planner and Qwen3-8B as the autoregressive (AR) planner.

Plan Repair Without Task-Specific Training

On the Natural Plan benchmark with no task-specific training, the diffusion model demonstrated a significant advantage:

  • Diffusion model plan repair success rate: 53.7%
  • Autoregressive model plan repair success rate: 27.0%

The diffusion model's repair success rate was nearly twice that of the autoregressive model. This result directly validates the framework's core design premise — the mask-based local repair mechanism is far more robust than global regeneration when handling plan modifications.

What is Natural Plan? Natural Plan is a planning benchmark proposed by Google to evaluate language models' planning capabilities. It includes real-world tasks such as trip planning, meeting scheduling, and calendar management. Each problem requires the model to produce a multi-step plan satisfying multiple constraints, which are verified programmatically to eliminate subjective bias. The benchmark is notably challenging because constraints are complex and interdependent — even if individual steps are correct, global constraint violations can invalidate the entire plan. In Plan-and-Patch's experimental setup, "without task-specific training" means the pretrained model is tested zero-shot or few-shot, providing a cleaner signal of the model's intrinsic planning and repair mechanism rather than domain-specific fitting from training data.

Generation Speed Advantage After Task Training

After task-specific training on two agentic benchmarks — ALFWorld and TextCraft — the picture shifted. Both planners achieved similar plan generation success rates, with training closing the gap.

However, the diffusion model maintained a clear advantage in latency: compared to the autoregressive model, the diffusion planner reduced average plan generation latency by 39%–46%. For long-horizon agents that repeatedly plan and replan, a nearly 50% reduction in generation latency translates directly into faster decision cycles and higher overall execution efficiency.

What This Research Means

The value of Plan-and-Patch lies in how it precisely maps two properties of diffusion language models — the speed gains from parallel generation and the local editability from mask-and-fill — onto the real requirements of agentic planning.

For a long time, autoregressive models have dominated language modeling, while diffusion language models have remained largely in the exploratory phase. This research provides a concrete and compelling use case: in long-horizon tasks that require continuous correction during execution, the structured, locally repairable nature of diffusion models may matter more than raw generation quality.

Looking at the results, diffusion models don't comprehensively outperform autoregressive models on plan generation success rate — after training, the two are comparable. Their true differentiating advantage shows up in repair success rate and generation latency. This suggests that when evaluating agentic planners, we shouldn't focus solely on one-shot generation accuracy — the ability and efficiency to iteratively revise plans in dynamic environments matters just as much.

Summary

Plan-and-Patch offers a faster plan generation and more effective plan repair framework for long-horizon agents. The core contributions can be summarized as: using diffusion language models' parallel unmasking to generate structured plans, and applying local repair by preserving the prefix and suffix while filling in only the selected regions. Experimental results show this approach achieves nearly twice the plan repair success rate of autoregressive alternatives, while reducing generation latency by roughly 40–50%.

As agentic applications move beyond simple question answering toward complex multi-step task execution, efficiently and robustly handling dynamic plan revisions will become a critical capability. Plan-and-Patch's answer to this challenge is well worth continued attention from the research and engineering community.

#diffusion language model#agentic planning#Plan-and-Patch#dLLM#plan repair#autoregressive vs diffusion#long-horizon agent#DreamReasoner#Natural Plan benchmark#AI agent planning
Share:

Related articles