arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2509.01142cs.CL
收藏

Dream-Coder 7B:一种面向代码的开源扩散语言模型

Dream-Coder 7B: An Open Diffusion Language Model for Code

The University of Hong Kong(香港大学);Huawei Noah’s Ark Lab(华为诺亚实验室)

Zhihui Xie, Jiacheng Ye, Lin Zheng, Jiahui Gao, Jingwei Dong, Zirui Wu, Xueliang Zhao, Shansan Gong, Xin Jiang, Zhenguo Li, Lingpeng Kong

AI总结:

本研究提出开源代码离散扩散语言模型Dream-Coder 7B,可自适应选择解码策略,通过定制后训练方案在多个代码基准上取得有竞争力的性能,并开放相关资源以推动后续研究。

摘要:

我们提出了Dream-Coder 7B,这是一款用于代码生成的开源离散扩散语言模型,具备涌现式的任意顺序生成能力。与严格按从左到右解码的传统自回归(AR)模型不同,Dream-Coder 7B会根据编码任务自适应确定解码策略:复杂算法采用先框架后细节的生成方式,简单补全任务采用从左到右生成,代码理解任务采用交错推理生成。我们将预训练的AR检查点适配到离散扩散框架,采用连续时间加权交叉熵目标。我们的后训练方案包括:(1)监督微调,通过随机截断和填充惩罚缓解填充问题,以提升样本效率并稳定生成;(2)基于可验证奖励的强化学习,奖励来自从开源数据集中筛选的高质量提示集,采用为扩散语言模型定制的强化学习方案。最终得到的Dream-Coder 7B Instruct在LiveCodeBench(2410--2505)上取得21.4%的pass@1成绩,在HumanEval、MBPP、BigCodeBench和CRUXEval上也展现出具有竞争力的性能。我们发布了Dream-Coder-7B和Dream-Coder-7B-Instruct的检查点、训练方案、预处理流水线和推理代码,以促进研究复现和进一步探索。

英文摘要:

We present Dream-Coder 7B, an open-source discrete diffusion language model for code generation that exhibits emergent any-order generation capabilities. Unlike traditional autoregressive (AR) models that decode strictly left-to-right, Dream-Coder 7B adaptively determines its decoding strategy based on the coding task: sketch-first generation for complex algorithms, left-to-right generation for straightforward completions, and interleaved reasoning generation for code understanding tasks. We adapt a pretrained AR checkpoint to a discrete diffusion frameworks with a continuous-time weighted cross-entropy objective. Our post-training recipe comprises (i) supervised fine-tuning, where we mitigate padding pathologies via random truncation and a padding penalty to improve sample efficiency and stabilize generation; and (ii) reinforcement learning with verifiable rewards over a curated high-quality prompt set drawn from open-source datasets, using a tailored reinforcement learning recipe for diffusion language models. The resulting Dream-Coder 7B Instruct attains 21.4\% pass@1 on LiveCodeBench (2410--2505) and demonstrates competitive performance on HumanEval, MBPP, BigCodeBench, and CRUXEval. We release Dream-Coder-7B and Dream-Coder-7B-Instruct checkpoints, training recipes, preprocessing pipelines, and inference code to facilitate reproducibility and further research.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑