LogicDiff: Logic-Guided Denoising Improves Reasoning

in Masked Diffusion Language Models · 2026

Read LogicDiff: Logic-Guided Denoising Improves Reasoning by in Masked Diffusion Language Models (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2603-26771.txt.

Introduction

Aman introduces LogicDiff, an inference-time method that sharpens reasoning in masked diffusion language models. These models reveal tokens step by step, and the usual trust-based order delays logical connectives, which harms reasoning. A small head reads the base model's hidden states and tags each masked spot by logical role. A scheduler then reveals tokens in dependency order, from premises through steps to the conclusion. On GSM8K, zero-shot accuracy for LLaDA-8B jumps from 22.0% to 60.7%, with under 6% speed cost.

Catalog record

CREATORin Masked Diffusion Language Models
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE14576
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2603.26771

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

LogicDiff: Logic-Guided Denoising Improves Reasoning in Masked Diffusion Language Models Abstract Abstract Masked diffusion language models (MDLMs) generate text by iteratively unmasking tokens from a fully masked sequence, offering parallel generation and bidirectional context. However, their standard confidence-based unmasking strategy systematically defers high-entropy logical connective tokens—the critical branching points in reasoning chains—leading to severely degraded reasoning performance. We introduce LogicDiff , an inference-time method that replaces confidence-based unmasking with logic-role-guided unmasking . A lightweight classification head (4.2M parameters, 0.05% of the base model) predicts the logical role of each masked position—premise, connective, derived step, conclusion, or filler—from the base model’s hidden states with 98.4% accuracy. A dependency-ordered scheduler then unmasks tokens in logical dependency order: premises first, then connectives, then derived steps, then conclusions. Without modifying a single parameter of the base model and without any reinforcement learning or task-specific training, LogicDiff improves LLaDA-8B-Instruct accuracy from 22.0% to 60.7% on GSM8K ( +38.7 pp ) and from 23.6% to 29.2% on MATH-500 ( +5.6 pp ), with less than 6% speed overhead. Our results demonstrate that a substantial portion of the reasoning deficit in MDLMs is attributable to suboptimal token unmasking order, not to limitations of the model’s learned representations. 1 Introduction The dominant paradigm in language modeling uses autoregressive (AR) generation, where tokens are produced left-to-right with each token conditioned on all preceding tokens. A fundamentally different approach has emerged with Masked Diffusion Language Models (MDLMs) [ 10 , 12 , 11 ] , which generate text through iterative denoising: starting from a fully masked sequence, tokens are progressively revealed over multiple steps until the output is complete. MDLMs offer several advantages, including parallel token generation, bidirectional context modeling, and the unique ability to revise previously generated tokens through remasking. Despite these architectural advantages, MDLMs exhibit a striking weakness: they cannot reason effectively. On mathematical reasoning benchmarks, MDLMs dramatically underperform comparably-sized AR models. LLaDA-8B-Instruct [ 10 ] , the largest open MDLM, achieves only {\sim}22\% on GSM8K [ 3 ] , compared to {>}70\% for AR models of similar size. Recent work by Ni et al. 2026 identified the root cause as the Flexibility Trap : MDLMs use confidence-based token selection during denoising, which systematically avoids generating high-entropy tokens in early steps. These high-entropy tokens correspond precisely to logical connective words (“therefore,” “because,” “thus,” “since”) that serve as critical branching points where reasoning chains diverge into distinct solution paths. By deferring these tokens, the model fills in surrounding context first, collapsing the reasoning solution space before the logical structure is established. All existing approaches to this problem require expensive post-training: JustGRPO [ 9 ] forces AR order during RL training ( {\sim}89.1\% GSM8K but requires a full RL pipeline), d1 [ 16 ] and SAPO [ 14 ] modify the model through reinforcement learning, and ATPO [ 2 ] adaptively allocates gradient budget. These methods change the model’s weights and require task-specific training. We propose LogicDiff , a fundamentally different approach: rather than retraining the model, we fix the generation strategy . LogicDiff operates entirely at inference time with three components: 1. A Logic Role Classification Head : a 2-layer MLP (4.2M parameters) that classifies each masked position into five logical roles using hidden states, achieving 98.4% validation accuracy. 2. A Dependency-Ordered Scheduler : unmasks tokens in logical dependency order—premises before connectives before derived steps before conclusions—while preserving parallel generation within each role group. 3. A Priority Scoring Function : a weighted combination of role-based priority and confidence that determines the unmasking order at each step. Without modifying a single parameter of LLaDA-8B-Instruct, LogicDiff improves GSM8K accuracy from 22.0% to 60.7% ( +38.7 pp ) and MATH-500 from 23.6% to 29.2% ( +5.6 pp ). This demonstrates that the MDLM’s knowledge is sufficient for reasoning—the bottleneck was the order in which that knowledge was accessed. An overview of the system is shown in Figure 1 . Figure 1: LogicDiff system architecture. At each denoising step, the frozen LLaDA model produces hidden states and token predictions. The logic role head classifies each masked position. The dependency scheduler computes priority scores and unmasks tokens in logical dependency order. 2 Related Work Masked diffusion language models. MDLMs generate text by iteratively denoising a masked sequence. LLaDA [ 10 ] demonstrated competitive general language performance using a Llama-3 backbone with bidirectional attention. ReFusion [ 8 ] introduced slot-level parallel decoding with AR infilling within slots. Dream [ 4 ] and Block Diffusion [ 1 ] explored hybrid AR–diffusion architectures. A3 [ 5 ] showed that AR models with two-stream attention can rival diffusion models at any-order generation. Reasoning in MDLMs via reinforcement learning. The d1 framework [ 16 ] first integrated policy gradient RL with MDLMs using a mean-field approximation, achieving {\sim}84.5\% on GSM8K. JustGRPO [ 9 ] simplified this by treating the MDLM as an AR model during RL training, reaching 89.1%. SAPO [ 14 ] introduced process-based rewards. ATPO [ 2 ] identified “zones of confusion” and adaptively allocated gradient budget. All require modifying model weights. Inference-time approaches. Diffusion-of-Thought [ 15 ] distributes CoT reasoning across timesteps but requires training from scratch. Diffusion Stitching [ 13 ] uses PRM-scored step selection. Most relevant, DOS [ 17 ] uses attention matrices as dependency proxies. LogicDiff differs fundamentally: we use an explicitly trained classifier predicting semantic logical roles , not statistical attention patterns. Theoretical analysis. Feng et al. 2026 proved MDLMs need \Omega(L) steps for low sequence error rate, suggesting that improving unmasking order is a promising direction. 3 Method 3.1 Preliminaries In MDLMs, given prompt \mathbf{q} , the model initializes \mathbf{x}^{(0)}=[\texttt{MASK}]^{L_{g}} . At step t , it produces \mathbf{H}^{(t)}\in\mathbb{R}^{L\times D} and \mathbf{P}^{(t)}\in\mathbb{R}^{L\times|V|} . Standard decoding unmasks the K positions with highest \mathrm{conf}(i)=\max_{v}P_{i,v} . 3.2 Logic Role Classification Head We introduce f_{\phi}:\mathbb{R}^{D}\rightarrow\mathbb{R}^{R} predicting R{=}5 logical roles: ID Role Definition 0 Premise Given facts, known values, problem conditions 1 Connective Logical links: “therefore,” “so,” “because” 2 Derived Computed or inferred values 3 Conclusion Final answer or result 4 Filler Articles, punctuation, formatting Architecture (2-layer MLP with input LayerNorm): f_{\phi}(\mathbf{h})=W_{2}\cdot\mathrm{Dropout}\!\big(\mathrm{GELU}(W_{1}\cdot\mathrm{LayerNorm}(\mathbf{h})+b_{1})\big)+b_{2} (1) W_{1}{\in}\mathbb{R}^{(D/4)\times D} , W_{2}{\in}\mathbb{R}^{R\times(D/4)} . For LLaDA-8B ( D{=}4096 , R{=}5 ): {\sim}4.2 M params (0.05% of base). Training data. Two-pass labeling of 7,473 GSM8K solutions (891,432 tokens): (1) sentence-level role classification; (2) token-level connective override. Distribution: Derived 93.6%, Conclusion 3.9%, Connective 1.3%, Premise 0.8%, Filler 0.4%. Class-weighted CE with 10 \times for Connective . Training. Base model frozen. Random masking, forward pass, train f_{\phi} on hidden states. 30 min on 1 \times H100. 98.4% validation accuracy. 3.3 Dependency-Ordered Scheduler Priority score for masked position i : \mathrm{priority}(i)=w_{r}\cdot\frac{\mathrm{role\_order}(r_{i})}{R-1}+w_{c}\cdot\big(1-\mathrm{conf}(i)\big) (2) \mathrm{role\_order} : Premise {=}0 , Connective {=}1 , Derived {=}2 , Conclusion {=}3 , Filler {=}4 . We use w_{r}{=}0.7 , w_{c}{=}0.3 . Select K=\lceil L_{g}/N\rceil lowest-priority positions per step. Figure 2: Unmasking order comparison. Top: Default confidence-based unmasking generates numbers first and defers connectives (“so”) to the last step—reasoning direction is locked prematurely. Bottom: LogicDiff unmasks premises first, then connectives, then derived results, then conclusions, establishing logical structure before committing to values. 3.4 Generation Algorithm Algorithm 1 LogicDiff Generation 0: Prompt \mathbf{q} , frozen model M_{\theta} , role head f_{\phi} , steps N , length L_{g} 1: \mathbf{x}\leftarrow[\mathbf{q};\ \texttt{MASK}^{L_{g}}] {Initialize} 2: K\leftarrow\lceil L_{g}/N\rceil {Tokens

Read the complete text