DreamOn: Diffusion Language Models For Code Infilling Beyond Fixed-size Canvas
Existing diffusion-based language models for code infilling are constrained by fixed-length masks, limiting their ability to generate variable-length outputs. This work proposes DreamOn, a framework that introduces two lightweight length-control states into the diffusion process, enabling dynamic adjustment of the generated sequence length without modifying the underlying model architecture. Experiments on DreamCoder-7B and DiffuCoder-7B demonstrate that DreamOn achieves performance comparable to state-of-the-art autoregressive models on the HumanEval-Infilling and SantaCoder-FIM benchmarks, while closely approaching the ideal performance attainable when the ground-truth target length is known. These results significantly enhance the practicality of diffusion models for real-world code infilling tasks.