原帖引用 · AI 翻译
– https://arxiv.org/abs/2611.33314
标题:“为 GitHub Copilot 构建统一的行内代码编辑模型”
微软的一篇新论文表明,通过将每条建议都写成差异补丁,单个模型就能在 Copilot 中处理代码补全、附近位置的编辑和远处位置的编辑。
而且输出 token 数减少了 58.93%,质量没有可测量的下降。
Copilot 过去会按固定顺序调用不同的模型,分别用于代码补全、编辑附近的代码行和编辑远处的代码。每条建议都需要调用模型数次。
他们训练了 1 个模型,让它输出差异补丁列表,每个补丁都说明在哪里编辑、要改什么。1 次响应可以包含多处编辑,因此后续编辑可以从缓存中获取。
在与 3 模型配置对比的线上 A/B 测试中,第 1 个合并模型将建议显示时间缩短了 6.77%,输出 token 数减少了 58.93%。最终的三合一模型单独使用时,使被忽略的建议增加了 12.24%,但客户端改动使这一指标转为下降 10.06%。
原文
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.