CARVE: Verified Expansion for Variable-Length Generation in Diffusion Language Models
cs.AI
Submitted: 2026-08-31
Updated: 2026-08-31
Comments: EMNLP 2026 Findings
Code: https://github.com/wailji/CARVE
License: http://creativecommons.org/licenses/by/4.0/
The gist: Masked diffusion language models predict tokens from a partially observed response canvas, enabling bidirectional conditioning and parallel token refinement.
Terminology
Abstract
Masked diffusion language models predict tokens from a partially observed response canvas, enabling bidirectional conditioning and parallel token refinement. Yet standard masked-diffusion decoders use a rigid inference interface: the number of masked positions allocated to the answer is fixed before generation begins. Choosing this length is difficult. A short canvas can truncate reasoning or code, while a long canvas wastes computation and can perturb denoising. We introduce CARVE (Counterfactual-Aware Reveal with Verified Expansion), a training-free variable-length algorithm for masked diffusion LMs. Starting from a shorter canvas, CARVE can grow the response during decoding by inserting additional [MASK] positions. Rather than keeping every insertion, CARVE tests a candidate expanded canvas and asks a counterfactual question: would the model make similar predictions for the unresolved positions in the original canvas if the extra masked space were present? The inserted masks are kept only when they induce low Jensen-Shannon (JS) divergence on aligned unresolved positions. This makes length growth a verified stability decision rather than a pure confidence heuristic. CARVE applies without retraining to both full-canvas and blockwise diffusion decoders. Across code generation and mathematical reasoning benchmarks, CARVE consistently improves average performance over fixed-length baselines across all evaluated model families. Crucially, CARVE achieves these accuracy gains while reducing inference cost, reaching half the FLOPs of fixed-length decoding in some settings.
Sources
- Program Synthesis with Large Language Models
- Evaluating Large Language Models Trained on Code
- Improving Variable-Length Generation in Diffusion Language Models via Length Regularization
- Training Verifiers to Solve Math Word Problems
- Edit Flows: Flow Matching with Edit Operations
- Any-Order Flexible Length Masked Diffusion
- DreamOn: Diffusion Language Models For Code Infilling Beyond Fixed-size Canvas
- Beyond Fixed: Training-Free Variable-Length Denoising for Diffusion Large Language Models
- $\rho$-$\texttt{EOS}$: Training-free Bidirectional Variable-Length Control for Masked Diffusion LLMs
- Dream 7B: Diffusion Large Language Models
- Discrete Diffusion Modeling by Estimating the Ratios of the Data Distribution
- A Reparameterized Discrete Diffusion Model for Text Generation
- Diffusion Language Models Are Natively Length-Aware
Related papers
- MAVEN-T: Reinforced Heterogeneous Distillation for Real-Time Multi-Agent Trajectory Prediction
- Model Discovery Agent: LLM-assisted Bayesian experiment design for data-efficient discovery of mechanistic world models
- Agents' Last Exam
- The Clinician's Veto: Navigating Trust, Liability, and Uncertainty in Autonomous AI Prescribing
- MindHelper: Closed-Loop Embodied Mental-State Reasoning for Precision Intervention
- Incumbent Advantage: Brand Bias and Cognitive Manipulation Dynamics in LLM Recommendation Systems