Inpainting-Guided Policy Optimization for Diffusion Large Language Models

Siyan Zhao, Mengchen Liu, Jing Huang, Miao Liu, Chenyu Wang, Bo Liu, Yuandong Tian, Guan Pang, Sean Bell, Aditya Grover, Feiyu Chen

TL;DR

Inpainting-Guided Policy Optimization (IGPO) leverages the unique bidirectional capabilities of diffusion Large Language Models (dLLMs) to solve the "exploration bottleneck" in reinforcement learning. By strategically injecting partial ground-truth hints into failed reasoning traces, IGPO restores learning signals in scenarios where standard RL would stall, achieving new state-of-the-art results on mathematical reasoning benchmarks for dLLMs.

The Exploration Bottleneck in RL

Reinforcement Learning (RL) is the "secret sauce" behind the advanced reasoning capabilities of modern LLMs. However, RL faces a massive exploration challenge: if a model is asked a difficult math problem and fails to find the correct answer in all its attempts (a "zero-advantage" or "all-wrong" group), the mathematical gradients collapse to zero. The model learns nothing from that episode, wasting precious compute.

While autoregressive models (like GPT-4 or Llama) generate text strictly from left to right, Masked Diffusion LLMs (dLLMs) generate tokens in parallel and can "fill in the blanks" (inpainting). The authors identify that this architectural quirk is a superpower for RL. They aim to use inpainting to bridge the gap between Supervised Fine-Tuning (SFT)—where the model just mimics data—and RL—where the model discovers solutions on its own.

Introducing IGPO: Methods & Innovations

The core contribution of this paper is IGPO, an RL framework that introduces three main innovations to guide exploration:

Masked dLLM Inpainting-Guided Sampling
  1. Elastic Inpainting-Triggered Sampling: In a group-based RL setting (like GRPO), if every sample in a group is incorrect, IGPO triggers a "rescue" mode. It takes a ground-truth reasoning trace, segments it into chunks, and injects a random selection of these chunks as fixed "hints" into the model's generation area. The model then inpaints the missing parts. Only the successful completions are used to update the policy, effectively "guiding" the model toward the high-reward space it couldn't find on its own.
  2. Length-Aligned SFT: Standard reasoning datasets often contain extremely verbose "Chain of Thought" traces that exceed the context limits of current dLLMs. The authors used a teacher model to rewrite these into concise, mathematically rigorous traces. This ensures the model is initialized with a style that fits within its 256–1024 token generation budget.
  3. Entropy-based Gradient Filtering: Injecting ground-truth tokens can cause "off-policy" instability if the model is forced to learn something it is already very confident about (but wrong). IGPO only calculates gradients for the injected hint positions where the model's original uncertainty (entropy) was high, focusing the learning on genuine "decision boundaries."

Datasets

  • SFT Training: A "concise" version of OpenR1-Math-220K (94k problems), rewritten for length alignment.
  • RL Training: MetaMathQA (specifically the "Answer Augmentation" split), providing ~12.8k unique training examples.
  • Evaluation: Four major mathematical benchmarks: GSM8K, Math500, AMC (American Math Competitions), and Minerva.

Key Insights

  • Inpainting as Interpolation: IGPO acts as a middle ground between SFT and RL. Unlike pure SFT, which can suffer from distribution shift, IGPO maintains "on-policy" generation for the non-hinted tokens, making the learning signal more relevant to the model's actual behavior.
  • Solving the Zero-Advantage Dilemma: In group-based RL, reward variance is the engine of progress. By "forcing" some correct answers via hints, IGPO restores the variance needed to generate meaningful gradients. The authors found this reduced "all-wrong" groups by roughly 60%.
  • Conciseness is a Feature, Not a Bug: For dLLMs, which currently lack the KV-cache optimizations of autoregressive models, long-winded reasoning is a liability. Rewriting traces to be concise not only saves compute but actually improves reasoning accuracy by keeping the entire logic within the model's full-attention window.
  • Robustness to Noise: Surprisingly, IGPO is robust to imperfect ground-truth hints. Because the final answer must still be verified as correct, the model effectively filters out "bad advice" from noisy hints during the inpainting process.

State-of-the-Art Mathematical Reasoning

The "full training recipe" (Length-Aligned SFT + IGPO) achieved significant gains over the baseline LLaDA-8B-Instruct, setting new state-of-the-art results for full-attention masked dLLMs.

IGPO Performance and Benchmark Comparisons

Performance improvements across benchmarks include:

  • GSM8K: +5.3% (reaching 86.8%)
  • Math500: +8.4% (reaching 47.4%)
  • AMC: +11.4% (reaching 25.9% avg@16)
  • Minerva: +4.0% (reaching 13.2%)

Qualitatively, the authors showed that IGPO prevents "diversity collapse." While standard GRPO often leads to the model repeating the same few patterns, IGPO's hint-based guidance keeps the exploration space broad and healthy.

Limitations and Future Work

  • Context Window Constraints: The study focused on full-attention dLLMs, which are computationally expensive for very long sequences. Scaling this to multi-thousand-token reasoning traces remains a challenge.
  • Dependency on Ground Truth: IGPO requires access to ground-truth reasoning traces for the inpainting step. While the authors showed robustness to noise, the method still relies on a high-quality "hint" source.
  • Generalization: The paper focuses heavily on mathematics. Future work could explore if inpainting-guided exploration works for other structured tasks like code generation or creative writing.
  • Architecture Evolution: The authors suggest that as dLLM architectures evolve (e.g., incorporating linear attention or better caching), the benefits of IGPO will likely scale further.

Summary updated

BibTeX
@inproceedings{zhao2026inpainting,
  author = {Siyan Zhao and Mengchen Liu and Jing Huang and Miao Liu and Chenyu Wang and Bo Liu and Yuandong Tian and Guan Pang and Sean Bell and Aditya Grover and Feiyu Chen},
  title = {{Inpainting-Guided Policy Optimization for Diffusion Large Language Models}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=haVf5e4Q6C},
}
Figure