微软论文:单一模型统一 Copilot 代码补全与编辑,输出 token 减少 58.93%
Copilot 把 3 个模型砍成 1 个,建议全用 diff patch 表示,token 少了 58.93% 还更快。做编程工具或 agent 输出设计的开发者能直接抄这套架构。
微软在一篇新论文中介绍,将 GitHub Copilot 原本按固定顺序调用 3 个独立模型的架构(代码补全、邻近行编辑、远距离编辑),合并为一个统一模型。该模型将每个建议输出为一组 diff patch,每个 patch 标明编辑位置和内容,多条编辑可合并在一次响应中,后续编辑从缓存读取。
在线上 A/B 测试中,第一个合并版模型将首屏展示时间缩短 6.77%,输出 token 减少 58.93%,且质量无可测损失。最终 3-in-1 模型单独上线时被用户拒绝的建议率上升 12.24%,但配合客户端改动后转为下降 10.06%。
对做 AI 编程工具的团队来说,这篇论文给出了一个具体可复用的工程模式:用 diff patch 作为统一输出格式替代多模型流水线,同时借助缓存降低多次编辑的推理成本。
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.
本条情报归属 AITOP「论文」核心栏目,重点聚焦北美前沿实验室与硅谷科技巨头。在跨区域产业观察坐标中,该动态直接关联「AI 开发者工具链、Coding Agent 与工程化实践」「中美大模型技术代差与商业化对照」研究主线,反映出当前技术演进与商业落地的最新风向。涉及核心实体与技术议题包括:GitHub Copilot、Microsoft、diff patch、编程助手,读者可通过下方标签进入对应专题页查阅历史脉络与关联对比。
信源核验说明:本文原始线索采编自「rohanpaul_ai」(@rohanpaul_ai),经 AITOP 多维评分管线结构化提炼。