{"id": "http://arxiv.org/abs/2607.15200v1", "title": "Mask-Aware Policy Gradients for Diffusion Language Models", "abstract": "Reinforcement learning has proven effective for improving reasoning in large language models, but extending it to Masked Diffusion Language Models (MDLMs) remains challenging due to the intractability of the log-likelihood estimation. Existing approaches approximate this log-likelihood by modeling only the token predictions, ignoring the order in which positions are unmasked during generation. We observe that MDLM generation involves two decisions at each step: what tokens to place at each masked position and which positions to remask. We formalize this as a two-stage action MDP, showing that the policy gradient naturally decomposes into a token term and a masking term. Combining optimization of both terms leads to state-of-the-art outcomes on mathematical reasoning and coding benchmarks, with scores of 87.1% on GSM8K and 53.4% on MBPP.", "published_at": "2026-07-16T16:57:34+00:00", "source_updated_at": null, "source_url": "https://arxiv.org/abs/2607.15200v1", "source_hash": "cffe2ccffb7323dc7056b5b88b8422eee26f82b656f01a4768ea8bc102633d54", "source_version": "v1", "full_text_available": true, "evidence_kind": "full_text_excerpt", "analysis_scope": "full_text_excerpt", "scope": "core", "topics": ["discrete-diffusion", "reasoning", "post-training"], "code_url": "https://github.com/Haran71/mask-aware-policy-gradients", "has_code": true, "indexable": true, "authors": [], "related_ids": ["http://arxiv.org/abs/2609.04531v1", "http://arxiv.org/abs/2609.04010v1", "http://arxiv.org/abs/2609.00495v1"], "related_work": {"version": "related-work-v1", "status": "not_assessed", "reason": "missing_context", "items": []}, "review": null, "explanations": {}, "full_article_summary": {"format": "research_guide_v14", "analysis_scope": "full_article_map_reduce", "source_hash": "cffe2ccffb7323dc7056b5b88b8422eee26f82b656f01a4768ea8bc102633d54", "source_url": "https://arxiv.org/abs/2607.15200v1", "source_version": "v1", "revision_id": "3abc3e7e0ce51378b727175ef21137cde3e7250ce7b6af4d01a88d304e9c93d6", "canonical_text_hash": "6681534a66a25ae8db40c67478a5de18a624774fd56bcee0d408601e7bb5cd57", "prompt_version": "full-article-research-guide-v14", "sections": {"verdict": {"ru": "Метод убедительно показывает, что оптимизация только вероятностей токенов неполна для masked diffusion language models: явное обучение порядка размаскирования дает устойчивый прирост примерно на 2–4 п.п. при указанных настройках. Однако превосходство установлено лишь на перечисленных задачах, моделях и конфигурациях.", "en": "The method convincingly shows that optimizing token probabilities alone is incomplete for masked diffusion language models: explicitly training the unmasking order yields consistent gains of roughly 2–4 points under the reported settings. Superiority is established only on the listed tasks, models, and configurations."}, "main_idea": {"ru": "Траектория MDLM рассматривается как совместное принятие двух решений: какие токены предсказывать и какие позиции размаскировать. Поэтому policy gradient расширяется masking-компонентом, который напрямую оптимизирует порядок размаскирования без дополнительной архитектуры или прямых проходов.", "en": "An MDLM trajectory is treated as making two coupled decisions: which tokens to predict and which positions to unmask. The policy gradient is therefore extended with a masking component that directly optimizes unmasking order without extra architecture or forward passes."}, "claims": {"ru": "Неразличимый по градиенту токеновый-only подход может пропускать направления, улучшающие награду через выбор позиций. Вероятностное выборочное размаскирование и совместная оптимизация токеновых и позиционных вероятностей повышают качество на математических, кодовых и планировочных задачах. В сравнении со StepMerge прирост обычно составляет 2–4 п.п.; преимущество сохраняется при длинах 128, 256 и 512.", "en": "A token-only approach can have zero gradient along directions that improve reward through position selection. Probabilistic unmasking and joint optimization of token and position probabilities improve results on math, coding, and planning tasks. Compared with StepMerge, gains are usually 2–4 points and persist at lengths 128, 256, and 512."}, "mechanism": {"ru": "Состояние — частично замаскированная последовательность; решения — распределение токенов и множество позиций Uₜ для размаскирования. На шаге токены оцениваются модельными логитами. Множество Uₜ выбирается без возвращения из распределения Plackett–Luce, пропорционального exp(log-likelihood/temperature), после чего выполняется детерминированное повторное маскирование. Лог-правдоподобие траектории включает токеновые и позиционные решения; градиенты возникают только от них, поскольку повторное маскирование детерминировано. GSPO применяет отдельное clipping для token и position ratios; rollout использует блочное semi-autoregressive decoding с температурами 0.9 для токенов и 0.5 для позиций. Основная настройка |Uₜ|=2. Позиционные log-probabilities извлекаются из тех же логитов, поэтому дополнительных параметров и forward passes не требуется. Реализация: LLaDA-8B-Instruct, LoRA rank 128, scale 64, dropout 0.05 на attention и MLP projections, NF4 для замороженной базы, bfloat16 для адаптеров и вычислений, Flash Attention 2. Воспроизведение: (1) взять LLaDA-8B-Instruct без предварительного SFT; (2) добавить указанные LoRA-адаптеры и NF4; (3) генерировать блочные rollout с Plackett–Luce sampling; (4) вычислять token и masking log-ratios; (5) обучать GSPO с раздельным clipping; (6) сравнить с token-only baseline при длинах 128/256/512. Детали reward-конструкции и точной архитектуры GSPO в записях не указаны.", "en": "The state is a partially masked sequence; the decisions are token probabilities and the unmasking set Uₜ. At each step, tokens are scored from the model logits. Uₜ is sampled without replacement from a Plackett–Luce distribution proportional to exp(log-likelihood/temperature), followed by deterministic remasking. The trajectory log-likelihood contains token and position decisions; only these contribute gradients because remasking is deterministic. GSPO uses separate clipping for token and position ratios; rollouts use block-wise semi-autoregressive decoding with temperatures 0.9 for tokens and 0.5 for positions. The main setting is |Uₜ|=2. Position log-probabilities come from the same logits, so no extra parameters or forward passes are needed. Implementation: LLaDA-8B-Instruct, LoRA rank 128, scale 64, dropout 0.05 on attention and MLP projections, NF4 frozen base weights, bfloat16 adapters and computation, and Flash Attention 2. Reproduction: (1) start from LLaDA-8B-Instruct without prior SFT; (2) add the specified LoRA adapters and NF4; (3) generate block-wise rollouts with Plackett–Luce sampling; (4) compute token and masking log-ratios; (5) train with GSPO and separate clipping; (6) compare against a token-only baseline at lengths 128/256/512. Reward-construction details and the exact GSPO architecture are not specified in the records."}, "evidence": {"ru": "Авторы сообщают 87.1% на GSM8K и 53.4% на MBPP при длине 128 с LLaDA-8B-Instruct. На GSM8K, MATH500, HumanEval и MBPP метод превосходит перечисленные baselines при длинах 128, 256 и 512; против StepMerge заявлен стабильный прирост около 2–4 п.п. На GSM8K он достигает 74% в 1.9 раза быстрее SPG и достигает финального уровня SPG примерно за 15 вместо 18 часов на 8 H100. На Sudoku, Countdown и Dream-7B также сообщены преимущества, включая до 3.1 и 2.9 п.п. соответственно. Увеличение |Uₜ| до 8 снижает GSM8K не более чем на 1 п.п. DCoLT требует примерно 800 GPU-hours против около 160, но работает с большей reported steps/hour. Эти данные подтверждают заявленные улучшения в условиях экспериментов, но не устанавливают универсальное превосходство или переносимость за их пределы.", "en": "The authors report 87.1% on GSM8K and 53.4% on MBPP at length 128 with LLaDA-8B-Instruct. On GSM8K, MATH500, HumanEval, and MBPP, the method outperforms the listed baselines at lengths 128, 256, and 512; against StepMerge, the reported gain is consistently about 2–4 points. On GSM8K it reaches 74% 1.9× faster than SPG and reaches SPG’s final accuracy in about 15 rather than 18 hours on 8 H100s. Advantages are also reported on Sudoku, Countdown, and Dream-7B, including up to 3.1 and 2.9 points respectively. Increasing |Uₜ| to 8 lowers GSM8K by at most 1 point. DCoLT requires roughly 800 GPU-hours versus about 160, while reporting higher steps/hour. These results support the claimed improvements under the experimental conditions but do not establish universal superiority or out-of-distribution transfer."}, "applicability": {"ru": "Подход полезен для masked diffusion LMs, где порядок размаскирования влияет на итоговую награду, особенно в математическом reasoning, генерации кода и дискретном планировании. Он привлекателен при необходимости улучшить качество без добавления позиционной сети и при наличии reward-сигнала для policy-gradient обучения. Он также применим к моделям, совместимым с LoRA и блочным diffusion decoding.", "en": "The approach is useful for masked diffusion LMs where unmasking order affects final reward, especially for mathematical reasoning, code generation, and discrete planning. It is attractive when quality must improve without adding a position-specific network and when a reward signal is available for policy-gradient training. It also applies to models compatible with LoRA and block-wise diffusion decoding."}, "limitations": {"ru": "Доказательства ограничены перечисленными моделями, benchmark-задачами, длинами и настройками rollout. Улучшение зависит от совместной оптимизации и, вероятно, от корректного reward-сигнала; records не показывают, как метод ведет себя при других reward-функциях, масштабах, бюджетах или полностью autoregressive моделях. Не указаны точные детали reward-конструкции, полная конфигурация GSPO и статистическая неопределенность результатов. Снижение качества при |Uₜ|=8 невелико, но показывает чувствительность к размеру множества.", "en": "Evidence is limited to the listed models, benchmarks, lengths, and rollout settings. Improvement depends on joint optimization and likely on an appropriate reward signal; the records do not show behavior under other rewards, scales, budgets, or fully autoregressive models. Exact reward construction, the full GSPO configuration, and statistical uncertainty are not provided. The small degradation at |Uₜ|=8 indicates some sensitivity to unmasking-set size."}, "next_action": {"ru": "Провести контролируемую репликацию на LLaDA-8B-Instruct: (1) воспроизвести token-only и joint token+masking GSPO с одинаковыми seed и budget; (2) оценить GSM8K, MATH500 и MBPP при длинах 128/256/512; (3) сделать абляцию |Uₜ| и температур; (4) сравнить качество, wall-clock и GPU-hours; (5) проверить перенос на Dream-7B. Главный критерий — подтвердить устойчивый прирост masking-компонента при равном вычислительном бюджете.", "en": "Run a controlled replication on LLaDA-8B-Instruct: (1) reproduce token-only and joint token+masking GSPO with matched seeds and budgets; (2) evaluate GSM8K, MATH500, and MBPP at lengths 128/256/512; (3) ablate |Uₜ| and temperatures; (4) compare accuracy, wall-clock time, and GPU-hours; (5) test transfer to Dream-7B. The main criterion is whether the masking component retains a robust gain at equal compute."}}, "source_coverage": {"canonical_text_hash": "6681534a66a25ae8db40c67478a5de18a624774fd56bcee0d408601e7bb5cd57", "covered_chunks": 7, "map_input_digest": "bbf8270cd6d95a020c2d523866533ad8d420bed125a7696fc2b25e67f995746b", "prompt_version": "full-article-research-guide-v14", "revision_id": "3abc3e7e0ce51378b727175ef21137cde3e7250ce7b6af4d01a88d304e9c93d6", "total_chunks": 7}}, "resources": {"version": "paper-resources-v1", "source_hash": "cffe2ccffb7323dc7056b5b88b8422eee26f82b656f01a4768ea8bc102633d54", "evidence_kind": "full_text_excerpt", "availability": "not_checked", "limited": false, "items": [{"origin": "source_excerpt", "evidence": "ve to autoregressive LLMs, replacing the fixed left-to-right generation\norder with iterative unmasking from a fully masked sequence (Hoogeboom et al., 2022; Kim\net al., 2025). This enables parallel decoding and flexible generation orderings, and MDLMs\n\n∗Equal contribution.\n1Code available at https://github.com/Haran71/mask-aware-policy-gradients\n\n1\n\n### arXiv:2607.15200v1 [cs.CL] 16 Jul 2026\n\n## Page 2\n\nPublished as a conference paper at COLM 2026\n\n### [MASK]\n\n### [MASK]\n\n### [MASK]\n\n### [MASK]\n\n### A\n\ncat\n\non\n\ntree\n\n### A\n\n### [MASK]\n\n### [MASK]\n\n### [MASK]\n\n### A\n\nbook\n\non\n\ndiffusion\n\n### A\n\n### [MASK]\n\non\n\ndiffusion\n\n### A\n\npaper", "url": "https://github.com/Haran71/mask-aware-policy-gradients", "kind": "code", "span": [2523, 3163], "evidence_hash": "39ea562ea29ece3d5a846ceb477104bf4cdb244b4abd2b7cc00a36f7ab119fd0"}, {"origin": "source_excerpt", "evidence": "hkin,\nChong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, et al. Training language\nmodels to follow instructions with human feedback.\nAdvances in neural information\nprocessing systems, 35:27730–27744, 2022b.\n\nJiayi Pan, Junjie Zhang, Xingyao Wang, Lifan Yuan, Hao Peng, and Alane Suhr. Tinyzero.\nhttps://github.com/Jiayi-Pan/TinyZero, 2025. Accessed: 2025-01-24.\n\n12\n\n## Page 13\n\nPublished as a conference paper at COLM 2026\n\nFred Zhangzhi Peng, Zachary Bezemek, Sawan Patel, Jarrid Rector-Brooks, Sherwood Yao,\nAvishek Joey Bose, Alexander Tong, and Pranam Chatterjee. Path planning for masked\ndiffusion model sampling. arXiv preprint", "url": "https://github.com/Jiayi-Pan/TinyZero", "kind": "code", "span": [40403, 41043], "evidence_hash": "4f7b707a887c165883488d849e3f50b5daa090693994a5960b0867e2ed821a6e"}]}, "slug": "2607.15200-mask-aware-policy-gradients-for-diffusion-language-models"}