Vibeleaderboard
← All Intel
Intel / article

How Should Diffusion Language Models Edit Code?

Source
arxiv.org
Author
Xijia Tao, Ziru Liu, Shansan Gong, Jiacheng Ye, Kecheng Chen, Zirui Wu, Lin Zheng, Xinyu Fu, Rui Liu, Lingpeng Kong
Date

Context

A model that can fill missing code still has to identify the right places to edit. This study of diffusion language models reports that coordinated code changes work much better when the correct edit locations are supplied than when the model must select those locations itself.

The authors isolate two requirements by changing the editable regions while keeping generation fixed. The regions must include every necessary change, but their boundaries must also avoid unnecessary rewriting of correct code. Enlarging regions to capture missed changes can reduce success by forcing more unchanged material to be regenerated. Reliable editing therefore depends on precise change selection as well as replacement-code generation.

Key takeaways · AI-distilled
  • The study compares four editing interfaces for masked diffusion language models on CanItEdit: whole-file rewriting, search-and-replace, locate-then-infill, and -level editing.
  • Diffusion models produce coordinated changes well when the correct edit locations are supplied, but lose much of that ability when they must predict the locations themselves, a gap the authors call the composition gap.
  • Giving the model the intact original code helps it fill multiple edit regions, but does not solve the problem of choosing which regions to edit.
  • A sentence-level Wiki editing probe shows the same gap between supplied and predicted locations, suggesting the problem is not specific to code.
Terms in this piece · Glossary
  • token — The chunk of text a model reads and writes in — roughly three-quarters of a word — and the unit AI usage is billed in.
Recommended reads
Comments

Checking sign-in…

Loading comments…