NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

CORE: Context-Robust Remasking for Diffusion Language Models

Kevin Zhai, Sabbir Mollah, Zhenyi Wang, Mubarak Shah

Masked Diffusion Models (MDMs) offer a compelling alternative to standard autoregressive generation by allowing parallel, iterative unmasking of text. However, they suffer from a critical flaw known as context rigidity. CORE (Context-Robust Remasking) is a training-free, inference-time framework designed to fix this issue. By identifying and re-evaluating "context-brittle" tokens, CORE significantly improves performance in structured tasks, boosting code generation accuracy by up to 9.2%.

The Problem: Context Rigidity in MDMs

In the early stages of MDM generation, the model must choose tokens while most of the sequence is still hidden (masked). A model might pick a token with high confidence based on that sparse information. However, as the rest of the context fills in, that early choice might become a logical or structural dead end.

Standard MDMs lack a mechanism to "look back" and fix these early mistakes. This creates a cascade effect where initial inconsistencies misguide the remaining generation. While existing revision methods try to help by remasking tokens with low confidence scores, these signals are often stale—a token that looked certain under an ambiguous partial context might be completely wrong once the full sentence is visible.

The CORE Methodology

CORE shifts the focus from static uncertainty to contextual robustness. Instead of asking, "How confident was the model when it picked this token?", CORE asks, "How stable is this token if the surrounding context changes?"

Key technical components include:

  • The Stress Test (Perturbation): CORE performs a "load-bearing test" on generated tokens. It selects a candidate set of tokens and masks their surrounding context to see if their probability collapses.
  • Instability Scores: Tokens that show the highest drop in likelihood under these context shifts are labeled "context-brittle" and prioritized for revision.
  • Efficient Approximation: To keep computational costs low, CORE uses a "margin-based proxy"—identifying tokens where the top two choices were closely contested—to select candidates for the stress test. It then evaluates the instability of these candidates in a single additional forward pass.
  • Robust Optimization: The framework is mathematically formalized as a distributionally robust optimization problem, targeting "worst-case" context shifts to ensure the final output is internally consistent.

Key Insights

  • Brittleness vs. Uncertainty: The core "aha moment" of the paper is that a token can be high-confidence but brittle. In structured domains like coding, an early wrong choice (like a variable name or a bracket) forces the model to generate subsequent tokens that conform to a flawed structure. CORE breaks this cycle.
  • Structural Sensitivity: Gains are most dramatic in code generation because code has strict syntax. A single inconsistent token under perturbation stands out much more clearly than in a semantically flexible prose sentence.
  • Training-Free & Plug-and-Play: CORE requires no retraining or fine-tuning. It is a purely algorithmic improvement to the decoding process, making it highly accessible for existing diffusion-based LLMs.

Performance and Results

The researchers evaluated CORE across rigorous benchmarks testing reasoning and structural consistency, including Code Generation (HumanEval, MBPP), Mathematical Reasoning (GSM8K, MATH), General Reasoning (BBH), and Combinatorial Tasks (Sudoku).

  • Significant Accuracy Boosts: On the LLaDA-8B-Base model, CORE improved MBPP accuracy by 9.2% and HumanEval by nearly 5% compared to standard decoding.
  • Outperforming Baselines: CORE consistently beat compute-matched baselines (like ReMDM). Simply giving a standard model more decoding steps didn't help as much as CORE’s targeted revisions.
  • Architecture Agnostic: The instability metric transferred seamlessly to the Dream-7B model, yielding a ~9% absolute improvement on code benchmarks without any heuristic retuning.
  • Minimal Overhead: The improvements come at a cost of only about 6% more forward passes, a small price for the significant jump in reliability.

Limitations and Future Work

While CORE is excellent at ensuring the model's output is internally consistent (e.g., fixing syntax errors or logical contradictions within the text), it does not necessarily guarantee external factual correctness, meaning it cannot entirely prevent real-world hallucinations.

Furthermore, on the highly combinatorial Sudoku task, CORE did not improve over the base model. The authors note that if the underlying model lacks the "sequential depth" to solve a complex combinatorial problem, revision alone cannot find a valid solution path that wasn't there to begin with. Future directions may include extending this robustness framework to address external factual grounding and exploring more sophisticated ways to simulate context shifts.

Summary updated

BibTeX
@inproceedings{zhai2026core,
  author = {Kevin Zhai and Sabbir Mollah and Zhenyi Wang and Mubarak Shah},
  title = {{CORE: Context-Robust Remasking for Diffusion Language Models}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=bmKHxLWkz9},
}

Loading related content...

Figure