Original post · Original
New Microsoft paper shows that a single model can handle code completion, nearby edits, and far-away edits in Copilot by writing every suggestion as a diff patch. And cuts output tokens by 58.93% with no measurable quality loss.
Copilot used to call separate models for completing code, editing nearby lines, and editing far away, in a fixed order. That cost several model calls per suggestion.
They trained 1 model that outputs a list of diff patches, each saying where to edit and what to change. Several edits fit in 1 response, so later ones come from a cache.
In live A/B tests against the 3-model setup, the 1st merged model cut time to display by 6.77% and output tokens by 58.93%. The final 3-in-1 model alone raised dismissed suggestions by 12.24%, but client changes turned that into a 10.06% drop.