Planner Aware Path Learning in Diffusion Language Models Training

Zhangzhi Peng, Zachary Bezemek (Faculty · Duke University), Jarrid Rector-Brooks, Shuibai Zhang, Michael Bronstein, Anru Zhang, Joey Bose, Alexander Tong

International Conference on Learning Representations 2026 · Oral

Overview

This talk, presented by Zachary Bezemek from Duke University and his collaborators, introduces Planner Aware Path Learning (PAPL), a novel approach to address a critical objective misalignment in Masked Diffusion Language Models (MDLMs). While MDLMs have demonstrated state-of-the-art performance in specific domains like protein sequence generation and code generation, their standard training objective often assumes a uniform random selection of positions for denoising during inference. However, practical applications frequently employ more sophisticated, "planned" inference strategies, such as greedy ancestral sampling, to achieve better performance. This discrepancy creates a fundamental mismatch between what the model is trained to optimize and how it is ultimately used.

Watch on SlidesLive

Visual summary for Planner Aware Path Learning in Diffusion Language Models Training by Zhangzhi Peng, Zachary Bezemek, Jarrid Rector-Brooks, Shuibai Zhang, Michael Bronstein, Anru Zhang, Joey Bose, Alexander Tong
Visual summary for Planner Aware Path Learning in Diffusion Language Models Training by Zhangzhi Peng, Zachary Bezemek, Jarrid Rector-Brooks, Shuibai Zhang, Michael Bronstein, Anru Zhang, Joey Bose, Alexander Tong

Key moments

  1. 0:00 Introduction to MDMs and objective misalignment problem
  2. 2:00 Vanilla MDM's uniform sampling leads to objective misalignment
  3. 4:00 Introducing planner function and the proposed PAPL fix
  4. 5:00 Practical implementation of PAPL with soft-greedy planner
  5. 6:00 Significant performance gains in code and protein generation
  6. 7:00 Key takeaways: loss must match intended sampling scheme
  7. 8:00 Q&A: No asymptotic overhead for training

Planner Aware Path Learning in Diffusion Language Models Training

Speakers: Zhangzhi Peng, Zachary Bezemek (Faculty, Duke University), Jarrid Rector-Brooks, Shuibai Zhang, Michael Bronstein, Anru Zhang, Joey Bose, Alexander Tong

Conference: ICLR 2026

YouTube: https://slideslive.com/39062137

Overview

This talk, presented by Zachary Bezemek from Duke University and his collaborators, introduces Planner Aware Path Learning (PAPL), a novel approach to address a critical objective misalignment in Masked Diffusion Language Models (MDLMs). While MDLMs have demonstrated state-of-the-art performance in specific domains like protein sequence generation and code generation, their standard training objective often assumes a uniform random selection of positions for denoising during inference. However, practical applications frequently employ more sophisticated, "planned" inference strategies, such as greedy ancestral sampling, to achieve better performance. This discrepancy creates a fundamental mismatch between what the model is trained to optimize and how it is ultimately used.

The core contribution of PAPL is a simple yet highly effective modification to the MDLM training loss that explicitly incorporates the chosen inference planning mechanism. By aligning the training objective with the planned generation process, PAPL enables the model to learn paths that are consistent with how it will be deployed, leading to substantial performance improvements. The speakers demonstrate that this two-line code modification yields significant gains, including a 21% increase in pass@10 for code generation and a 17% boost in foldability for protein sequence generation, even surpassing larger state-of-the-art models. This work highlights the crucial interplay between training objectives and inference schemes in generative models, particularly when dealing with complex, non-causal sequence generation tasks.

Background

▶ Watch: Introduction to MDMs and objective misalignment problem (0:00)

Masked Diffusion Language Models (MDLMs) represent a powerful class of generative models, particularly effective in domains where a natural causal ordering of tokens is absent or where bidirectional context is crucial, such as protein sequence generation and code generation. Unlike auto-regressive models that generate tokens sequentially, MDLMs operate by iteratively denoising a fully masked sequence, gradually revealing the complete data point. This process is often conceptualized through a discrete-time generator matching framework, where the goal is to train a model to approximate a Markov chain that starts from an all-masked state and, in a number of steps equal to the sequence length, converges to the target data distribution.

In the vanilla MDLM training setting, the process involves taking a data point and masking coordinates independently with a probability determined by a scheduler. Crucially, during training, the choice of which position to denoise next is typically made uniformly at random. The underlying objective is an ELBO (Evidence Lower Bound), which effectively minimizes the KL divergence between the entire paths of a chosen reference chain (an oracle that generates the data) and the model's generation dynamics. This principled loss ensures that if the model's generation dynamics perfectly match the oracle, its terminal distribution will approximate the data distribution.

However, a fundamental problem arises in practice: while the training assumes uniform random selection, inference often employs more sophisticated planning mechanisms. For instance, a greedy ancestral planner might independently sample denoised tokens for all masked positions and then choose to apply the one with the highest logit score. This planning strategy aims to improve downstream task performance by guiding the generation process more effectively than uniform random selection. The critical flaw is that when such a planner is introduced at inference time, the model's one-step transitions diverge significantly from what was assumed during training. The ELBO, which was derived under the assumption of uniformly random position selection, no longer holds, leading to an objective misalignment where a model with a small training loss might still produce samples far from the true data distribution when used with a planner. This mismatch between training and inference dynamics forms the core problem that Planner Aware Path Learning seeks to resolve.

Key Findings

▶ Watch: Introducing planner function and the proposed PAPL fix (4:00)

The central discovery of this work is the identification and principled solution to the objective misalignment inherent in vanilla Masked Diffusion Language Models (MDLMs) when combined with advanced inference strategies. The speakers highlight that while vanilla MDLM training minimizes an ELBO based on uniformly random position selection, practical inference often employs a planner (e.g., greedy ancestral) to improve generation quality. This mismatch means the model's training objective no longer accurately reflects its real-world usage, leading to suboptimal performance despite a low training loss.

The key contribution, Planner Aware Path Learning (PAPL), directly addresses this misalignment. PAPL proposes a novel modification to the MDLM training loss that explicitly incorporates the chosen inference planner into the conditional reference chain used for training. Instead of training against an oracle that assumes uniform random choices, PAPL trains against an oracle that is "supervised" by the data point and informed by the planner. This ensures that the model learns to generate paths that are consistent with the planned inference strategy, rather than the simplified uniform random approach.

The practical implementation of PAPL is remarkably efficient, requiring only a two-line code modification to the standard MDLM training pipeline. This modification involves calculating specific weights for masked positions using a soft greedy planner (a softmax over denoiser logits with a temperature parameter) and then using these weights to re-weight the masks during loss calculation. Further practical refinements include detaching gradients from the planner to stabilize training and interpolating with the vanilla loss to prevent mode collapse.

The efficacy of PAPL is demonstrated through significant performance gains across challenging sequence generation tasks:

  • For code generation, PAPL achieves a 21% gain in pass@10, a crucial metric for evaluating the correctness and functionality of generated code.
  • In protein sequence generation, PAPL yields a 17% gain in foldability, indicating a substantial improvement in the biological viability and structural integrity of the generated protein sequences.
  • Crucially, these performance improvements were achieved with minimal hyperparameter tuning for code generation, and in protein generation, PAPL models were able to surpass state-of-the-art models of a larger size class, underscoring the efficiency and power of this targeted objective alignment.

These findings collectively establish PAPL as a critical advancement for MDLMs, enabling them to leverage sophisticated inference planners more effectively by bridging the gap between training objectives and practical deployment.

Technical Deep Dive

▶ Watch: Practical implementation of PAPL with soft-greedy planner (5:00)

The technical foundation of this work lies in the discrete-time generator matching formulation for Masked Diffusion Language Models (MDLMs). In this framework, we consider sequences of length L from a finite vocabulary, aiming to train a model to approximate a Markov chain that starts from a fully masked sequence and, over L steps, generates a sequence distributed according to the data. The core idea is to define a continuous discrete-time Markov chain, conditional on each data point, that at its terminal time is equal to that data point with probability one.

In the vanilla MDLM setting, the one-step transitions of the oracle chain implicitly assume a decomposition where, at a given sequence X, the probability of unmasking the i-th position to token Y_i is the product of choosing the i-th position to denoise (uniformly at random) and then selecting Y_i based on the data distribution. The training loss is an ELBO, specifically the expected KL divergence between the entire paths of this oracle reference chain and the model's generation dynamics. The gradients of this loss are designed to match the paths of the oracle to the generation process, which implicitly relies on the assumption of uniformly random position selection at each step.

The problem arises when an explicit planner function G is introduced at inference time. Instead of uniformly random selection, the planner takes independent samples from the denoiser for all masked coordinates, along with the partially masked sequence, and outputs a distribution over the masked positions. From this distribution, a position is sampled to be denoised. A common example is greedy ancestral planning, where the position with the largest logit from the denoiser is chosen. This modification fundamentally alters the one-step transitions of the generation process, meaning the original ELBO derived under uniform random sampling no longer holds. A model trained with the vanilla loss might achieve a low KL divergence with the uniform random oracle, but its actual generation process with a planner could be far from the data distribution.

The Planner Aware Path Learning (PAPL) solution involves a crucial redefinition of the conditional reference chain. Instead of matching the model's generation paths to a uniformly random oracle, PAPL matches them to an oracle that itself is informed by the planner and the true data distribution. This is achieved by inputting the actual data point (X_0) into the planner during training, effectively creating a supervised planner oracle. This new oracle chain still generates X_0 with probability one after L steps, but its intermediate path decisions are guided by the planner, using the true data distribution in place of the denoiser's output.

When the KL divergence for PAPL is expanded, it reveals two key differences from the vanilla loss:

  1. The weights for the masked positions are no longer uniform but are now derived from the data-informed planner. This means the loss focuses more on correctly predicting tokens at positions that the planner would prioritize.
  2. An additional term emerges, which aims to match the effective planner under the denoiser to the data-informed planner. This term directly encourages the denoiser to produce outputs that align with the planner's decisions.

For practical implementation, the speakers identified several challenges with a strict greedy ancestral planner: it leads to deterministic paths, requires evaluating the denoiser for every possible masked position, and the planner matching term was found to be unstable. To address this, PAPL employs a soft greedy planner which uses a softmax with temperature tau over the denoiser's logits for masked positions to generate the re-weighting. This softens the deterministic choice and allows for tuning the degree of "greediness." Furthermore, to stabilize training and simplify the loss, gradients are detached from the planner, effectively removing the unstable planner matching term. Finally, to discourage mode collapse, the PAPL loss is interpolated with the vanilla loss.

The resulting "two-line code modification" to the vanilla MDLM training involves:

  1. Calculating a weights tensor by applying a softmax with temperature tau to the denoiser's logits corresponding to the masked positions of the partially masked sequence.
  2. Using these weights to re-weight the contributions of different masked positions in the final loss calculation, effectively guiding the model to prioritize learning the parts of the sequence that the planner would emphasize.

This elegant modification ensures that the model is trained with an objective that is intrinsically aware of and aligned with the planned inference strategy, leading directly to the observed performance improvements.

Experimental Setup & Results

▶ Watch: Key takeaways: loss must match intended sampling scheme (7:00)

The effectiveness of Planner Aware Path Learning (PAPL) was rigorously evaluated across two distinct and challenging sequence generation domains: code generation and protein sequence generation. These domains were specifically chosen because Masked Diffusion Language Models (MDLMs) have demonstrated state-of-the-art performance in them, often surpassing traditional auto-regressive models, partly due to the lack of a strong natural causal ordering and the need for bidirectional context.

For code generation, the performance was measured using pass@10, a standard metric that evaluates the correctness of generated code by checking if at least one out of ten generated samples passes a set of unit tests. The speakers reported a significant 21% gain in pass@10 when applying the PAPL modification. This improvement was achieved with remarkable efficiency, requiring no hyperparameter tuning or additional complexity beyond the core two-line code change. This suggests that the PAPL approach is robust and immediately beneficial for this task.

In protein sequence generation, the key performance metric was foldability. This metric assesses the likelihood that a generated protein sequence would fold into a stable, functional three-dimensional structure, which is crucial for biological utility. PAPL delivered a substantial 17% gain in foldability. A particularly compelling result was that the PAPL models were able to surpass the state-of-the-art models of a larger size class that had been trained without this planner-aware objective. This highlights not only the efficacy of PAPL in improving generation quality but also its potential to achieve superior results with more compact models, offering advantages in terms of computational resources and deployment.

The experimental setup for PAPL itself involved a few practical considerations:

  • Soft Greedy Planner: Instead of a strictly greedy ancestral planner, a soft greedy planner was used. This involves applying a softmax with temperature tau to the denoiser's logits for all masked positions. This provides a probability distribution over which position to denoise next, making the planning less deterministic and more amenable to gradient-based learning. The temperature tau is a tuneable hyperparameter, allowing control over the "greediness" of the planner.
  • Gradient Detachment: To ensure stability during training, gradients were detached from the planner. This simplifies the loss by effectively removing the "planner matching term" that emerged from the full KL divergence expansion, which was found to be unstable in practice.
  • Interpolation with Vanilla Loss: To prevent mode collapse, which can occur when a model becomes too focused on a narrow set of high-probability outputs, the PAPL loss was interpolated with the vanilla MDLM loss. This maintains some regularization from the original objective while still benefiting from the planner-aware guidance.

Overall, the experimental results unequivocally demonstrate that aligning the training objective with the inference planning mechanism, even with minimal code changes and practical approximations, leads to substantial and impactful improvements in the quality of generated sequences across diverse and complex domains.

Practical Implications

▶ Watch: Q&A: No asymptotic overhead for training (8:00)

The introduction of Planner Aware Path Learning (PAPL) carries significant practical implications for various stakeholders involved in the development and deployment of AI/ML models, especially those working with generative sequence models.

For practitioners and model builders, PAPL offers a clear pathway to unlock superior performance in domains where Masked Diffusion Language Models (MDLMs) excel, such as code and protein sequence generation. The most compelling aspect is the minimal effort required: a two-line code modification can yield substantial gains (e.g., 21% pass@10 for code, 17% foldability for proteins). This means model developers can achieve state-of-the-art results without needing to redesign entire architectures or embark on extensive hyperparameter searches, making advanced generative capabilities more accessible and efficient to implement. The ability to surpass larger, existing state-of-the-art models with this targeted improvement also suggests that PAPL can lead to more efficient models, potentially reducing the computational footprint for deployment.

For infrastructure teams and those concerned with model training overhead, PAPL presents an attractive solution because it introduces no asymptotic overhead on training. The calculations for the soft greedy planner weights are performed as part of the existing forward pass, and the gradient detachment further simplifies the backpropagation. This ensures that the benefits of PAPL do not come at the cost of increased training time or resource consumption, making it a viable upgrade for existing MDLM pipelines.

A key takeaway for anyone building or deploying machine learning models is the profound importance of aligning the training objective with the inference strategy. The talk vividly illustrates that merely having a "principled loss" like the ELBO is insufficient if the assumptions underlying that loss (e.g., uniform random sampling) are violated during actual deployment. Ignoring this misalignment can lead to models that perform poorly in practice despite appearing well-trained. PAPL encourages a holistic view of the model lifecycle, emphasizing that inference schemes are not just post-hoc optimizations but should inform the very design of the training objective.

While PAPL offers significant advantages, it also highlights inherent tradeoffs and limitations in practical ML system design. The decision to use a soft greedy planner with a temperature parameter, to detach gradients from the planner, and to interpolate with the vanilla loss are all engineering compromises made to ensure stability and achieve robust performance. These choices acknowledge that a perfectly theoretically aligned loss might be too complex or unstable to train effectively. Practitioners adopting PAPL might need to tune the tau parameter for their specific tasks and consider the interpolation ratio. Furthermore, while the principle is general, the demonstrated gains are specific to protein and code generation, where bidirectional context is crucial. Its direct applicability and magnitude of improvement in other domains, such as general natural language generation where auto-regressive models are often dominant, might require further investigation. Nevertheless, PAPL provides a powerful template for how to bridge the gap between theoretical objectives and practical deployment in complex generative models.

Key Takeaways

  • Discrete-Time Formulation for MDMs: The discrete-time perspective for Masked Diffusion Language Models (MDLMs) is simpler, more interpretable, and equally effective as continuous-time formulations.
  • Beyond Pointwise Loss: It's insufficient to only consider pointwise correctness or individual token predictions. Mathematical formulations and training losses must account for the full sequence path and the interplay between generation steps.
  • Align Loss with Inference: The training loss implicitly assumes and governs the sampling scheme. If a different sampling scheme (e.g., planned inference) is used at inference time, the training loss must be adapted to avoid objective misalignment.
  • Gradients Matter: Understand what your gradients are actually optimizing. Naively replacing components in the loss without considering the full path matching objective can lead to suboptimal outcomes.
  • Planner Aware Path Learning (PAPL): A simple, two-line code modification to MDLM training loss that incorporates inference planning into the objective.
  • Significant Performance Gains: PAPL achieves substantial improvements (e.g., 21% pass@10 for code, 17% foldability for proteins) with no asymptotic training overhead, often surpassing larger state-of-the-art models.

About the Speaker(s)

The primary speaker for this talk was Zachary Bezemek, who is identified as faculty at Duke University. He presented the work alongside a team of collaborators, including Zhangzhi Peng, Jarrid Rector-Brooks, Shuibai Zhang, Michael Bronstein, Anru Zhang, Joey Bose, and Alexander Tong. The presentation highlighted Zachary's leadership in this research, acknowledging his student "Fred" and the entire team for their contributions to the project.

Reviews

→ Top-rated talks at International Conference on Learning Representations 2026

All talks from International Conference on Learning Representations 2026