为 GitHub Copilot 构建统一的行内代码编辑模型

arXiv cs.CL 论文

摘要

微软/GitHub 的一篇论文介绍了一种用于 GitHub Copilot 的统一行内代码编辑模型,以单个输出带锚点差异补丁的模型取代三个独立的代码补全与编辑模型。在在线 A/B 实验中,该模型将显示延迟降低了 6.77%,输出 token 数减少了 58.93%,被忽略的建议数量减少了 10.06%。

arXiv:2611.33314v1 Announce Type: cross Abstract: AI-assisted coding ranges from fully agentic coding to inline code suggestions in the editor. Inline suggestions require predicting a developer's most likely next edit from an editing session. The next edit may lie at the cursor, in nearby lines, or farther away, and one editing intent can span several of these. The preceding system queries separate completion, nearby edit, and long-distance edit models, each with its own output format, in a fixed sequence; it thus cannot express intents spanning distant locations in one response, can require several sequential model calls per suggestion, and prioritizes completion even when a correction would serve better. We present a unified model that predicts all three edit types in one output space: a sequence of anchored diff patches specifying locations, deleted lines, and added lines. This representation permits multiple edits per response, so the client can serve later edits from a cache without further model calls. We train this model in two phases, first unifying next edit and long-distance edit prediction, then adding code completion. We synthesize multi-edit supervision from single-edit data via model pseudolabeling and edit history playback. We use a binary LLM-graded reward, a patch validity taxonomy shared by data filtering, reward, and evaluation, and grader boosting for targeted failure modes. Phase 2 also adapts how the client processes and presents model outputs. In controlled online A/B experiments in GitHub Copilot, Phase 1 significantly reduces time to display by 6.77% and output tokens by 58.93% relative to the three-model baseline. In Phase 2, the 3-in-1 model and client adaptations reduce dismissed suggestions per user by 10.06% relative to the 2-in-1 model paired with the completion model. Throughout this report, we also share our methodology and learnings in evaluation, training, and end-to-end model and system design.
查看原文
查看缓存全文

缓存时间: 2026/11/26 09:37

# Building a Unified Inline Code EditingModel for GitHub Copilot
Source: [https://arxiv.org/html/2611.33314](https://arxiv.org/html/2611.33314)
###### Abstract

AI\-assisted coding ranges from fully agentic coding to inline code suggestions in the editor\. Inline suggestions require predicting a developer’s most likely next edit from an editing session\. The next edit may lie at the cursor, in nearby lines, or farther away, and one editing intent can span several of these\. The preceding system queries separate completion, nearby edit, and long\-distance edit models, each with its own output format, in a fixed sequence; it thus cannot express intents spanning distant locations in one response, can require several sequential model calls per suggestion, and prioritizes completion even when a correction would serve better\. We present a unified model that predicts all three edit types in one output space: a sequence of anchored diff patches specifying locations, deleted lines, and added lines\. This representation permits multiple edits per response, so the client can serve later edits from a cache without further model calls\. We train this model in two phases, first unifying next edit and long\-distance edit prediction, then adding code completion\. We synthesize multi\-edit supervision from single\-edit data via model pseudolabeling and edit history playback\. We use a binary LLM\-graded reward, a patch validity taxonomy shared by data filtering, reward, and evaluation, and grader boosting for targeted failure modes\. Phase 2 also adapts how the client processes and presents model outputs\. In controlled online A/B experiments in GitHub Copilot, Phase 1 significantly reduces time to display by 6\.77% and output tokens by 58\.93% relative to the three\-model baseline\. In Phase 2, the 3\-in\-1 model and client adaptations reduce dismissed suggestions per user by 10\.06% relative to the 2\-in\-1 model paired with the completion model\. Throughout this report, we also share our methodology and learnings in evaluation, training, and end\-to\-end model and system design\.

00footnotetext:See the[Contributors and Acknowledgments](https://arxiv.org/html/2611.33314#Sx1)section for the full list of contributors\. Correspondence should be sent to[codeai@microsoft\.com](mailto:[email protected])\. Please cite as shown in Appendix[A](https://arxiv.org/html/2611.33314#A1)\.###### Contents

1. [1Introduction](https://arxiv.org/html/2611.33314#S1)
2. [2Unified Code Editing Problem Formulation](https://arxiv.org/html/2611.33314#S2)1. [2\.1Task Definition](https://arxiv.org/html/2611.33314#S2.SS1) 2. [2\.2Diff Patch Output Format](https://arxiv.org/html/2611.33314#S2.SS2) 3. [2\.3Input Context](https://arxiv.org/html/2611.33314#S2.SS3)
3. [3Evaluation Methodology](https://arxiv.org/html/2611.33314#S3)1. [3\.1Offline Benchmarks](https://arxiv.org/html/2611.33314#S3.SS1) 2. [3\.2Online Evaluation Metrics](https://arxiv.org/html/2611.33314#S3.SS2) 3. [3\.3A/B Experiment Design](https://arxiv.org/html/2611.33314#S3.SS3) 4. [3\.4Model Selection Process](https://arxiv.org/html/2611.33314#S3.SS4)
4. [4Phase 1: Unifying NES and Long\-Distance NES](https://arxiv.org/html/2611.33314#S4)1. [4\.1Model Architecture](https://arxiv.org/html/2611.33314#S4.SS1) 2. [4\.2Supervised Fine\-Tuning](https://arxiv.org/html/2611.33314#S4.SS2) 3. [4\.3Reinforcement Learning](https://arxiv.org/html/2611.33314#S4.SS3) 4. [4\.4Results](https://arxiv.org/html/2611.33314#S4.SS4)
5. [5Phase 2: Unifying the 2\-in\-1 Model with Code Completion](https://arxiv.org/html/2611.33314#S5)1. [5\.1Reinforcement Learning](https://arxiv.org/html/2611.33314#S5.SS1) 2. [5\.2Client Adaptation](https://arxiv.org/html/2611.33314#S5.SS2) 3. [5\.3Results](https://arxiv.org/html/2611.33314#S5.SS3)
6. [6Iteration Flywheel](https://arxiv.org/html/2611.33314#S6)1. [6\.1Iteration Velocity](https://arxiv.org/html/2611.33314#S6.SS1) 2. [6\.2A/B Experiment Metrics over Model Iterations](https://arxiv.org/html/2611.33314#S6.SS2) 3. [6\.3RL Checkpoint Stability](https://arxiv.org/html/2611.33314#S6.SS3) 4. [6\.4Offline\-Online Evaluation Metric Correlation](https://arxiv.org/html/2611.33314#S6.SS4)
7. [7Conclusion, Limitations, and Future Directions](https://arxiv.org/html/2611.33314#S7)1. [7\.1Limitations](https://arxiv.org/html/2611.33314#S7.SS1) 2. [7\.2Future Directions](https://arxiv.org/html/2611.33314#S7.SS2)
8. [Contributors and Acknowledgments](https://arxiv.org/html/2611.33314#Sx1)
9. [References](https://arxiv.org/html/2611.33314#bib)
10. [ACitation Reference](https://arxiv.org/html/2611.33314#A1)
11. [BSpeculative Decoding Draft Comparison](https://arxiv.org/html/2611.33314#A2)
12. [CPatch Validity Taxonomy](https://arxiv.org/html/2611.33314#A3)
13. [DInput Context Example](https://arxiv.org/html/2611.33314#A4)
14. [EAdditional Offline\-Online Evaluation Metric Correlation Analysis](https://arxiv.org/html/2611.33314#A5)

## 1Introduction

![Refer to caption](https://arxiv.org/html/2611.33314v1/figures/teaser_ghost_text.png)\(a\)Completion at the cursor, rendered as ghost text in the VS Code client\.
![Refer to caption](https://arxiv.org/html/2611.33314v1/figures/teaser_followup_edit.png)\(b\)Follow\-up edit 10 lines below the cursor, rendered as a side\-by\-side rewrite and served from the client cache\.

Figure 1:A single unified model response spanning two edits that completes amessagefield at the cursor and updates the validation logic a few lines below\. Predicting both edits together in a single response allows the client to show the second edit from its cache without another model call\.Inline code suggestion requires a model to predict, from the state of an editing session, the edit a developer is most likely to make next, and to do so within the latency budget of interactive typing\. The best next edit may extend the current line, revise the surrounding lines \(including characters already typed\), or propagate a change to a distant location in the file, and a single editing intent may span multiple such edits\. Code completion and prediction of subsequent edits have been extensively studied using statistical and neural language models and learning\-based edit models\[[Hindle et al\., 2012](https://arxiv.org/html/2611.33314#bib.bib17);[Raychev et al\., 2014](https://arxiv.org/html/2611.33314#bib.bib18);[Bhoopchand et al\., 2016](https://arxiv.org/html/2611.33314#bib.bib19);[Gupta et al\., 2017](https://arxiv.org/html/2611.33314#bib.bib20);[Tufano et al\., 2019](https://arxiv.org/html/2611.33314#bib.bib21);[Chen et al\., 2021b](https://arxiv.org/html/2611.33314#bib.bib22);[Yin et al\., 2019](https://arxiv.org/html/2611.33314#bib.bib23);[Zhao et al\., 2019](https://arxiv.org/html/2611.33314#bib.bib24);[Brody et al\., 2020](https://arxiv.org/html/2611.33314#bib.bib25);[Chakraborty et al\., 2022](https://arxiv.org/html/2611.33314#bib.bib26);[Chen et al\., 2021a](https://arxiv.org/html/2611.33314#bib.bib8);[Bavarian et al\., 2022](https://arxiv.org/html/2611.33314#bib.bib27);[Fried et al\., 2023](https://arxiv.org/html/2611.33314#bib.bib28);[Reid and Neubig, 2022](https://arxiv.org/html/2611.33314#bib.bib29);[Zhang et al\., 2022a](https://arxiv.org/html/2611.33314#bib.bib30);[Zhang et al\., 2022b](https://arxiv.org/html/2611.33314#bib.bib31);[Gupta et al\., 2023](https://arxiv.org/html/2611.33314#bib.bib32);[Wei et al\., 2024](https://arxiv.org/html/2611.33314#bib.bib33);[Liu et al\., 2024](https://arxiv.org/html/2611.33314#bib.bib34);[Li et al\., 2024](https://arxiv.org/html/2611.33314#bib.bib35);[Aggarwal et al\., 2025](https://arxiv.org/html/2611.33314#bib.bib36);[Lu et al\., 2025](https://arxiv.org/html/2611.33314#bib.bib37)\]\.

In this work, we introduce a unified model for inline code editing that we post\-train for GitHub Copilot Inline Suggestions\. This model spans three key code editing scenarios: code completion at the cursor, next edit suggestion \(NES\) near the cursor, and long\-distance NES farther from the cursor\. Unifying these scenarios within one model enables it to propagate intent across an editing context by composing multiple edits in a single response, as shown in Figure[1](https://arxiv.org/html/2611.33314#S1.F1)\. Our approach spans data curation techniques, supervised fine\-tuning \(SFT\)\[[Wei et al\., 2022](https://arxiv.org/html/2611.33314#bib.bib38);[Ouyang and others, 2022](https://arxiv.org/html/2611.33314#bib.bib39)\]and reinforcement learning \(RL\)\[[Ziegler et al\., 2019](https://arxiv.org/html/2611.33314#bib.bib12);[Ouyang and others, 2022](https://arxiv.org/html/2611.33314#bib.bib39)\], along with carefully designed offline and online evaluation methods for model selection\.

Three principles guide our design:

Earn each intervention\.Because a correct edit can still be unwanted in the developer’s current context, the best response is sometimes no edit\. The system must therefore decide both whether to make a suggestion and what to suggest\. Any suggestion the system makes must meet a quality standard for relevance and utility\. This requirement reflects human\-AI interaction principles that emphasize contextually appropriate assistance\[[Amershi et al\., 2019](https://arxiv.org/html/2611.33314#bib.bib10)\]\. We encode this requirement in our data curation and evaluations: each model suggestion must make a meaningful contribution to the developer’s current task \(Sections[3\.1](https://arxiv.org/html/2611.33314#S3.SS1)and[4\.2\.3](https://arxiv.org/html/2611.33314#S4.SS2.SSS3)\)\.

Optimize the end\-to\-end system, not just the model\.Developers experience a suggestion through its timing, presentation, and behavior across successive edits\. We therefore co\-design the model and client, including the output representation, invocation policy, rendering, and patch caching\. As an example, with the checkpoint held fixed, suppressing the reappearance of ignored suggestions reduces dismissed suggestions per user by 22\.40% relative to leaving suppression disabled \(Table[14](https://arxiv.org/html/2611.33314#S5.T14)\)\.

Improve the system and its measures together\.No single benchmark, metric, or scorecard captures the full editing experience\. We combine offline evaluation, end\-to\-end testing, self\-testing, and online A/B experiments because each exposes different aspects of system behavior \(Section[3](https://arxiv.org/html/2611.33314#S3)\)\. In a complex end\-to\-end system, we need both quantitative metrics and qualitative testing to assess and improve the end\-to\-end experience\. Finally, we carry learnings forward across iterations, using evaluation outcomes to improve the system and development flywheel and refine our evaluation protocol \(Section[6\.4](https://arxiv.org/html/2611.33314#S6.SS4)\)\.

The model unification described in this report builds on the existing inline suggestion system in GitHub Copilot\. This system decomposes the problem by using dedicated models for each coding task \(completion\[[Fu and Mogensen, 2025](https://arxiv.org/html/2611.33314#bib.bib5)\], NES\[[Merchant and Hu, 2025](https://arxiv.org/html/2611.33314#bib.bib6)\], and long\-distance NES\[[Duvvur et al\., 2026](https://arxiv.org/html/2611.33314#bib.bib7)\]\) that the code editing client then orchestrates using a fixed policy\. After careful experimentation to mature the quality of each of these individual models, we take the natural next step of unifying these models into a single model that can handle all code editing tasks, with the goal of preserving suggestion quality while reducing latency and simplifying coordination across edit types\.

There are several challenges when moving from such a decomposed system to a unified one\. For instance, since the prior standalone models do not produce multiple edits, we develop a method to bootstrap multi\-edit data to supervise the unified model\. We also conduct a careful assessment of output format validity and ablate the tradeoffs of RL grader strictness when enforcing format requirements\. In addition to malformed outputs, we address other undesirable behaviors, such as code duplication and poor insertion patterns, by experimenting with the data distribution and reward design\. The RL grader design is a challenge, as it must balance several objectives, including correctness, necessity, ordering, validity, and completeness\. We hypothesize that requiring a single grader to enforce all objectives may weaken its judgments on some objectives\. We introduce a technique called RL grader boosting to improve the enforcement of multiple objectives while keeping the main grader focused on common scenarios\. Offline benchmarks do not perfectly predict online outcomes, so we carefully design the model selection process to expedite learning and convergence to a strong model candidate\. Finally, and critically, we evolve the end\-to\-end system as a unit, not merely the model; the user\-facing client is a critical component we optimize in tandem with the model to deliver a strong user experience\.

We train the unified 3\-in\-1 model in two phases, with the second building upon the first to methodically enhance the model’s capabilities\. In each phase, we evaluate the model offline and in controlled online A/B experiments in GitHub Copilot\. Phase 1 produces a 2\-in\-1 model that combines next edit suggestion \(NES\) and long\-distance NES, which the client orchestrates with the completion model\. Relative to the original standalone three\-model system, it reduces time to display by 6\.77% and output tokens by 58\.93% with no statistically significant regression in shown, accepted, dismissed, or ignored suggestions, recurring engagement, or accepted and retained characters\. In Phase 2, we continue reinforcement learning from the Phase 1 checkpoint to further add code completion capabilities\. This produces the*3\-in\-1*model, which, together with its client configuration, reduces dismissed suggestions per user by 10\.06% relative to the 2\-in\-1 model paired with the completion model, although this result is not statistically significant after Bonferroni correction \(see Section[7\.1](https://arxiv.org/html/2611.33314#S7.SS1)\)\. Despite lower latency, output tokens increase by 20\.98% in this Phase 2 comparison, while accepted and retained characters have negative point estimates at both retention windows, neither statistically significant\. These phase\-specific results use different controls and do not establish the final system’s cumulative effect relative to the original three\-model baseline\.

In developing these initial unified inline suggestions models for GitHub Copilot, we produce not only the models and client experience themselves, but also an evolving recipe for a model development flywheel that spans data pipelines, model training, offline and online evaluation, and more\. We aim to continue refining this flywheel while sharing our learnings with the community as we advance our shared mission of supporting every builder in the workflow that best meets their needs\.

## 2Unified Code Editing Problem Formulation

### 2\.1Task Definition

We consider three distinct types of code edits in the unified code editing problem: completion, next edit suggestion, and long\-distance next edit suggestion\.

##### Completion\.

Completion is an inline suffix prediction task\. Given an editing context, the model generates a strict continuation of the code prefix currently at the cursor\. The client inserts the code at the cursor’s position\.

##### Next Edit Suggestion \(NES\)\.

Next edit suggestion \(NES\) predicts the next code edit to make within a few lines of the cursor\. In our formulation, we consider 2 lines before and 5 lines after the cursor\. Given an editing context, the model rewrites the code within this specified window\.

The model’s suggested edit replaces the code in this window, and the client selects a rendering based on the diff between the suggested edit and the original code\. We refer to this rendered view as theview kind, which includes ghost text, side by side, insertion inline, insertion multiline, deletion, word replacement, and line replacement, as shown in Figure[2](https://arxiv.org/html/2611.33314#S2.F2)\. While completion suggestions are always rendered asghost text at the cursor\(directly after the cursor’s current position\), NES suggestions can use any of the seven view kinds\. NES ghost text suggestions can be at the cursor, just like completion suggestions, oraway from the cursor, displayed in the same inline manner at a different location\.

![Refer to caption](https://arxiv.org/html/2611.33314v1/figures/view_kinds/ghost_text.png)

Ghost Text

![Refer to caption](https://arxiv.org/html/2611.33314v1/figures/view_kinds/deletion.png)

Deletion

![Refer to caption](https://arxiv.org/html/2611.33314v1/figures/view_kinds/word_replacement.png)

Word Replacement

![Refer to caption](https://arxiv.org/html/2611.33314v1/figures/view_kinds/insertion_inline.png)

Insertion Inline

![Refer to caption](https://arxiv.org/html/2611.33314v1/figures/view_kinds/side_by_side.png)

Side By Side

![Refer to caption](https://arxiv.org/html/2611.33314v1/figures/view_kinds/insertion_multiline.png)

Insertion Multiline

![Refer to caption](https://arxiv.org/html/2611.33314v1/figures/view_kinds/line_replacement.png)

Line Replacement

Figure 2:The seven possible NES view kinds as rendered by the VS Code client\. The client chooses the rendering based on the diff between the suggested edit and the original code\.
##### Long\-Distance NES\.

Long\-distance NES is the prediction of the next code edit that is far from the current cursor position\. The edit may lie elsewhere in the current file or in another file\. We refer to the latter as a cross\-file edit\.

One way to design a system that handles all three types of edits is to develop a dedicated model for each edit type and orchestrate them using a model orchestration policy\. Prior work in GitHub Copilot uses this strategy\. However, several limitations arise when we decompose the problem this way: fixed prioritization of edit types, as exemplified in Figure[3](https://arxiv.org/html/2611.33314#S2.F3), and latency and system complexity of multiple\-model orchestration, as shown in the example logic of the standalone three\-model system shown in Figure[4](https://arxiv.org/html/2611.33314#S2.F4)\.

![Refer to caption](https://arxiv.org/html/2611.33314v1/figures/quality_improvement_before.png)\(a\)Baseline with three standalone models\.
![Refer to caption](https://arxiv.org/html/2611.33314v1/figures/quality_improvement_after.png)\(b\)A single unified model\.

Figure 3:Suggestions predicted by the \(a\) standalone three\-model baseline and \(b\) unified model for the same editing context\. The baseline deterministically queries the completion model first, which completesFatoFastingPenguin\. The unified model rewritesFatoFish\. Unification allows a single model to choose a context\-appropriate correction end\-to\-end rather than always prioritizing completion\.<\|cursor\|\>completionsOriginal standalone three\-model setup\(completions, NES, long\-distance NES\)edit?ghost textNESedit?NES editlong\-distance NESjump?NESedit?long\-distanceNES edityesnoyesnoyesnoyesno

Figure 4:Client\-side orchestration for the three\-model baseline\. A single suggestion trigger can require up to four sequential model calls before the client displays an edit, adding latency and orchestration complexity\.This motivates the development of a unified model that can handle all three types of code edits within a single framework\. The unified model design must satisfy the following conditions:

1. 1\.Unification\.Handle completion, next edit suggestion, and long\-distance next edit suggestion with the goal of maintaining suggestion quality relative to the three\-model baseline\.
2. 2\.Single\-model\.Make all edit predictions in a single model\.
3. 3\.Multi\-edit\.Predict zero or more appropriate suggestions given the current editing context\.
4. 4\.Consistency\.Provide edit sequences that are consistent with user intent, user flow, and logical flow\.
5. 5\.Extensibility\.Support easy extension to additional code editing tasks and scenarios\.

To systematically develop the unified model’s capabilities, we take a two\-phase approach toward unification\. We first train a 2\-in\-1 model combining next edit and long\-distance edit prediction, followed by the 3\-in\-1 model that additionally includes completion\. We intentionally first unify NES and long\-distance NES before code completion because completion accounts for more than 70% of edit opportunities, and experiments preceding this work show NES suggestions are more prone to dismissal than ghost text completion at the cursor\. Deferring completion allows Phase 1 to develop the diff\-patch data and training recipe for the two editing tasks, which Phase 2 can then build on\. Figure[5](https://arxiv.org/html/2611.33314#S2.F5)illustrates this process\.

completionNESlong\-distance NES2\-in\-1 diffpatch unified3\-in\-1 diffpatch unifiedFigure 5:Two\-phase model unification strategy\. Phase 1 combines NES and long\-distance NES and Phase 2 adds completion\. This allows completion training to build on the patch\-format editing capabilities developed in Phase 1\.

### 2\.2Diff Patch Output Format

To develop a unified model that satisfies the unification requirements, we introduce the diff patch model output format, which represents code edits as a series of changes anchored to specific lines in the source files\. All unified models we discuss in this report use this format\. Each model response can contain either the empty string, meaning no suggested edits, or one or more edits represented as anchored patches\. Each patch specifies the absolute file path and line number, followed by at least one deletion line, and optionally one or more addition lines\. We represent a deletion as a patch containing only deletion lines\. We represent an insertion as a patch that deletes an existing anchoring line and adds it back together with the inserted content\. Preliminary experiments show that requiring an anchoring deletion reduces off\-by\-one errors in predicted line numbers\.

Figure[6](https://arxiv.org/html/2611.33314#S2.F6)illustrates how each of the completion, NES, long\-distance NES, and unified models expresses suggested edits in the same editing context\. In this example, the diff patch response has multiple edits: it completes a parameter rename at the cursor and propagates it to two later lines of the same file and to a call site in a related file\.

Note how the output format represents all three types of code edits while being less verbose on average for NES edits since it no longer requires a full edit window rewrite\. In addition, the multi\-edit capabilities of the diff patch format allow it to naturally and compactly express changes spanning multiple locations in the code without limitations on distance from the cursor\. The multi\-edit nature of the model response format also affords a user experience improvement:patch caching\. The client can cache subsequent patches and show the next edit immediately after the developer accepts the first, without additional model calls\. This leads to a smooth tab\-tab\-tab client behavior that supports in\-flow productivity\.

Code to edit, cursor marked<\|cursor\|\>0\|def feed\_penguin\(penguin, fo<\|cursor\|\>\):
1\| penguin\.meals \+= 1
2\| penguin\.hungry = False
3\| penguin\.last\_ate\_time = datetime\.now\(\)
4\|
5\| print\(f"\{penguin\.name\} ate \{fish\.type\}"\)
6\|
7\|penguin = Penguin\("emperor"\)
8\|feed\_penguin\(penguin, fish="silverfish"\)
Completion:a suffix at the cursorodNES:the rewritten window, including unchanged linesdef feed\_penguin\(penguin, food\):penguin\.meals \+= 1penguin\.hungry = Falsepenguin\.last\_ate\_time = datetime\.now\(\)print\(f"\{penguin\.name\} ate \{food\.type\}"\)Long\-distance NES:the line number of the next edit, followed by a second NES call at that line5Diff patch:one or more anchored patches, at any distance and in any file/path/to/penguins\.py:0\-def feed\_penguin\(penguin, fo\):\+def feed\_penguin\(penguin, food\):/path/to/penguins\.py:5\- print\(f"\{penguin\.name\} ate \{fish\.type\}"\)\+ print\(f"\{penguin\.name\} ate \{food\.type\}"\)/path/to/penguins\.py:8\-feed\_penguin\(penguin, fish="silverfish"\)\+feed\_penguin\(penguin, food="silverfish"\)/path/to/antarctica\.py:42\-feed\_penguin\(penguin2, fish="krill"\)\+feed\_penguin\(penguin2, food="krill"\)Figure 6:The three standalone response formats and the unified diff patch format for the same editing context\. Diff patches express the parameter rename at the cursor and its propagation within and across files in one response without rewriting unchanged lines\.We also consider more general formats, including tool calls, which pretraining data represents better and which support actions beyond editing\. For code edits specifically, however, we find that the patch format is more compact at equal expressiveness\.

### 2\.3Input Context

##### Changes Relative to NES Prompt\.

To support the unified task, we modify the input context used by the original NES model\. The original NES model prompt context contains five components: recently viewed code snippets, the current file, recent edit history as a unified diff, a padded region around the edit target, and the rewrite window\. The most notable prompt context change concerns the edit target and rewrite window: because the unified task can express an edit anywhere in the file, we replace the last two sections with a three\-line block specifying the line number and content at the cursor\. We also add line numbers to the current file and recently viewed code snippets sections accordingly\.

Table[1](https://arxiv.org/html/2611.33314#S2.T1)summarizes the changes relative to the original NES model prompt\. In addition to these two changes, we remove the backtick fences around the prompt for simplicity and rewrite the closing instruction to describe the patch task and ordering requirement \(see Appendix[D](https://arxiv.org/html/2611.33314#A4)for an example of the unified model prompt\)\.

Table 1:Changes to input context sections between the NES and unified prompts\. The unified prompt replaces the padded target region and rewrite window with a cursor block, and adds line numbers to the current file and recently viewed code snippets\.
##### Key\-Value Cache Optimization\.

We place the cursor block at the end of the prompt rather than inline in the file content\. Because the cursor moves on nearly every keystroke, an inline marker would invalidate the shared prefix of consecutive prompts\. Placing it at the end keeps the file body and edit history as a stable prefix, which preserves key\-value cache hits across requests within an editing session\.

## 3Evaluation Methodology

### 3\.1Offline Benchmarks

##### Simulation Tests\.

Simulation Tests \(STests\) cover common NES editing scenarios and undesirable suggestions identified by the team\. The benchmark consists of workspace recordings\. A client simulator replays recordings to reconstruct the workspace state and construct prompts for the candidate model\. The benchmark has two versions, v1 and v2, each organized into three subsets: MustHave, NiceToHave, and MustAvoid\. Each example includes one or more human\-labeled reference suggestions with scores of 0 \(bad\), 0\.1 \(acceptable\), or 1 \(good\)\. If a candidate suggestion matches a reference suggestion, it receives the corresponding score; otherwise, an LLM judge\[[Zheng et al\., 2023](https://arxiv.org/html/2611.33314#bib.bib13)\]scores it using the labeled suggestions as in\-context examples\. Throughout this report, LLM judges in offline benchmarks, data filtering, and RL grading use a general\-purpose frontier reasoning model\. We report three metrics: MustHave, the sum of scores on the MustHave subset; Total, the sum of scores across the MustHave and NiceToHave subsets; and MustAvoid, the percentage of examples in the MustAvoid subset that receive a score of 0\.1 or 1, indicating successful avoidance of an undesirable suggestion\. Higher values are better for all three metrics\.

##### Augmented HumanEval\.

Augmented HumanEval measures code completion capability by extending HumanEval\[[Chen et al\., 2021a](https://arxiv.org/html/2611.33314#bib.bib8)\]to completion tasks within existing code\. We remove a code span and ask the model to complete the missing code\. The shape of the removed span defines the benchmark’s three subsets: Single Line, Multi\-Line, and Random Span, abbreviated as Single, Multi, and Span\. We evaluate the completed code using unit tests and report pass@1, the percentage of tasks for which a single generated completion passes the tests, separately for each subset\.

##### Output View Kind\.

The Output View Kind benchmark shows what kinds of suggestions the model tends to produce over a curated set of recorded editing contexts\. It reports the distribution of view kinds, which we define in Section[2\.1](https://arxiv.org/html/2611.33314#S2.SS1), and the fraction of responses that contain no edit\. These measurements describe output characteristics rather than assign an overall suggestion quality score\. Version 1 distinguishes the seven named view kinds shown in Figure[2](https://arxiv.org/html/2611.33314#S2.F2), together with no edit, whitespace only, and unknown\. We compute the no\-edit ratio by dividing the no\-edit count by the total response count\. We compute the ghost text ratio by dividing the ghost text count by the total response count excluding no edit, whitespace\-only, and unknown responses\. Version 2 uses a simplified taxonomy for diff\-patch models: ghost text, NES, no edit, and invalid\. We classify any valid suggestion that is not ghost text as NES\. The benchmark reports patch validity and average patches per response\. It also reports the average size of insertions and deletions per patch, which we measure in characters and lines\.

##### Pseudo\-Online Evaluation \(POE\)\.

POE provides an offline model\-selection signal that aims to predict online outcomes more accurately than the preceding benchmarks\. The benchmark organizes recorded editing contexts into three equally sized sets based on the outcome of a prior model suggestion: acceptance, rejection, or no edit\. An LLM judge evaluates each patch from a candidate response in the context of the prior suggestion and its recorded outcome\. We summarize the judge outcomes as POE acceptance, rejection, and no\-edit rates\. These rates reflect offline assessments of candidate suggestions rather than outcomes measured in online controlled experiments\. We also report the acceptance\-to\-rejection rate ratio as a key metric\. Two conversion rates measure abstention relative to the recorded outcome: the fractions of previously accepted and previously rejected suggestions for which the candidate produces no edit\. These rates distinguish between likely desirable abstention from previously rejected suggestions and likely less desirable abstention from previously accepted suggestions\. We thus also report the rejection\-to\-no\-edit to acceptance\-to\-no\-edit ratio as a key metric, for which higher values are better\. POE also reports the average number of patches per response, the average line distance between patches, and patch validity error counts \(both critical and suboptimal, two classes we discuss further in Section[4\.2\.3](https://arxiv.org/html/2611.33314#S4.SS2.SSS3)\)\. Unless otherwise noted, the patch validity error rate refers to the rate of total errors \(both critical and suboptimal errors\)\. POE also breaks down patch\-level statistics by patch index\.

##### Qualitative Must\-Haves \(QMH\)\.

We use the QMH benchmark to efficiently filter out checkpoints that regress on previously observed failure modes\. We curate its cases from failures that we identify during internal testing\. During Phase 1 model development, the team identifies insertion placement errors in internal testing, but the available offline benchmarks and online experiments do not capture them\. This gap motivates QMH as a compact canary benchmark for recurring high\-priority failures\. We discuss these errors further in Section[4\.2\.3](https://arxiv.org/html/2611.33314#S4.SS2.SSS3.Px3)\. The cases in this benchmark cover a small set of high\-priority behaviors that candidate models must perform reliably\. The cases include ghost text completions, nearby NES, long\-distance NES, and cross\-file examples\. QMH therefore serves as a quality guardrail for recurring regressions rather than as an estimate of overall model quality\. For each case, an LLM judge compares the candidate response with desired and undesired reference responses and assigns a pass or fail outcome\.

### 3\.2Online Evaluation Metrics

Table[2](https://arxiv.org/html/2611.33314#S3.T2)defines the key online metrics\. No single metric establishes model acceptability because a gain on one metric can mask a regression on another\. For example, showing more suggestions may increase acceptances but also cause more interruptions, while shorter responses may reduce latency but contribute less retained content\. We therefore assess each candidate jointly across suggestion quality, latency, and inference efficiency\. We accept a candidate only when it achieves its intended improvement without introducing a statistically significant regression in the designated guardrail metrics\. In the case of model unification, our primary aim is to unify an existing set of models while maintaining performance on par with the control, rather than to outperform it\.

The absence of statistically significant guardrail regressions, however, is necessary but not sufficient for acceptance\. We also assess the direction and width of confidence intervals for each metric and the results of qualitative testing\. To maintain a strong standard for the editing experience, we delay deployment when metrics show a meaningful risk of regressions, experiment results are too uncertain to rule out regressions, or internal testing identifies qualitative regressions that we judge unacceptable for deployment\.

Table 2:Online metric definitions\. We use multiple metrics to assess various dimensions of the user experience, including suggestion quality, engagement, latency, and inference efficiency\.For ARC, we cap each user’s total at 35,000 characters at each retention window before averaging across users\. Token metrics first average token counts across each user’s requests or responses, then average across users, excluding the standalone completion model in both phases\. In Phase 1, completion remains a separate component in both arms\. In Phase 2, token metrics compare the 3\-in\-1 model with the 2\-in\-1 model alone, excluding the control’s separate completion model\. These Phase 2 metrics therefore compare models with different task coverage\.

### 3\.3A/B Experiment Design

We obtain results using controlled online A/B experiments, which are randomized controlled experiments that run over a fixed exposure period\. Most reported experiments run for at least 7 days, with some running for 14 days and the shortest running for 5 days\. We choose these durations so that results reflect developers’ experience over sustained use and reduce sensitivity to day\-of\-week effects\. For each experiment, we randomly select a small fraction of eligible VS Code stable users and then randomly assign them in equal proportions to the experiment’s conditions\. None of the reported experiments shows a sample ratio mismatch \(SRM\), which would indicate that an arm does not receive its intended share of users\. In this work, the treatment is the candidate unified model and client configuration and the control is the then\-production baseline model and client configuration unless otherwise specified\. We hold the configuration constant between groups except for the model or client change under evaluation, allowing us to attribute metric differences to that intervention\.

##### Target Metrics and Hypotheses\.

We specify target metrics before each experiment based on the intervention we evaluate\. In Phase 1, the goal is to unify NES and long\-distance NES while maintaining suggestion quality relative to the three\-model baseline\. We also hypothesize that edit caching with the multi\-patch representation leads to fewer sequential model calls, and that the more compact diff\-based format reduces time to display, time to produce, and output tokens\. Accepted suggestions, dismissed suggestions, ignored suggestions, ARC, and recurring engagement serve as quality and engagement guardrails that detect whether the model achieves these reductions through undesirable means, such as suggesting less useful content or interrupting developers more often\. In Phase 2, the goal is to replace the 2\-in\-1 model paired with the completion model while maintaining performance across the guardrail metrics\. Results from earlier experiments also motivate new hypotheses for subsequent experiments\. For instance, the initial experiment using the 2\-in\-1 model without the separate completion model reveals regressions in accepted suggestions and ARC; completion\-focused training targets these regressions by improving completion coverage and completeness \(Section[5](https://arxiv.org/html/2611.33314#S5)\)\. Client experiments also test other hypotheses\. For example, we hypothesize that preventing an ignored ghost text suggestion from reappearing as a different view kind reduces repeated interruptions without reducing useful suggestions, thereby reducing dismissed suggestions \(Section[5\.2\.1](https://arxiv.org/html/2611.33314#S5.SS2.SSS1)\)\.

##### Estimation and Candidate Selection\.

Each experiment uses a new independent random sample of eligible users\. We aggregate most metrics per user and report the treatment\-control comparison for each metric in an A/B experiment scorecard\. The only exception to per\-user aggregation is cached suggestion share, which is computed at the event level\. We report relative changes as the estimate±\\pmthe 95% confidence interval half\-width, expressing both quantities as percentages\. For each metric, the scorecard reports app\-value for the null hypothesis that the treatment and control do not differ\. We describe0\.001<p<0\.050\.001<p<0\.05as statistically significant andp≤0\.001p\\leq 0\.001as highly statistically significant\. In result tables, bold entries indicate statistical significance, and we displaypp\-values below 0\.00005 as≈0\\approx 0\. We primarily rely on statistically significant metric changes to guide our decision\-making\. Following statistical reasoning, it is important to note that a lack of statistical significance does not establish equivalence between the candidate and control models, only that the evidence does not meet the chosen significance threshold\. We calculatepp\-values separately for each experiment, without adjustment for multiple metrics or candidates\. The reported significance levels therefore do not control false positives across the full candidate search\. We interpret each result against its stated target, the full guardrail scorecard, and qualitative testing, as opposed to relying solely on an isolated favorable metric change\.

##### Cross\-Phase Comparisons\.

We do not directly compare the final 3\-in\-1 model and client configuration with the original three\-model baseline\. The phase\-specific experiments use different controls, exposure periods, and sampled users, so we do not multiply their relative changes across phases to estimate a cumulative effect relative to the original baseline\.

#### 3\.3\.1Client Configuration in A/B Experiments

Each A/B experiment evaluates a model checkpoint together with a client configuration\. The client determines when it invokes a model, how it renders patches, whether it preserves ignored suggestions, and when it shows cached suggestions\. These choices can change suggestion outcomes and latency even when we hold the model checkpoint fixed\. Section[5\.2\.1](https://arxiv.org/html/2611.33314#S5.SS2.SSS1)examines the effects of individual client settings\.

### 3\.4Model Selection Process

Our model selection process consists of several stages that efficiently narrow the candidate checkpoint sets by progressing from lower\-effort to more involved evaluation methods\. We use the process described here from late in Phase 1 RL stage 1 onward, which covers the final Phase 1 candidate and all of Phase 2\. Earlier Phase 1 checkpoints, including the SFT checkpoint, predate the 19\-case QMH set, so we screen them with the other offline benchmarks\.

Figure[7](https://arxiv.org/html/2611.33314#S3.F7)illustrates these progressive stages of model selection\. We first cast a wide net by sampling model checkpoints every 100 training steps and evaluating each checkpoint on the lightweight QMH dataset of 19 examples\. To ensure QMH serves effectively as a canary set, we carefully curate QMH to adequately represent the key editing contexts that define a high\-quality user experience\. Without this careful design, using it in this important proxy role would lead to a higher rate of inclusion of poor candidates or exclusion of strong candidates for further testing\. In more mature stages of training, we further expand the pool of candidates by considering additional checkpoints around loci of promising checkpoints in the first QMH evaluation round; for instance, if the 400th step has a strong score, we may also consider evaluating the 350th step through the 450th step with a higher granularity \(say, every 10th step\) to ensure we do not miss nearby promising candidates\.

Once QMH identifies promising candidates, we evaluate them on the four other more extensive offline benchmarks\. Based on the composite scores across these benchmarks, we identify a smaller set of strong candidates for internal testing via team dogfooding and at\-scale human evaluation studies\. The feedback from the end\-to\-end testing in the client further narrows down the candidates for larger\-scale online A/B testing via the aforementioned randomized controlled online A/B experiments\.

After each experiment concludes, we carefully analyze the target and guardrail metrics to determine whether any candidate meets the deployment criteria\. If no candidate meets these criteria, we may return to any prior step in the process to iterate on the appropriate methods, including data, model training, client settings, and other factors\. This also applies to all intermediate steps; if no promising candidates exist, we return to prior steps to iterate\.

Model trainingTrained model checkpointsQMH regression canary datasetCandidates for extensive offline evaluation4 other offline benchmarksCandidates for dogfooding andat\-scale human evaluationSelf\-hosted testingA/B experiment candidatesOnline evaluationShipping candidate

Figure 7:Progressive model selection process\. Lightweight canary checks narrow the candidate set before broader and more extensive offline, internal, and online evaluation\. If no candidate meets a stage’s criteria, we return to an earlier stage to iterate\.

## 4Phase 1: Unifying NES and Long\-Distance NES

### 4\.1Model Architecture

We fine\-tune a causal large language model\[[Brown and others, 2020](https://arxiv.org/html/2611.33314#bib.bib40);[Chowdhery and others, 2022](https://arxiv.org/html/2611.33314#bib.bib41);[Anil and others, 2023](https://arxiv.org/html/2611.33314#bib.bib42);[Touvron and others, 2023b](https://arxiv.org/html/2611.33314#bib.bib43);[Touvron and others, 2023a](https://arxiv.org/html/2611.33314#bib.bib44);[Jiang and others, 2023](https://arxiv.org/html/2611.33314#bib.bib45)\]based on the Transformer architecture\[[Vaswani et al\., 2017](https://arxiv.org/html/2611.33314#bib.bib2)\]to generate code edits in the diff patch format described in Section[2\.2](https://arxiv.org/html/2611.33314#S2.SS2)\. We use theo200k\_basetokenizer\[[OpenAI, 2024](https://arxiv.org/html/2611.33314#bib.bib15)\]\.

### 4\.2Supervised Fine\-Tuning

#### 4\.2\.1Data Format Conversion

We use two pipelines to produce patch\-format samples from existing NES data\. The first pipeline operates on serialized prompt\-response samples in the window\-rewrite format and therefore requires format\-specific conversion tooling\. It parses each NES prompt and response and expresses the ground truth edit as one or more patches\. The same tooling converts the five offline benchmarks and preserves their underlying samples across the output\-format reformulation\.

The second pipeline operates on workspace recordings and does not depend on a particular prompt or output format\. During playback, a simulator in the client reconstructs the workspace state, transforms it into the requested prompt format, and uses the recorded action as the ground truth label\. Because the client simulator handles sample formatting, we can convert the same recording again after client\-side prompt changes without a new source\-format converter\.

#### 4\.2\.2Data Bootstrapping

Moving from a fixed edit window to a sequence of patches introduces a stopping decision: after each patch, the model must decide whether another edit should follow or the response should end\. The existing datasets provide insufficient multi\-edit supervision for the model to learn when to continue a patch sequence, biasing it toward terminating after the first patch\. We therefore synthesize multi\-edit samples through model pseudolabeling and edit history playback to provide explicit supervision for continuation \(Figure[8](https://arxiv.org/html/2611.33314#S4.F8)\)\.

##### Model Pseudolabeling\.

We advance a single\-edit sample by moving its ground truth edit into the edit history and running our strongest model checkpoint at the time on the resulting context\. If the predicted edit passes all patch validity checks, we append it to the patch sequence in the ground truth label and repeat the process\. We stop generation when the model produces no edit, a prediction fails a validity check, or the sequence reachesnmax=10n\_\{\\max\}=10patches\. Each successful iteration therefore extends annn\-patch sample ton\+1n\+1patches\.

##### Edit History Playback\.

We iteratively move the latest edit from the recorded edit history into the patch sequence in the ground truth label\. An LLM judge retains the edit only if it shares the ground truth label’s intent or forms a logical next step given the remaining history, after which the process repeats\. For each sample, we transfer between 1 andnnedits in this way, withnmax=10n\_\{\\max\}=10\.

Single\-editsampleMove labeled editinto historyGeneratenext editValidity &quality filtersAppendvalid patchFinalizelabel sequenceno editrejectnmax=10n\_\{\\max\}=10next iteration\(a\)Model pseudolabeling extends a label until generation or filtering determines that the sequence should end\.Edit history &initial labelMove latest editto labelCoherence checkRetain editin labelFinalizemulti\-patch labelrejectno editsnext edit\(b\)Edit history playback iteratively transfers coherent edits from the history into the patch sequence in the label\.
Figure 8:Multi\-patch synthesis from single\-edit data through iterative model pseudolabeling and edit history playback\. Both pipelines bootstrap multi\-edit samples from samples with single\-edit supervision to teach the model when and how to continue edits beyond the first patch\.

#### 4\.2\.3Data Quality Filtering and Curation

We view data quality through three lenses: patch validity, suggestion quality, and targeted behavior curation\. We filter all curated samples, whether raw samples or those we generate through iterative model pseudolabeling or edit history playback\. Our overall process is to first filter samples by suggestion quality and then use an iterative LLM feedback loop to ensure patch validity\. In the case of addressing specific problematic behaviors, we employ dedicated curation pipelines that identify and rewrite problematic examples before these two steps\.

##### Suggestion Quality\.

We first filter raw data for quality using an LLM\-as\-a\-judge\[[Zheng et al\., 2023](https://arxiv.org/html/2611.33314#bib.bib13)\]\. We supply 14 criteria in this filter that represent developer preferences we identify while developing our preceding code editing models\. These include correctness, necessity, and alignment with intent and edit history, as well as other criteria that high\-quality code edits should satisfy\. The filter also includes guidance on patch ordering, requiring patches to follow a logical order, both structurally and semantically\. We also adhere to this logic for bootstrapped samples as we discuss in Section[4\.2\.2](https://arxiv.org/html/2611.33314#S4.SS2.SSS2)\.

We also have separate filters for samples whose responses have no edits and those that have at least one edit\. In our experience, deciding whether to make an edit is a nuanced decision that has a separate decision boundary from edit quality\. In practice, we find that leniency toward abstention in ambiguous cases leads to models that perform better online\. Separating these filters allows us to intentionally curate data that adequately characterizes both distributions\.

We use the same grader for suggestion quality filtering and RL training\. This maintains a shared standard for suggestion quality that benefits both our data pipelines and model training recipes\.

##### Patch Validity\.

As we define in Section[2\.2](https://arxiv.org/html/2611.33314#S2.SS2), a patch consists of a file path, line number, and a sequence of deletions and additions\. A model suggestion contains zero or more patches\. However, there are many nuances to the definition of a valid patch that we consider\. First, we develop a set of seventeen rules that define ideal patch structure, which we discuss in Appendix[C](https://arxiv.org/html/2611.33314#A3)\. The rules cover various aspects such as valid file paths and line numbers, deletion and addition sequencing and redundancy, and code duplication\. As we discuss in later sections, we ultimately divide these rules into two groups: critical and suboptimal, as Tables[20](https://arxiv.org/html/2611.33314#A3.T20)and[21](https://arxiv.org/html/2611.33314#A3.T21)detail\.

During RL training, as we discuss in Section[4\.3\.4](https://arxiv.org/html/2611.33314#S4.SS3.SSS4), we find that while it is important to penalize critical issues, penalizing suboptimal issues may be too strict and thus negatively impact model quality\. However, for data filtering, we can curate desired behavior more strictly\. We first identify every example that violates any rule, then use an iterative LLM feedback loop to rewrite the offending patch or response until it satisfies all rules while preserving the original edit’s intent\. This ensures that every training sample has an ideal patch representation as its ground truth\.

##### Targeted Behavior Curation Pipelines\.

We also construct dedicated data curation pipelines to target specific model behaviors\. One particular class of behaviors we target is recurring problematic behaviors from earlier model iterations\. We address these behaviors through the preceding patch validity pipeline and a curation pipeline targeting insertion pattern propagation\.

Insertion pattern propagation is a failure mode in which the model repeats an insertion pattern across multiple edits in the same response\. The model generates the correct content for each insertion but places it incorrectly, often one or a few lines from its intended location\. For example, the editing context may show a user adding a new form field,password, afteremail, while the model placespasswordbeforeemailor after the field that followsemail\.

Both curation pipelines follow a similar procedure\. First, LLM\-based or rules\-based filters identify examples in outputs of previous model iterations that exhibit the target failure mode\. An iterative LLM feedback loop then rewrites the problematic responses\. The LLM judge returns rejected rewrites with a short description of the failure until they pass the target failure mode’s filter\. We pass each rewritten example through the quality filter and, if the example has not already undergone patch validity filtering, the patch validity filter\. Figure[9](https://arxiv.org/html/2611.33314#S4.F9)illustrates this process\.

Identify samples exhibiting target failure modeLLM rewrites responseLLM judge: passes target\-mode filter?Apply quality filter \(and patch validity filter, if not yet run\)Step 1Step 2\. Iterative rewriteStep 3no: rewrite againyesFigure 9:Targeted behavior curation pipelines\. Iterative rewriting repairs examples of a recurring failure mode\. After rewriting, quality and patch validity checks ensure that the repairs also meet the general training data quality requirements\.

#### 4\.2\.4Data Mixture

We construct the 17,454\-sample SFT dataset from converted NES data, bootstrapped multi\-edit data, and repairs of model outputs that fail patch validity checks\. No\-edit samples account for 45% of the dataset \(Table[3](https://arxiv.org/html/2611.33314#S4.T3)\)\. The mixture teaches the model behaviors that reinforcement learning cannot easily discover from an uninformed initialization: the patch format, anchored insertions, multi\-patch responses, and proximity\-first ordering\.

Table 3:SFT dataset composition\. Converted NES and bootstrapped data contribute equally, and repaired invalid patch data supplements them\.We select the patch\-count distribution rather than inherit it from the source datasets\. For the bootstrapped and invalid\-patch\-repair data, we sweep arithmetic, exponential, and log\-decay profiles over 1 to 9 patches\. Across the resulting full data mixtures, we compare approximate edit to no\-edit ratios of 50/50, 55/45, and 65/35\. Increasing the multi\-patch share raises the mean number of predicted patches but also increases patch validity failures, so the selected distribution balances these outcomes\. Table[4](https://arxiv.org/html/2611.33314#S4.T4)reports the resulting distribution among SFT samples that contain at least one edit\.

Table 4:Patch\-count distribution among SFT samples that contain at least one edit\. Single\-patch and multi\-patch examples each account for roughly half of samples with edits\.
#### 4\.2\.5Training Recipe

The primary goal of supervised fine\-tuning is to teach the patch output format and core edit behaviors\. Reinforcement learning then refines this initialization by reducing residual failure modes and improving suggestion quality\.

We use the same SFT recipe across runs\. Each run trains for 5 epochs with a learning rate of8\.1×10−58\.1\\times 10^\{\-5\}and a batch size of 32\. We evaluate checkpoints every 100 steps\. We linearly warm the learning rate over the first 5% of training and then decay it to 0\.

##### Checkpoint Selection\.

We select an SFT checkpoint for reinforcement learning initialization by applying three criteria in order\. First, the checkpoint must achieve acceptable scores on Simulation Tests, Augmented HumanEval, and POE\. Second, it must place edits correctly in a set of insertion placement cases that we identify during internal testing in Phase 1; we later formalize these cases by creating the QMH benchmark \(Section[3\.1](https://arxiv.org/html/2611.33314#S3.SS1)\)\. Third, it must average approximately 1\.3 patches per response and produce approximately 130 invalid patches on a 15,000\-sample diagnostic set\. The patch\-count target balances follow\-up edit frequency with opportunities for caching, while the invalid\-patch target limits the initial patch validity failures that reinforcement learning must reduce\.

#### 4\.2\.6Ablations

##### Multi\-Patch Behavior and Target\.

Initial SFT models learn the patch format from multi\-edit data but still emit mostly one patch, leaving no follow\-up edits for caching\. Adding single\-line completion examples does not help, while iterating the edit\-shape distribution establishes multi\-patch behavior, indicating that data distribution rather than format exposure is the limiting factor\.

Across 11 SFT checkpoints on the POE benchmark, mean edits range from 1\.32 to 2\.33 and the patch validity error rate among editing responses ranges from 2\.36% to 12\.23% \(Figure[10](https://arxiv.org/html/2611.33314#S4.F10)\)\. Mean patch count highlights the tradeoff between opportunities for caching and the frequency of follow\-up edits\. Lower mean counts limit opportunities for caching follow\-up patches; higher mean counts can offer more caching opportunities, but also risk unnecessary edits\. We also observe higher invalid patch rates as the mean patch count increases; we therefore target approximately 1\.3 patches per response to balance caching opportunities against patch validity failures\. Both the SFT and RL models achieve this target on POE\.

246810121\.31\.51\.71\.92\.12\.3Mean patches per responsePatch validity error rate \(%\)Selected SFT checkpointOther SFT candidates2\-patch\-minimumablation

Figure 10:Mean patch counts and patch validity error rates for SFT candidates on the POE benchmark\. The 2\-patch\-minimum ablation restricts training to examples whose ground truth labels contain 2 or more patches\. Higher mean patch count correlates with higher invalid patch rate\.

##### Rules\-Based Data Filtering\.

Rules\-based filters alone do not produce a set of workspace examples that improves training results\. Recorded outcomes provide useful signals, but they do not establish that each candidate forms a coherent, high\-quality training label\. The rules admit false positives that satisfy the heuristics despite weak edit quality and exclude false negatives that contain useful supervision\. We therefore use an LLM judge to assess each candidate’s coherence and quality before adding it to the training set\.

### 4\.3Reinforcement Learning

#### 4\.3\.1Data Mixture

We construct a data mixture for the Phase 1 RL stage by combining examples from multiple sources to balance scenario coverage and quality\. Initial models that use only the original NES data perform on par with the standalone NES models in offline benchmarks, but produce almost exclusively nearby NES edits, with few multi\-patch long\-distance edits\. The same samples sometimes elicit different behavior when we convert them to the diff\-patch format, including producing more incremental edits\. Below, we discuss the data mixture used alongside the SFT data in Section[4\.2\.4](https://arxiv.org/html/2611.33314#S4.SS2.SSS4)to address the scarcity of multi\-patch long\-distance edits\. In Section[5\.1\.1](https://arxiv.org/html/2611.33314#S5.SS1.SSS1.Px3), we describe the Phase 2 measures that address suggestion length and completeness\. We also use early online A/B experiments with these models to improve client integration before evaluating later candidates\.

We perform RL in two stages using the on\-policy algorithm we describe in Section[4\.3\.2](https://arxiv.org/html/2611.33314#S4.SS3.SSS2)\. First, we train on top of the SFT model we discuss in Section[4\.2\.5](https://arxiv.org/html/2611.33314#S4.SS2.SSS5)\. We evaluate this model through the fourth stage of the model selection process illustrated in Figure[7](https://arxiv.org/html/2611.33314#S3.F7), A/B experiment candidates\. The A/B experiment results show no statistically significant regression in any guardrail metrics, but continued offline dogfooding reveals the insertion pattern propagation failure mode described in Section[4\.2\.3](https://arxiv.org/html/2611.33314#S4.SS2.SSS3.Px3)\. As a result, we add data curated with the pipeline described in the same section to the mixture to target this behavior, and then perform another round of RL on the resulting model\.

Tables[5](https://arxiv.org/html/2611.33314#S4.T5)and[6](https://arxiv.org/html/2611.33314#S4.T6)report the dataset\-level and aggregate edit\-count distributions\. We note a few key characteristics of the data below\.

##### Scenario Diversity\.

As Table[5](https://arxiv.org/html/2611.33314#S4.T5)shows, we aim to represent a wide variety of scenarios and edit types across the RL data\. We filter all data for quality and repair it for patch validity\. The mixture includes scenarios from the original NES data and new dedicated datasets that we introduce during 2\-in\-1 model training, such as bootstrapped multi\-edit data, rewritten invalid patch data, and rewritten insertion pattern propagation data\.

##### Overall Edit Count Distribution\.

Because the SFT model already produces an appropriate edit\-count distribution, the RL mixture need not match the SFT distribution exactly\. Instead, the primary goal of the mixture is to represent the full spectrum of desirable and undesirable edits\. For instance, as Table[5](https://arxiv.org/html/2611.33314#S4.T5)shows, no\-edit samples account for 20\.9% of the RL mixture, compared with 45% of the SFT data\. Single\-edit samples account for 48\.8% of the RL mixture, compared with 26\.6% of the SFT data\. This difference reflects the distinct roles of no\-edit and single\-edit samples in RL and SFT\. In RL, we use separate graders for rollouts containing an edit and those containing no edit\. We find that allowing the grader to drive the decision boundary for when an edit is appropriate, combined with carefully selected samples that complement this decision boundary, results in better model learning of user intent and when to suggest an edit or abstain\. For single\-edit samples, SFT uses the ground truth response as an explicit label, while RL uses it as a reference prefix for an acceptable response, as we further discuss in Section[4\.3\.3](https://arxiv.org/html/2611.33314#S4.SS3.SSS3)\. This allows the model to learn desirable multi\-edit behaviors and generate them for single\-edit samples without incurring a penalty\. We discuss this further below\.

##### Edit Count Distribution of Newly Added 2\-in\-1 Data versus NES Data\.

As Table[6](https://arxiv.org/html/2611.33314#S4.T6)shows, 50\.3% of the mixture is original NES data and 49\.7% is newly added during 2\-in\-1 training\. The distribution of edit counts differs between the original NES data and the newly generated data, reflecting the goal of representing multi\-edit scenarios in the new set of data\. The original NES data contributes 34\.0% of the total mixture in single\-edit data, compared to a 14\.8% contribution from the new data\. Conversely, the original data contributes 3\.4% of the total mixture in multi\-edit data, compared to the 27\.0% contribution from the new data\.

##### Upweighting Rare Cases\.

For some error types, such as patch validity and insertion pattern propagation, negative examples are scarce\. After quality filtering, the curated set contains thousands of positive examples, but only a few hundred corrected negative examples that originally exhibit errors \(560 and 355 samples, respectively\)\. We handle these two error types differently across training stages\. For patch validity, we include the 560 repaired examples in both SFT \(Section[4\.2\.4](https://arxiv.org/html/2611.33314#S4.SS2.SSS4)\) and RL to establish and reinforce the required diff patch syntax\. For insertion pattern propagation, initial experiments show that demonstrating rewritten examples in SFT alone does not noticeably alter model behavior\. Because reinforcement learning is particularly effective for unlearning specific problematic behaviors from prior models and the insertion data is particularly scarce, we reserve the 355 insertion pattern propagation examples exclusively for RL\. To overcome their scarcity during RL, we introduce two complementary interventions: \(1\) we upsample the rewritten insertion pattern propagation examples by a factor of 5, from 355 to 1,775 samples, as Table[5](https://arxiv.org/html/2611.33314#S4.T5)shows, and \(2\) we use RL grader boosting to target this issue with a dedicated auxiliary grader, as we detail in Section[4\.3\.3](https://arxiv.org/html/2611.33314#S4.SS3.SSS3)\.

Table 5:Phase 1 RL data by scenario and edit count\. The mixture combines diverse edit scenarios with targeted repairs of known failure modes\.Table 6:Phase 1 RL data by source and edit count, with percentages relative to the full mixture\. The new data contributes roughly half of the samples but provides the majority of multi\-edit examples\.

#### 4\.3\.2RL Algorithm

We perform on\-policy reinforcement learning for the 2\-in\-1 model, drawing task examples from the data mixture we describe in Section[4\.3\.1](https://arxiv.org/html/2611.33314#S4.SS3.SSS1)\. At each optimization step, we sample a batch ofBBtask instances\. For each taskxix\_\{i\}in the batch, the policy generates a set of candidate completions \(rollouts\),yi​j∼πθ\(⋅∣xi\)y\_\{ij\}\\sim\\pi\_\{\\theta\}\(\\cdot\\mid x\_\{i\}\), which the grader evaluates\.

Each response receives a binary rewardRi​j∈\{0,1\}R\_\{ij\}\\in\\\{0,1\\\}denoting whether it passes the validation checks and criteria\. Following prior work\[[Bengio et al\., 2009](https://arxiv.org/html/2611.33314#bib.bib55);[Kumar et al\., 2010](https://arxiv.org/html/2611.33314#bib.bib56);[Matiisen et al\., 2017](https://arxiv.org/html/2611.33314#bib.bib57);[Florensa et al\., 2017](https://arxiv.org/html/2611.33314#bib.bib48);[Florensa et al\., 2018](https://arxiv.org/html/2611.33314#bib.bib49);[Jiang et al\., 2021](https://arxiv.org/html/2611.33314#bib.bib58);[Zelikman et al\., 2022](https://arxiv.org/html/2611.33314#bib.bib59);[Lightman et al\., 2023](https://arxiv.org/html/2611.33314#bib.bib60);[Yu and others, 2025](https://arxiv.org/html/2611.33314#bib.bib50);[Bae et al\., 2026](https://arxiv.org/html/2611.33314#bib.bib51)\], we filter tasks by their empirical pass rate to avoid uninformative gradient updates and high variance from tasks that are either intractable or already mastered by the current policy:

p^i=1N​∑j=1NRi​j,\\hat\{p\}\_\{i\}=\\frac\{1\}\{N\}\\sum\_\{j=1\}^\{N\}R\_\{ij\},whereNNis the number of evaluated rollouts per instance\. We exclude tasks with pass rates outside a configured interval\[τmin,τmax\]\[\\tau\_\{\\min\},\\tau\_\{\\max\}\]from the policy update\.

For the retained tasks, we follow REINFORCE and use a policy gradient update\[[Williams, 1992](https://arxiv.org/html/2611.33314#bib.bib52);[Sutton et al\., 1999](https://arxiv.org/html/2611.33314#bib.bib53)\]with a task\-level baseline to reduce variance:

∇θ𝒥​\(θ\)=𝔼⁡\[∑j∇θ​log​πθ​\(yi​j∣xi\)​\(Ri​j−bi\)\],\\nabla\_\{\\theta\}\\mathcal\{J\}\(\\theta\)=\\mathbb\{E\}\\left\[\\sum\_\{j\}\\nabla\_\{\\theta\}\\log\\pi\_\{\\theta\}\(y\_\{ij\}\\mid x\_\{i\}\)\\left\(R\_\{ij\}\-b\_\{i\}\\right\)\\right\],wherebib\_\{i\}denotes a baseline computed across the rollouts for taskxix\_\{i\}\. This use of same\-task rollouts to construct a baseline is shared with REINFORCE leave\-one\-out \(RLOO\)\[[Ahmadian et al\., 2024](https://arxiv.org/html/2611.33314#bib.bib54)\], which specifically averages the rewards of the other rollouts, excluding the rollout being scored\. The gradients are aggregated across all active instances in the batch, and model parameters are updated using the learning rateη\\eta\.

In our 2\-in\-1 RL experiments, we train with a batch size ofB=64B=64, evaluateN=8N=8rollouts per task, and use a learning rate ofη=1×10−5\\eta=1\\times 10^\{\-5\}\. We set the pass\-rate filtering thresholds separately for each dataset category, with lower bounds falling within0\.20≤τmin≤0\.500\.20\\leq\\tau\_\{\\min\}\\leq 0\.50and upper bounds falling within0\.90≤τmax≤0\.950\.90\\leq\\tau\_\{\\max\}\\leq 0\.95\.

#### 4\.3\.3Grader

For thejj\-th rollout responseyi​jy\_\{ij\}that the policy generates for task instanceii, the grader returns a binary outcomeRi​j∈\{0,1\}R\_\{ij\}\\in\\\{0,1\\\}\. Here,Ri​j=1R\_\{ij\}=1denotes a passing response andRi​j=0R\_\{ij\}=0a failing response\. We writeyi​j∼πθ\(⋅∣xi\)y\_\{ij\}\\sim\\pi\_\{\\theta\}\(\\cdot\\mid x\_\{i\}\), wherexix\_\{i\}is the task input for instanceiiandπθ\\pi\_\{\\theta\}is the current policy\.

We develop a custom grader that combines rules\-based patch validity checks with an LLM judge\. We also use both components in the data quality filters detailed in Section[4\.2\.3](https://arxiv.org/html/2611.33314#S4.SS2.SSS3)\. Suggestion quality covers criteria for desirable edit behavior along with patch amounts and ordering\. Figure[11](https://arxiv.org/html/2611.33314#S4.F11)illustrates the decision tree logic of this custom grader\. The evaluation first branches on whether the ground truth requires no edit or contains edits\. If the ground truth requires no edit, the grader checks the response for edits: predicting an edit receives a score of 0, whereas predicting no edit receives a score of 1\. If the ground truth contains an edit, the evaluation branches on whether the rollout prediction abstains or suggests an edit\. When the prediction is no edit, our no\-edit grader variant evaluates whether abstention satisfies the decision boundary articulated in Section[4\.2\.3](https://arxiv.org/html/2611.33314#S4.SS2.SSS3)\. The judge assigns an LLM quality score between 0 and 1, and an inclusive threshold of 0\.5 assigns a passing score of 1, while lower scores receive 0\.

When the prediction contains an edit, the evaluation routes by ground truth edit count to either our single\-edit or multi\-edit grader variant\. For instances where the ground truth has a single edit, the single\-edit grader provides the ground truth as an example of aprefixof a desirable response rather than enforcing an exact match or identical patch count in order to encourage generalizable taste in quality and patch count\. For instances where the ground truth has multiple edits, the multi\-edit grader provides the ground truth as an example of a desirable response, rather than enforcing an exact match, for the same reason\. The single\- and multi\-edit graders assign responses an LLM quality score between 0 and 1 inclusive in increments of 0\.1, and an inclusive threshold of 0\.8 assigns a passing score of 1, while lower scores receive 0\. All scoring leaves across these branches define the final binary rewardRi​j∈\{0,1\}R\_\{ij\}\\in\\\{0,1\\\}\.

We primarily use rules\-based checks to assign a score of 0, while the LLM judge determines whether a response merits a score of 1\. Thus, we also apply additional rules\-based checks to assign a score of 0, such as patch validity, code compilation \(requiring that the resulting code after patch application compiles successfully if the code compiles successfully prior to the edit\), patch length constraints, and scenario\-specific requirements\. We also experiment with raising the LLM judge score to the power of 4, which sharpens the distinction between higher\- and lower\-quality edits; in these cases, the inclusive threshold becomes 0\.35\. Our final grader does not use exponentiation\.

Rollout responseyi​jy\_\{ij\}& task contextGroundtruth?Predictionhas edit?Predictionis no edit?Score 0Score 1GT editcount?No\-edit grader\(LLM judge\)Single\-edit grader\(GT as reference prefix\)Multi\-edit grader\(GT as reference\)Score≥0\.5\\geq 0\.5?Score≥0\.8\\geq 0\.8?Score 1Score 0Score 1Score 0Final rewardRi​j∈\{0,1\}R\_\{ij\}\\in\\\{0,1\\\}no edithas edityesnoyesnoquality scoreyesnosinglemultiquality scoreyesno

Figure 11:Core logic behind the reinforcement learning custom grader, expressed as a decision tree focused on edit type\. Given a rollout responseyi​jy\_\{ij\}and task ground truth, the grader branches on whether the ground truth requires no edit or contains edits, routing to rules\-based checks, the no\-edit LLM judge \(thresholded at 0\.5\), or single\- and multi\-edit LLM judges \(thresholded at 0\.8\) to determine the final binary rewardRi​jR\_\{ij\}\. We omit additional granular rules\-based checks such as patch validity mentioned in Section[4\.3\.3](https://arxiv.org/html/2611.33314#S4.SS3.SSS3)for brevity\.One challenge in developing a centralized LLM judge for the custom grader is balancing multiple objectives\. When we add objectives, the grader may not satisfy all of them consistently, which can create blind spots in its judgments\. We address this challenge withgrader boosting: auxiliary graders strengthen the residual signal while the main grader focuses on criteria for the most common scenarios\.

##### Grader Boosting\.

We name grader boosting after the statistical concept of gradient boosting\[[Friedman, 2001](https://arxiv.org/html/2611.33314#bib.bib1)\]\. We generalize it as a directed acyclic graph of main and auxiliary graders\. The graph’s topological execution order dictates grader orchestration, including each grader’s invocation conditions and potential inputs\. Each grader can take input from any node that precedes it topologically\. Main graders typically provide canonical or general assessments, while auxiliary graders focus on specific aspects of response quality that the main grader may underrepresent or overlook\. The final score assembly combines these auxiliary assessments with the main grader’s assessment\.

In the case of the 2\-in\-1 RL grader, we observe upon qualitative inspection of rollouts that the main grader does not reliably flag insertion pattern propagation errors despite the targeted data\. We therefore develop an auxiliary grader specifically for this behavior\. We hypothesize that adding insertion pattern guidance to the main grader, which already covers 14 quality criteria, may reduce its judgment quality on other aspects of suggestion quality\. Because this pattern has a narrow scope, we gate the auxiliary grader on relevant instances to focus its feedback on these cases\. The reported results do not isolate the auxiliary grader’s contribution from that of upsampling the insertion pattern propagation examples\.

As shown in Figure[12\(a\)](https://arxiv.org/html/2611.33314#S4.F12.sf1), we invoke the insertion pattern propagation auxiliary grader whenever a well\-formed diff patch contains an insertion view kind in any ground truth or predicted patch\. The final score assembly takes on the following logic:

Ri​j=\{0if​Ri​jaux<1Ri​jmainotherwiseR\_\{ij\}=\\begin\{cases\}0&\\text\{if \}R\_\{ij\}^\{\\text\{aux\}\}<1\\\\ R\_\{ij\}^\{\\text\{main\}\}&\\text\{otherwise\}\\end\{cases\}
Figure[12\(b\)](https://arxiv.org/html/2611.33314#S4.F12.sf2)shows the general form of grader boosting as a directed acyclic graph\.

Input sampleMain graderRi​jmain∈\{0,1\}R\_\{ij\}^\{\\mathrm\{main\}\}\\in\\\{0,1\\\}Ground truth or prediction has any patch with insertion view kind?Insertion\-patternpropagation auxiliary graderRi​jaux∈\{0,1\}R\_\{ij\}^\{\\mathrm\{aux\}\}\\in\\\{0,1\\\}Ri​jaux<1R\_\{ij\}^\{\\mathrm\{aux\}\}<1?Ri​j=0:Ri​jmainR\_\{ij\}=0:R\_\{ij\}^\{\\mathrm\{main\}\}Ri​jR\_\{ij\}\(a\)Insertion\-pattern propagation example\.Input sampleMain graderRi​jmainR\_\{ij\}^\{\\mathrm\{main\}\}text, and/or otherAuxiliary grader Ainclusion/exclusion filterAuxiliary grader 1inclusion/exclusion filterAuxiliary gradernninclusion/exclusion filterAuxiliary grader ARi​jaux,AR\_\{ij\}^\{\\mathrm\{aux\},A\}text, and/or otherAuxiliary grader 1Ri​jaux,1R\_\{ij\}^\{\\mathrm\{aux\},1\}text, and/or otherAuxiliary gradernnRi​jaux,nR\_\{ij\}^\{\\mathrm\{aux\},n\}text, and/or otherFinal score assemblyRi​jR\_\{ij\}Final scoreRi​jR\_\{ij\}⋮\\vdots⋮\\vdots\(b\)General grader\-boosting graph with input\-gated auxiliary graders and final score assembly\.
Figure 12:Grader boosting technique, illustrated by the insertion pattern propagation example \(a\) and the generalized RL grader\-boosting mechanism \(b\)\.
##### Grader Calibration\.

There exist many ways to calibrate graders against human judgment\. In this work, we align our graders with human feedback, or quality signals for particular editing contexts \(e\.g\., acceptance and dismissal\)\. For the main grader, we employ a self\-refinement loop against the data in our POE offline benchmark \(Section[3\.1](https://arxiv.org/html/2611.33314#S3.SS1)\) using the GitHub Copilot agent harness and an agent skill for grader optimization\. First, we obtain the grader’s judgment for each POE sample\. We then construct the confusion matrix of false positives, false negatives, true positives, and true negatives\. Next, we randomly sample examples from each confusion matrix category to understand patterns and failure modes in the grader’s judgments\. We then invoke the agent to adapt the current grader’s instructions to incorporate feedback from the confusion matrix analysis\. We repeat this process until the changes in the true positive and false positive rates between consecutive rounds fall below a target threshold\.

Algorithm[1](https://arxiv.org/html/2611.33314#alg1)formalizes this procedure\. Letziz\_\{i\}denote the binary quality label for POE exampleii, and letz^i\(t\)=1\\hat\{z\}\_\{i\}^\{\(t\)\}=1when the main grader passes that example under instructionsItI\_\{t\}\.

Algorithm 1Quality signal\-based main grader calibration1:POE examples

𝒟=\{\(xi,zi\)\}i=1N\\mathcal\{D\}=\\\{\(x\_\{i\},z\_\{i\}\)\\\}\_\{i=1\}^\{N\}, initial instructions

I0I\_\{0\}, tolerance

ϵ\>0\\epsilon\>0
2:Calibrated instructions

ItI\_\{t\}
3:

t←0t\\leftarrow 0
4:whiletruedo

5:Evaluate the main grader on all

xi∈𝒟x\_\{i\}\\in\\mathcal\{D\}using

ItI\_\{t\}to obtain

z^i\(t\)\\hat\{z\}\_\{i\}^\{\(t\)\}
6:Compute

TPt=∑i𝟙​\[zi=1,z^i\(t\)=1\]\\mathrm\{TP\}\_\{t\}=\\sum\_\{i\}\\mathds\{1\}\[z\_\{i\}=1,\\hat\{z\}\_\{i\}^\{\(t\)\}=1\]and

FPt=∑i𝟙​\[zi=0,z^i\(t\)=1\]\\mathrm\{FP\}\_\{t\}=\\sum\_\{i\}\\mathds\{1\}\[z\_\{i\}=0,\\hat\{z\}\_\{i\}^\{\(t\)\}=1\]
7:Compute

FNt=∑i𝟙​\[zi=1,z^i\(t\)=0\]\\mathrm\{FN\}\_\{t\}=\\sum\_\{i\}\\mathds\{1\}\[z\_\{i\}=1,\\hat\{z\}\_\{i\}^\{\(t\)\}=0\]and

TNt=∑i𝟙​\[zi=0,z^i\(t\)=0\]\\mathrm\{TN\}\_\{t\}=\\sum\_\{i\}\\mathds\{1\}\[z\_\{i\}=0,\\hat\{z\}\_\{i\}^\{\(t\)\}=0\]
8:Compute

TPRt=TPtTPt\+FNt\\mathrm\{TPR\}\_\{t\}=\\frac\{\\mathrm\{TP\}\_\{t\}\}\{\\mathrm\{TP\}\_\{t\}\+\\mathrm\{FN\}\_\{t\}\}and

FPRt=FPtFPt\+TNt\\mathrm\{FPR\}\_\{t\}=\\frac\{\\mathrm\{FP\}\_\{t\}\}\{\\mathrm\{FP\}\_\{t\}\+\\mathrm\{TN\}\_\{t\}\}
9:if

t\>0t\>0and

max⁡\{\|TPRt−TPRt−1\|,\|FPRt−FPRt−1\|\}≤ϵ\\max\\\{\|\\mathrm\{TPR\}\_\{t\}\-\\mathrm\{TPR\}\_\{t\-1\}\|,\|\\mathrm\{FPR\}\_\{t\}\-\\mathrm\{FPR\}\_\{t\-1\}\|\\\}\\leq\\epsilonthen

10:return

ItI\_\{t\}
11:endif

12:foreach nonempty confusion\-matrix category

c∈\{TP,FP,FN,TN\}c\\in\\\{\\mathrm\{TP\},\\mathrm\{FP\},\\mathrm\{FN\},\\mathrm\{TN\}\\\}do

13:Uniformly sample a subset

𝒮tc\\mathcal\{S\}\_\{t\}^\{c\}of examples in category

ccfor LLM\-based qualitative analysis for common failure modes

14:endfor

15:

It\+1←Refine​\(It,\{𝒮tc\}c\)I\_\{t\+1\}\\leftarrow\\textsc\{Refine\}\(I\_\{t\},\\\{\\mathcal\{S\}\_\{t\}^\{c\}\\\}\_\{c\}\)using the agent and the qualitative analysis

16:

t←t\+1t\\leftarrow t\+1
17:endwhile

We run this calibration process for 24 rounds before convergence\. The resulting main grader reduces false negatives by 8\.4% and false positives by 1\.1%\. We note that quality signals can be noisy, which means that one set of data often does not delineate a perfect decision boundary\. However, these results demonstrate that this iterative calibration process improves grader agreement with the quality signals on the calibration samples\.

#### 4\.3\.4Ablations

##### Patch Count Bonuses\.

In addition to adding more multi\-edit data to the SFT and RL recipes, we also test whether adding a conditional programmatic bonus to the RL reward encourages the model to produce more high\-quality multi\-edit responses\.

The programmatic adjustment rewards multi\-patch edit responses only when their format score is nonzero and their LLM quality score is at least 0\.7; single\-patch edit responses with a nonzero format score receive a penalty regardless of that quality threshold\. We test adjustments both before and after a score exponentiation, which sharpens the reward’s preference for high\-quality responses by raising edit scores to the power of 4 and no\-edit scores to the power of 3\. Before exponentiation, the adjustment adds 0\.1 for 2 patches or 0\.2 for 3 or more patches, and subtracts 0\.1 for a single patch\. After exponentiation, the corresponding bonuses are 0\.05 and 0\.1, and the single\-patch penalty is 0\.03\. We cap bonuses at 1 and floor penalties at 0\. Qualifying multi\-patch edits whose first edit is a ghost text view kind edit may also receive an additional bonus\. We also test continuous reward configurations with and without a translated Heaviside function gate that sets edit rewards to 0 below a configurable quality floor, evaluating the gate either on the adjusted pre\-exponentiation score or on the post\-exponentiation score\.

We compare nine 2\-in\-1 offline evaluation candidates trained with different variations of the patch count bonus and nine candidates trained without the patch count bonus\. As shown in Figure[13](https://arxiv.org/html/2611.33314#S4.F13), we observe that while patch counts trend higher for the former group \(a median of 1\.41 edits compared to 1\.33\), quality metrics suffer\. The latter group has a lower median patch validity error rate \(0\.56% versus 0\.73%\), higher median POE acceptance rate \(34\.4% versus 30\.7%\), higher acceptance\-to\-rejection rate ratio \(1\.49 vs 1\.43\), and higher median ratio of rejected\-to\-no\-edit to accepted\-to\-no\-edit counts \(2\.11 versus 1\.89\)\. Rejection rate is an exception to this pattern: the no\-bonus group has a higher median \(23\.0% versus 21\.6%\), while the bonus group spans a wider range \(19\.2% to 26\.5% versus 20\.4% to 25\.3%\)\. The spread and variance are arguably greatest for this metric\. We qualitatively attribute the negative impact of this rules\-based reward to reward hacking, in which optimization exploits a reward specification without satisfying its intended objective\[[Amodei et al\., 2016](https://arxiv.org/html/2611.33314#bib.bib14)\]\. Models learn undesired behaviors, such as adding meaningless patches like trivial comments, to increase the reward at the cost of response quality\.

These trends support removing rules\-based reward elements for patch counts\. However, these comparisons include few candidates and describe groups rather than a matched, single\-factor experiment, so we make no statistical claims\. We use the results to inform subsequent grader designs: we encode nuanced or conditional behavior, especially tradeoffs, in the LLM judge rather than in rules, which may be brittle and more prone to reward hacking\.

Figure 13:Comparison of patch count reward configurations on key POE metrics after RL training\. Candidates trained with the rules\-based patch count bonus have a higher median patch count but lower median acceptance rate, patch validity, and acceptance\-to\-rejection ratio\. Though these descriptive comparisons do not isolate causal effects, they motivate removing the bonus from the grader\.
##### Critical and Suboptimal Patch Penalties\.

We also ablate whether the RL grader should penalize only critical patch validity issues or also suboptimal ones, as discussed in Section[4\.2\.3](https://arxiv.org/html/2611.33314#S4.SS2.SSS3)\. We hypothesize that penalizing only critical issues provides a better middle ground than penalizing all suboptimally expressed patches\. Allowing less efficient patches that do not affect end\-user experience may give the model more flexibility to learn more important characteristics of high\-quality responses\. In some cases, these patches may even benefit the model; for instance, no\-op patches in which deletions match additions may serve as a chain\-of\-thought for considering viable, even if ultimately non\-optimal, edit locations\.

Figure[14](https://arxiv.org/html/2611.33314#S4.F14)compares twelve offline evaluation candidate checkpoints across the three Augmented HumanEval subdatasets\. We use this benchmark because it measures the model’s ability to provide complete and working suggestions, which we qualitatively find declines when we penalize correct but suboptimally efficient patches\. Overall, critical\-only checkpoints tend to achieve higher Augmented HumanEval accuracy than checkpoints that receive both critical and suboptimal patch validity constraints during training\. Critical patch validity error rates overlap across the two training conditions, while critical\-only models generally achieve higher Augmented HumanEval scores\. Their total error rates are higher, consistent with a greater contribution from suboptimal patch validity errors, which the critical\-only condition does not penalize\. The final 2\-in\-1 shipping candidate \(stage 2\) uses only critical patch validation and scores 92\.0, 75\.9, and 84\.2 on the three subdatasets, the highest score in each subset, while maintaining a relatively low total error rate\. The contrast between stages 1 and 2 illustrates the tradeoff between suboptimal patch validity errors and Augmented HumanEval accuracy across the three subdatasets\. These selected\-checkpoint comparisons are descriptive and do not isolate the effect of penalty strictness\.

\(a\)Critical patch validity error rate\.\(b\)Total patch validity error rate, including critical and suboptimal errors\.
Figure 14:Augmented HumanEval subdataset scores against \(a\) critical and \(b\) total patch validity error rates\. These results motivate our choice of critical\-only penalties\. Model checkpoints trained with them generally achieve higher completion scores with comparable critical error rates, though they exhibit more suboptimal patch errors\. Notably, the shipped 2\-in\-1 checkpoint still maintains a low total error rate despite using critical\-only penalties\.

### 4\.4Results

#### 4\.4\.1Offline Benchmarks

Table[7](https://arxiv.org/html/2611.33314#S4.T7)compares the SFT checkpoint with checkpoints from two sequential RL stages for the 2\-in\-1 model\. Across both stages, reinforcement learning teaches the model to avoid poor\-quality suggestions \(STests MustAvoid\), improve suggestion quality \(STests Total, Augmented HumanEval\), improve abstention discernment \(POE rejection\-to\-no\-edit to acceptance\-to\-no\-edit ratio, R/A→\\rightarrowNE\), and maintain the SFT multi\-patch operating point \(POE mean patches\)\. Stage 2 further improves completion performance \(Augmented HumanEval\) compared to Stage 1\. We show QMH for reference only\. Because we use QMH to select RL checkpoints \(Section[3\.4](https://arxiv.org/html/2611.33314#S3.SS4)\), the RL checkpoints’ scores of 18/19 and 19/19 partly reflect that selection and are not independent evidence of quality\. We formalize the 19\-case QMH set late in RL stage 1, so we score the SFT checkpoint on it retrospectively\.

Table 7:Phase 1 offline results for SFT and two RL stages\. RL improves STests, Augmented HumanEval, and POE over SFT while maintaining a similar mean patch count; we use QMH for checkpoint selection and show it for reference\.
#### 4\.4\.2Online Evaluation

Over the course of Phase 1, we evaluate 14 model candidates across four rounds of online A/B experiments\. These experiments validate the output format and client integration, screen model candidates against guardrail metrics, and refine the recipe to target and correct insertion placement errors we discover during internal testing\.

##### Benchmark Refinement through Qualitative Testing\.

The second round of experiments demonstrates that existing offline benchmark parity and a clean online scorecard do not alone establish deployment readiness\. During this round, we have not yet introduced the QMH benchmark and rely on the other four quantitative benchmarks and online A/B experimentation as the primary means of evaluation\. Although two candidates meet the quantitative criteria in this round, further testing identifies overly frequent suggestions, incorrect insertion placement, and code duplication\. This discrepancy motivates the development of the QMH benchmark as an initial quality filter, the POE benchmark as the primary offline benchmark, and Simulation Tests, Augmented HumanEval, and Output View Kind as guardrail benchmarks\. These results also underscore the importance of treating benchmark coverage as iterative: qualitative findings from internal testing can expose behaviors that existing measures miss and guide the addition or refinement of targeted evaluation cases\.

##### 2\-in\-1 Model Results\.

Table[8](https://arxiv.org/html/2611.33314#S4.T8)reports results for the final 2\-in\-1 model candidate paired with the separate completion model against the three\-model baseline in an A/B experiment\. The experiment randomly assigns a fraction of VS Code stable users to each condition\. The experiment finds no statistically significant regression in shown, accepted, or dismissed suggestions, recurring engagement, or accepted and retained characters\. Mean time to display and mean time to produce decrease by 6\.77% and 5\.95%, while output and prompt tokens decrease by 58\.93% and 4\.83%, respectively\. These reductions coincide with a more compact output format, a smaller input context, and fewer sequential model calls\. Cached suggestion share increases by 8\.86%\.

Table 8:Phase 1 online A/B experiment results for the 2\-in\-1 model paired with the completion model relative to the three\-model baseline\. Latency and token counts decrease, with no statistically significant regression in other quality and engagement metrics\.

## 5Phase 2: Unifying the 2\-in\-1 Model with Code Completion

The diff patch format can express completion suggestions as well as nearby and long\-distance edits\. We therefore first test whether the 2\-in\-1 model can handle all three tasks by removing the separate completion model from the client\. An online experiment against the 2\-in\-1 model paired with the completion model shows a 22\.45% decrease in accepted suggestions per user and an 18\.99% decrease in accepted and retained characters \(ARC\) at 30 seconds, both statistically significant\. The experiment randomly assigns a fraction of VS Code stable users to each condition\. Table[9](https://arxiv.org/html/2611.33314#S5.T9)reports these effects with their confidence interval half\-widths\. These regressions show that the completion model still plays an important role in suggestion acceptance and retained characters\. Supporting completion in the output format is not sufficient to preserve the quality of the paired system\. Phase 2 therefore aims to improve completion behavior and address these regressions through completion\-focused reinforcement learning and client adaptation, producing the 3\-in\-1 model we present here\.

Table 9:Initial Phase 2 online experiment removing the separate completion model\. Relative changes compare the 2\-in\-1 model alone with the 2\-in\-1 model paired with the completion model\. Using the 2\-in\-1 model for completion without additional training results in statistically significant regressions\.We develop the completion\-focused data mixture, completeness grader, and client adaptation together, iterating on data sources, sample weights, grading criteria, and client settings\. We describe these components separately below, although their development is interleaved\.

### 5\.1Reinforcement Learning

#### 5\.1\.1Data Mixture

We construct the Phase 2 RL mixture by extending the Phase 1 mixture with completion examples\. The added data targets ghost text at the cursor while retaining coverage of nearby and long\-distance edits\. Table[10](https://arxiv.org/html/2611.33314#S5.T10)lists the five datasets we add in this phase\. Sample counts are before upsampling\. We describe their roles and the changes to the inherited mixture below\.

Table 10:Datasets added to the Phase 2 RL mixture\. Added examples target ghost text at the cursor and completion length\. Completion length examples receive tenfold upsampling to increase their representation\.Table 11:Upsampling of inherited patch validity and insertion pattern propagation data\. Phase 2 increases both factors to maintain coverage of known failure modes as the mixture expands\.In addition to these data, we upsample examples that address two Phase 1 failure categories: patch validity and insertion pattern propagation\. Through experimentation, we find that this additional upsampling adequately maintains the model’s exposure to these cases to counterbalance the volume of examples from the additional sources in Table[10](https://arxiv.org/html/2611.33314#S5.T10)\. Table[11](https://arxiv.org/html/2611.33314#S5.T11)summarizes the upsampling we apply to these datasets in the Phase 1 and Phase 2 RL recipes\. Factors in both phases are total multipliers relative to the original sample counts shown\.

In Phase 1, the completion model produces only ghost text, while the 2\-in\-1 model supports all seven view kinds\. The 3\-in\-1 model replaces both models and therefore must produce ghost text more often than the 2\-in\-1 model alone to preserve completion behavior alongside next edit suggestions\. One purpose of the added data is to increase the ghost text share in the training mixture, as defined by the ghost text ratio discussed in Section[3\.1](https://arxiv.org/html/2611.33314#S3.SS1.SSS0.Px3)\. Table[12](https://arxiv.org/html/2611.33314#S5.T12)summarizes sample counts and ghost text shares after upsampling for the inherited data, the added data, and the combined mixture\.

Table 12:Phase 2 RL sample counts and ghost text shares after upsampling\. We use the same view\-kind classifier as Output View Kind v1 \(Section[3\.1](https://arxiv.org/html/2611.33314#S3.SS1.SSS0.Px3)\)\. We compute the ghost text share by dividing the ghost text count by the total sample response count excluding no edit, whitespace\-only, and unknown responses\. The added data raises the mixture’s ghost text share from approximately 32% to 66%\.##### Converted Ghost Text Data\.

We use the first pipeline described in Section[4\.2\.1](https://arxiv.org/html/2611.33314#S4.SS2.SSS1)to convert existing prompt\-response samples into diff patches\. The source data comes from three types of models: a completion model, an NES model, and a joint completion\-and\-NES model\. We filter suggestions from both the NES model and the joint model to the ghost text view kind\. The joint model supports both code completion and nearby next edit suggestion using the NES window\-rewrite prompt and output format, without predicting long\-distance edits\. We explore this approach as an intermediate step to generate more ghost text in unified models before adopting the diff patch format\. It retains the rewrite\-window representation and adapts training to increase the model’s tendency to produce ghost text\. Distilling knowledge from this intermediate model into the diff patch 3\-in\-1 model helps improve ghost text generation by using edits sampled from the distribution of a unified model that combines both completion and nearby next edit capabilities\.

##### Cursor\-First Multi\-Edit Examples\.

We add examples whose recorded editing action begins with a ghost text completion at the cursor and spans multiple patches\. This subset supports completion at the cursor followed by related edits elsewhere, rather than encouraging the model to move away from the cursor before completing the local code\.

##### Completion Length Examples\.

We investigate suggestion completeness as one of several ways to improve completion behavior and address ARC regressions\. The ARC regression in Table[9](https://arxiv.org/html/2611.33314#S5.T9), along with observed lower predicted character counts in ghost text suggestions, motivates the hypothesis that some suggestions are too short or incomplete; developers may accept a promising start to a suggestion, but later rewrite or remove it when the rest of the code is missing\. To target this behavior, an LLM identifies short or incomplete ghost text suggestions and rewrites them into longer, complete suggestions\. We convert the rewritten examples into diff patches and upsample this dataset by a factor of 10\. We introduce the data together with the ghost text completeness auxiliary grader described below\.

#### 5\.1\.2Training Recipe

##### Ghost Text Completeness Auxiliary Grader\.

To target the incomplete suggestions described in Section[5\.1\.1](https://arxiv.org/html/2611.33314#S5.SS1.SSS1.Px3), we extend the Phase 1 grader with an auxiliary LLM judge focused on ghost text completeness\. The main judge continues to assess general suggestion quality, while the auxiliary judge evaluates whether a completion provides a complete, usable unit of code for the apparent editing intent\. We retain the insertion pattern propagation auxiliary grader and use the same grader boosting approach described in Section[4\.3\.3](https://arxiv.org/html/2611.33314#S4.SS3.SSS3)\.

We gate the completeness judge on examples designated as requiring ghost text, and it runs only when both the reference and the candidate response are ghost text edits\. Given the editing context, reference edit, and candidate suggestion, it identifies the intended code unit and checks whether the candidate is at least as complete as the reference\. For example, it rejects a function signature without the body supplied by the reference, a test without its assertion, or a partially completed argument list\. The candidate need not match the reference text and may be shorter or use a different structure if it provides a complete solution to the same intent\.

The auxiliary judge returns a binary score: 1 for a sufficiently complete suggestion and 0 for an incomplete one\. As in Phase 1, an auxiliary score below 1 sets the final reward to 0; otherwise, we retain the main judge’s score\. We use the same completeness check in both the single\-edit and multi\-edit grader variants\.

To track suggestion size while addressing the ARC regression, we also introduce Output View Kind v2 \(Section[3\.1](https://arxiv.org/html/2611.33314#S3.SS1.SSS0.Px3)\)\. Its average inserted characters and lines per patch and average patches per response describe the amount of code suggested, which is relevant to ARC\.

##### Preceding\-Line Duplication Check\.

When we increase the share of completion examples in the training mixture, the model sometimes repeats the line immediately before the insertion point or a larger block of preceding context\. The model should return no edit rather than introduce this redundant code\. We track this failure mode in QMH and add a preceding\-line duplication rule to the patch validity checker\. The rule marks these patches as invalid, so the training signal penalizes duplication and candidates perform better on the corresponding QMH cases\.

### 5\.2Client Adaptation

Inline suggestions depend on both the model and the client that presents its output\. The client constructs prompts, schedules model requests, caches responses, and renders the suggestion user interface, determining when suggestions appear and how it displays them to the developer\. Replacing the completion and 2\-in\-1 models with a single model therefore requires adapting client behavior to the combined task\. We describe five candidate changes to the VS Code client below and evaluate them through online experiments\. The final model\-plus\-client configuration combines four adaptations: the 3\-in\-1 speculative decoding draft, progressive ghost text reveal, diff\-based view kind rendering, and cross\-mode suppression of ignored suggestions\.

##### Speculative Decoding Draft Text\.

Speculative decoding accelerates autoregressive generation by proposing draft tokens and verifying them in parallel with the target model, allowing multiple tokens to be accepted in a single model pass\[[Stern et al\., 2018](https://arxiv.org/html/2611.33314#bib.bib46);[Xia et al\., 2023](https://arxiv.org/html/2611.33314#bib.bib47);[Leviathan et al\., 2023](https://arxiv.org/html/2611.33314#bib.bib9);[Chen et al\., 2023](https://arxiv.org/html/2611.33314#bib.bib11)\]\. For inline suggestions, the client constructs the speculative decoding draft by predicting a likely prefix of the diff patch response from the current file content\. The 2\-in\-1 client uses a file path header as the draft\. For the 3\-in\-1 model, we use a draft that anticipates a completion at the cursor by supplying the prefix of a diff patch anchored to the current line\. The draft spans three lines: the patch header, the anchoring deletion, and the beginning of the addition line\. Figure[15](https://arxiv.org/html/2611.33314#S5.F15)compares the two drafts for a function body completion\. We select the 3\-in\-1 draft format based on a load test comparing five draft formats \(Appendix[B](https://arxiv.org/html/2611.33314#A2)\)\. Although the 3\-in\-1 draft matches a longer response prefix in Figure[15](https://arxiv.org/html/2611.33314#S5.F15), it can mismatch the response when the suggested edit is not an insertion at the current line, wasting computation and reducing the speedup from speculative decoding\. However, the higher ghost text ratio of the 3\-in\-1 model relative to the 2\-in\-1 model in Table[16](https://arxiv.org/html/2611.33314#S5.T16)and its completion\-focused training motivate our expectation of more frequent matches to the cursor\-anchored draft\. The 3\-in\-1 speculative decoding draft significantly reduces mean time to display and mean time to produce relative to the 2\-in\-1 draft, as shown by the rendering and speculative decoding ablations in Table[13](https://arxiv.org/html/2611.33314#S5.T13)\.

File content:/path/to/util\.py

def count\_words\(text: str\) \-\> int: return len\(text\.split\(\)\)

Speculative decoding draft \(2\-in\-1\)

/path/to/util\.py:0\-def count\_words\(text: str\) \-\> int:\+def count\_words\(text: str\) \-\> int:\+ return len\(text\.split\(\)\)
Speculative decoding draft \(3\-in\-1\)

/path/to/util\.py:0\-def count\_words\(text: str\) \-\> int:\+def count\_words\(text: str\) \-\> int:\+ return len\(text\.split\(\)\)
Legend:Inserted textSpeculative decoding draft

Figure 15:Speculative decoding drafts for a function body completion\. The function signature is present when the client triggers the request; the body is the suggested insertion\. Both lower panels show the same diff patch response and highlight the respective draft prefix\.
##### Progressive Ghost Text Reveal\.

We extend the completion client’s progressive reveal behavior to the unified model\. The client streams the response from the model, displays the immediately relevant portion as soon as it arrives, and progressively reveals the remainder\. In addition to reducing the time to initial display, progressive reveal allows the developer to inspect the suggestion incrementally rather than evaluate the entire block at once\.

##### Diff\-Based View Kind Rendering\.

The raw structure of a patch does not always imply the most suitable presentation\. For example, a replacement patch may reproduce existing text while adding new content, even though the effective change consists only of insertions\. The client therefore computes the diff between the original and patched code for each patch and derives the view kind from that diff\. This preserves the proposed code change and allows the client to display it as ghost text or another insertion view instead of a replacement\. Figure[16](https://arxiv.org/html/2611.33314#S5.F16)illustrates how the client can present a replacement\-shaped patch as two insertions\.

Figure 16:Diff\-based view kind rendering of a replacement\-shaped patch\. The raw patch replacescuttlefishwith four lines, which the client can display as a side\-by\-side replacement\. Computing the diff identifiescuttlefishas unchanged and separates the effective change into two insertions:axolotlandblobfishbefore it, anddolphinafter it\. The first insertion is at the cursor, so the client can render it as ghost text\. Both presentations produce the same final code; the right column shows the inserted text, not additional model\-generated patches\.
##### Cross\-Mode Suppression of Ignored Suggestions\.

The completion client behavior removes ghost text when the cursor moves, whereas the NES client persists it because NES suggestions can arrive asynchronously during cursor movement\. The 3\-in\-1 model retains the NES client behavior, so an ignored ghost text suggestion persists after cursor movement\. In certain cases, it can reappear as a next edit suggestion\. We change the client to suppress this reappearance, preventing it from presenting the same ignored suggestion again in a different view kind\.

##### Cache Delay\.

The client caches streamed edits locally and retrieves them when the editor requests a suggestion\. Caching is particularly useful for multi\-patch responses: the client shows the first patch and keeps subsequent patches available to display after the developer accepts the first\. Because displaying a cached suggestion requires no new model request, the next suggestion can appear with little delay\. However, suggestions that appear too quickly can interrupt the developer’s typing\. The existing client applies a 200\-millisecond delay before displaying cached suggestions\. We hypothesize that removing this delay can offset the additional time needed to emit patch structure before completion text, compared with the standalone completion model’s suffix\-only output\. We test a zero\-delay configuration against the existing 200\-millisecond configuration \(Table[15](https://arxiv.org/html/2611.33314#S5.T15)\)\.

#### 5\.2\.1Ablations

We evaluate the client changes through three controlled online A/B experiments using the VS Code client\. The experiments follow the randomized assignment, metric aggregation, and significance criteria described in Section[3\.3](https://arxiv.org/html/2611.33314#S3.SS3), and report the same metrics as the Phase 1 online experiment in Table[8](https://arxiv.org/html/2611.33314#S4.T8)\. Within each client ablation, we hold the model checkpoint and other client settings fixed to isolate the change under evaluation\.

##### Rendering and Speculative Decoding\.

This experiment evaluates three features: the speculative decoding draft text designed for the 3\-in\-1 model, progressive ghost text reveal, and diff\-based view kind rendering\. It randomly assigns a fraction of VS Code stable users to each condition\. It compares a configuration with all three features enabled against three variants, each removing one feature\. The speculative decoding variant uses the earlier 2\-in\-1 draft text; the other variants disable progressive reveal or diff\-based rendering, respectively\. These comparisons measure each feature’s contribution when the other two remain enabled\. Table[13](https://arxiv.org/html/2611.33314#S5.T13)reports each variant relative to the full configuration\.

Table 13:Rendering and speculative decoding ablations relative to the full configuration\. The 3\-in\-1 draft and progressive reveal each increase accepted suggestions, while the draft also reduces latency\. Diff\-based rendering shows no statistically significant effect on measured outcomes\.Using the earlier 2\-in\-1 speculative decoding draft instead of the 3\-in\-1 draft increases mean time to display by 11\.44% and mean time to produce by 11\.19%\. It also reduces shown suggestions by 8\.40%, accepted suggestions by 7\.87%, ignored suggestions by 8\.80%, and recurring engagement by 3\.09%\. All of these changes are statistically significant\. The acceptance and engagement results support the use of the 3\-in\-1 draft\.

Disabling progressive ghost text reveal reduces accepted suggestions by 10\.22%, shown suggestions by 6\.51%, and ignored suggestions by 5\.57%, all statistically significant\. The acceptance result supports displaying the immediately relevant portion of a response as it arrives rather than waiting for the full response\. Neither latency metric changes significantly in this comparison\. Disabling diff\-based view kind rendering produces no statistically significant changes in the measured outcomes\.

##### Cross\-Mode Suppression of Ignored Suggestions\.

We evaluate cross\-mode suppression by comparing a suppression\-enabled treatment group with a suppression\-disabled control group\. Both groups use the same final 3\-in\-1 checkpoint and the other three client adaptations: the 3\-in\-1 speculative decoding draft, progressive ghost text reveal, and diff\-based view kind rendering\. Table[14](https://arxiv.org/html/2611.33314#S5.T14)reports the treatment relative to the control, isolating the effect of enabling suppression\.

Table 14:Cross\-mode suppression ablation with the final 3\-in\-1 checkpoint held fixed and the other three client adaptations enabled in both groups\. Relative changes compare the suppression\-enabled treatment with the suppression\-disabled control\. Suppression reduces dismissed and ignored suggestions but increases latency\.Enabling suppression reduces dismissed suggestions per user by 22\.40% and ignored suggestions by 5\.77%, both statistically significant\. Accepted suggestions, ARC at both retention windows, and recurring engagement do not change significantly\. Mean time to display increases by 4\.27% and mean time to produce by 4\.47%, both statistically significant, indicating a latency tradeoff\. The direct comparison isolates the contribution of the client change to reducing dismissals\.

##### Cache Delay\.

This experiment tests removing the existing 200\-millisecond cache delay using an earlier 3\-in\-1 checkpoint rather than the final model\. It randomly assigns a fraction of VS Code stable users to each condition\. The hypothesis is that removing this delay improves responsiveness and suggestion outcomes by offsetting the latency of generating patch structure before completion text\. Table[15](https://arxiv.org/html/2611.33314#S5.T15)reports the zero\-delay treatment relative to the existing 200\-millisecond control\.

Table 15:Cache delay ablation using an earlier 3\-in\-1 checkpoint\. Relative changes compare the zero\-delay treatment with the existing 200\-millisecond control\. Removing the delay reduces time to display and time to produce, without statistically significant differences in suggestion quality or recurring engagement\.Removing the existing 200\-millisecond cache delay configuration reduces mean time to display by 8\.90% and mean time to produce by 9\.85%\. Both reductions are statistically significant\. The reduction in time to display is consistent with removing the delay before presenting cached suggestions\. The relative change in dismissed suggestions is\+14\.41%±25\.86%\+14\.41\\%\\pm 25\.86\\%and is not statistically significant \(p=0\.2748p=0\.2748\)\. Removing the delay reduces latency but does not produce statistically significant improvements in suggestion quality or recurring engagement\. We retain the existing 200\-millisecond delay in the final configuration\.

### 5\.3Results

#### 5\.3\.1Training Dynamics

Figure[17](https://arxiv.org/html/2611.33314#S5.F17)separates gains in overall reward from changes in specific editing behaviors across all three training stages: Phase 1 stage 1, Phase 1 stage 2, and Phase 2, all measured during training\. Note that training experiences high variance from step to step and we take these measurements on training data rather than held\-out evaluation data\. We show these results to illustrate metric trends in training that corroborate evaluation results and the purpose of each training stage\. Each stage starts from the preceding stage’s selected checkpoint, giving boundaries at 2,000 and 2,690 and a final checkpoint at 3,280 combined steps\.

Phase 1 stage 1 accounts for the largest within\-stage reward increase, from 0\.642 to 0\.819\. Stage 2 adds a smaller overall reward gain, from 0\.803 to 0\.822, while the insertion placement pass rate \(Section[4\.3\.3](https://arxiv.org/html/2611.33314#S4.SS3.SSS3)\) improves from 73\.2% to 76\.9% and average patch validity remains near 99\.5%\.

Phase 2 changes both the training task mixture \(Section[5\.1\.1](https://arxiv.org/html/2611.33314#S5.SS1.SSS1)\) and the reward criterion \(Section[5\.1\.2](https://arxiv.org/html/2611.33314#S5.SS1.SSS2)\) by emphasizing ghost text and adding the ghost\-text completeness requirement\. The lower reward at the stage boundary therefore reflects these changes to the training setting, rather than a like\-for\-like comparison of model quality\. Within Phase 2, reward increases from 0\.602 to 0\.655 and patch validity recovers from 96\.4% to 98\.8%\. The ghost text fraction rises to 63\.1%, compared with 20\.4% at the end of Phase 1 stage 2, showing a shift toward ghost text suggestions\.

Figure 17:Learning curves of training\-time metrics on sampled training data across three successive training stages\. Phase 1 stage 2 improves insertion placement, while Phase 2 increases ghost text generation\. Phase 2 changes the task mixture and reward criterion, so its lower starting reward is not directly comparable with Phase 1\.
#### 5\.3\.2Offline Benchmarks

Table[16](https://arxiv.org/html/2611.33314#S5.T16)compares the 3\-in\-1 release candidate with the 2\-in\-1 RL stage 2 checkpoint using the same benchmark versions and the metrics in Table[7](https://arxiv.org/html/2611.33314#S4.T7)\. The comparison measures completion capability on the three Augmented HumanEval subsets, scenario coverage and avoidance of undesirable suggestions on Simulation Tests, mean patches per response on POE, recurring failure modes on QMH, and no\-edit and ghost text ratios on Output View Kind v1\. The baseline is the 2\-in\-1 model alone, not the 2\-in\-1 model paired with the completion model\. The online experiments below evaluate replacement of that paired configuration\.

Table 16:Phase 2 offline comparison against the standalone 2\-in\-1 RL stage 2 checkpoint\. The 3\-in\-1 model improves completion accuracy on all three Augmented HumanEval subsets and achieves the desired higher ghost text ratio, while matching or improving Simulation Tests scores\. QMH passes decrease from 19/19 to 18/19\.Relative to the 2\-in\-1 model alone, the release candidate achieves higher accuracy across all three Augmented HumanEval subsets\. Single\-Line accuracy increases from 92\.0% to 93\.7%, Multi\-Line accuracy from 75\.9% to 82\.3%, and Random Span accuracy from 84\.2% to 88\.0%\. The ghost text ratio also increases from 47\.47% to 72\.51%, while the no\-edit ratio decreases from 55\.46% to 47\.10%\. However, the 3\-in\-1 model passes 18/19 QMH cases compared with 19/19 for the 2\-in\-1 model due to a code duplication failure case that persists across all evaluated 3\-in\-1 checkpoints\. We use QMH to screen and select checkpoints, so its scores are not independent evidence of overall quality\. We nevertheless review this failure case and judge its impact limited based on subsequent qualitative evaluations and internal testing, accepting this tradeoff for improved completion accuracy\. These results show improved completion accuracy on this benchmark and a shift toward completion\-shaped suggestions, not a quality improvement over the paired completion\-and\-2\-in\-1 system\.

#### 5\.3\.3Online Evaluation

We evaluate the final 3\-in\-1 checkpoint in two online A/B experiments: a model\-only comparison and a model\-plus\-client comparison with all four client adaptations applied\. The final 3\-in\-1 model with all four client adaptations is the deployed system\. Both experiments use the 2\-in\-1 model paired with the completion model as the control and follow the randomized user assignment and analysis procedure described in Section[3\.3](https://arxiv.org/html/2611.33314#S3.SS3)\. Neither experiment compares the deployed system with the original three\-model baseline, so these results do not measure the cumulative effect of both phases\. The model\-plus\-client comparison uses the same suppression\-enabled treatment group and exposure period as the cross\-mode suppression ablation \(Table[14](https://arxiv.org/html/2611.33314#S5.T14)\), but compares that group with the paired\-model control rather than the suppression\-disabled configuration\. Table[17](https://arxiv.org/html/2611.33314#S5.T17)reports each experiment’s relative changes with 95% confidence intervals andpp\-values against its control\. As in Phase 1, we assess suggestion quality through shown, accepted, and dismissed suggestions, recurring engagement, and ARC\.

Table 17:Phase 2 online results from two experiments, each relative to the 2\-in\-1 model paired with the completion model\. The model\-plus\-client experiment applies all four client adaptations\.The model\-only experiment improves latency: mean time to display and mean time to produce decrease by 10\.82% and 5\.63%, respectively, relative to the paired control\. However, dismissed suggestions increase by 12\.24%, and ARC decreases by 13\.27% at 30 seconds and 11\.56% at 5 minutes\. All of these changes are statistically significant\. With all four client adaptations also applied, dismissed suggestions decrease by 10\.06% \(unadjustedp=0\.0453p=0\.0453\), while mean time to display and mean time to produce decrease by 11\.00% and 5\.18%, respectively\. The latency reductions remain statistically significant after Bonferroni correction across the 12 reported metrics, but the dismissal reduction does not \(see Section[7\.1](https://arxiv.org/html/2611.33314#S7.SS1)\)\.

In the model\-plus\-client experiment, ARC changes by−3\.25%\-3\.25\\%at 30 seconds and−2\.42%\-2\.42\\%at 5 minutes; neither change is statistically significant \(Table[17](https://arxiv.org/html/2611.33314#S5.T17)\)\. ARC is a character count, so longer suggestions can increase ARC even if the fraction of accepted characters retained stays the same\. The number of accepted suggestions also does not differ significantly between the treatment and control; these results therefore do not establish an overall improvement in response quality\.

Output tokens per response increase by 19\.62% in the model\-only experiment and 20\.98% in the model\-plus\-client experiment relative to the 2\-in\-1 model alone; both increases are statistically significant\. As discussed in Section[3\.2](https://arxiv.org/html/2611.33314#S3.SS2), this metric averages tokens per response within each user, then across users, so the treatment model handling more requests does not by itself increase it\. This increase is consistent with our training emphasis on longer, more complete ghost text suggestions \(Section[5\.1\.1](https://arxiv.org/html/2611.33314#S5.SS1.SSS1.Px3)\), but increases decoding work per model call\.

As noted in Section[3\.3](https://arxiv.org/html/2611.33314#S3.SS3), we do not directly multiply relative changes across the two phases to estimate a cumulative effect, since the experiments are not directly comparable\. Together with the 58\.93% output\-token reduction in Phase 1, these results suggest that the 3\-in\-1 model emits fewer tokens per response than the original NES model, though we do not directly measure this comparison\.

Cached suggestion share increases by 13\.60% in the model\-only experiment and 9\.38% in the model\-plus\-client experiment\. Displaying cached suggestions requires no additional model call, but a higher cache share does not necessarily indicate better suggestion quality\. For example, cross\-mode suppression of ignored suggestions reduces both cached suggestion share and dismissals \(Table[14](https://arxiv.org/html/2611.33314#S5.T14)\)\.

Figure[18](https://arxiv.org/html/2611.33314#S5.F18)shows suggestion counts per user and dismissal rates grouped by view kind for the model\-plus\-client experiment\. Dismissal rate is the fraction of shown suggestions that developers dismiss\. Ghost text includes suggestions at and away from the cursor, while other view kinds are non\-ghost\-text NES suggestions\. These UI\-specific metrics count events rather than the unique opportunities counted in Table[17](https://arxiv.org/html/2611.33314#S5.T17)\. Ghost text has a lower dismissal rate than other view kinds in both the control \(2\.41% versus 6\.89%\) and the release candidate \(1\.74% versus 5\.29%\)\. This pattern is consistent with the less intrusive ghost text UI, although suggestion content also differs\.

The 3\-in\-1 model replaces both models in the control and must therefore provide the ghost text suggestions that the separate completion model supplies in the control\. Compared with the control, the release candidate shows 12\.16% fewer ghost text suggestions per user and reduces overall dismissals per user by 10\.06% \(Table[17](https://arxiv.org/html/2611.33314#S5.T17)\)\. Although ghost text has a lower dismissal rate than other view kinds in the UI event counts \(Figure[18](https://arxiv.org/html/2611.33314#S5.F18)\), the reduction in dismissal events comes from fewer ghost text dismissals, not from showing more ghost text\. The decrease in ghost text dismissals more than offsets the increase in dismissals of other suggestions\. For other view kinds, the release candidate shows more suggestions, so dismissals per user rise even though their dismissal rate falls\. These measurements describe dismissal behavior for the combined model\-and\-client configuration; they do not isolate an improvement in the predicted edits themselves\.

Note that the offline evaluation compares the 3\-in\-1 model with the 2\-in\-1 model alone \(Table[16](https://arxiv.org/html/2611.33314#S5.T16)\)\. The online experiment instead compares it with the 2\-in\-1 model paired with the completion model; the latter produces only ghost text suggestions\. The offline increase in ghost text ratio and online decrease in ghost text suggestions per user are therefore measured against different baselines\.

Mean shown / user010203019\.0319\.037\.097\.0926\.1226\.12Control16\.7216\.7210\.6010\.6027\.3227\.32Release candidateMean dismissed / user00\.51\.00\.4590\.4590\.4890\.4890\.9480\.948Control0\.2910\.2910\.5610\.5610\.8520\.852Release candidateDismissed / shown \(%\)024682\.412\.416\.896\.89Control1\.741\.745\.295\.29Release candidateGhost textOther view kinds

Figure 18:Suggestions by view kind for the 2\-in\-1\-plus\-completion control and the 3\-in\-1 release candidate with all four client adaptations applied, with counts reported as per\-user means\. The release candidate and client configuration together show fewer ghost text suggestions per user and lower dismissal rates in both view kind groups\.
#### 5\.3\.4Qualitative Perception Survey Results

We also conduct a retrospective perception survey during the internal A/B experiment of the 3\-in\-1 model candidate\. We send the survey only to users assigned to the treatment configuration\. The survey targets approximately 200 of the most active users of GitHub Copilot Inline Suggestions over one week, from July 29, 2026, through August 4, 2026\. We ask respondents how the quality of inline suggestions during that week compares with the weeks before July 29, 2026\. The questionnaire also asks about satisfaction, desired improvements and problematic suggestions, typical days of use, and active hours of use\. Table[18](https://arxiv.org/html/2611.33314#S5.T18)lists the five questions in more detail\. Figure[19](https://arxiv.org/html/2611.33314#S5.F19)shows the perceived quality responses and days of use per week that respondents report \(n=25n=25in total andn=19n=19for the usage question\)\.

Table 18:Perception survey questionnaire for the 3\-in\-1 treatment group\.The comparison item asks respondents to compare the A/B experiment week with their recollection of previous weeks, not with a blind side\-by\-side alternative or a task\-based evaluation\. Respondents know they are participating in an internal online A/B experiment\. The 25 responses represent approximately 12\.5% of the targeted users, and respondents self\-select; thus, recall, awareness of participation in the experiment, and nonresponse may affect the results\.

88%Much better1 \(4%\)Slightly better2 \(8%\)Same, or did not notice adifference22 \(88%\)Slightly worse0 \(0%\)Much worse0 \(0%\)

\(a\)Perceived quality \(25 responses\)\.
05103\(15\.8%\)4\(21\.1%\)10\(52\.6%\)2\(10\.5%\)Less than1 day1 or 2days3 or 4days5 daysor more

\(b\)Days of use per week \(19 responses\)\.

Figure 19:Perceived quality and days of use among survey respondents in the 3\-in\-1 treatment group\. Respondents report either no change or an improvement relative to their recollection of the previous 2\-in\-1\-plus\-completion setup\.Among the 25 responses, 12% \(3 respondents\) report a perceived improvement in quality, and the remaining 88% \(22 respondents\) report no perceived difference in quality\. No respondents report a perceived decline in quality\. Under an independent, common\-probability binomial model, the two\-sided exact Clopper\-Pearson 95% confidence interval for the improvement share is 2\.5% to 31\.2%\. With zero reports of decline, the one\-sided exact 95% upper confidence bound on the decline share is 11\.3%\. Among the 19 respondents who report their days of use per week, 63\.2% \(12 respondents\) indicate using inline suggestions at least 3 days per week, while the remaining 36\.8% \(7 respondents\) report using it fewer than 3 days per week\. Most respondents perceive no quality difference\. These self\-selected responses do not establish population\-level equivalence or improvement in response quality\.

Sixteen of the twenty\-five respondents answer the free\-text question about desired improvements and problematic suggestions\. Because the question solicits problems, the comments may overrepresent negative experiences\. In the following analysis, one author assigns one or more themes to each response without a second rater, so theme counts are indicative\. Six respondents describe interaction friction, including suggestions intercepting Tab or Enter, appearing during typing, or resisting dismissal; these comments concern editor integration\. Three describe Markdown or prose suggestions, and three request editor features such as per\-language controls and MCP support\. Both groups of comments concern areas outside the model behavior evaluated here\.

Two respondents report inconsistent coverage, including missing suggestions for apparent edits or when repeating an edit while moving upward through a file\. Two describe repetitive suggestions, and one describes suggestions that restore text after they delete it\. These comments point to opportunities for further study, but the questionnaire does not measure quality, latency, and rendering separately, so we cannot attribute perceived changes to a single intervention\.

Three respondents praise suggestion quality\. The respondent who selects “Much better” describes improved SQL dialect correction during the A/B experiment week and says the behavior later reverts\.

## 6Iteration Flywheel

### 6\.1Iteration Velocity

One critical result of the experimentation we conduct in developing the unified inline suggestions model is the compounding benefit of learnings that decrease iteration time in each phase\. The 2\-in\-1 model requires 15 SFT training runs, 173 RL training runs, and several times as many checkpoint\-selection evaluation runs\. We evaluate 14 candidates in A/B experiments before selecting the final shipping candidate\. In contrast, the 3\-in\-1 model requires only RL on top of the 2\-in\-1 model, with 35 RL training runs and 10 A/B experiment candidates\. Over the same period, we also merge 113 PRs to the VS Code client to improve and support the inline suggestions experience\. Each modeling phase benefits from and builds on our earlier learnings, which accelerates the iteration process\. Table[19](https://arxiv.org/html/2611.33314#S6.T19)summarizes the training runs, A/B experiment candidates, and client\-side PRs by phase\.

Table 19:Development iterations by phase\. Building on the 2\-in\-1 model, Phase 2 requires no SFT runs, about one\-fifth as many RL runs, and fewer A/B experiment candidates and client\-side PRs\.Here, we share additional analyses of tools that we introduce in this work to illustrate the importance of building strong evaluation components that accelerate this iteration flywheel\.

### 6\.2A/B Experiment Metrics over Model Iterations

Figure[20](https://arxiv.org/html/2611.33314#S6.F20)shows four online metrics and qualitative regression assessments for candidates whose A/B experiments run to completion, ordered chronologically within each phase\. Phase 1 uses the three\-model baseline as its control, while Phase 2 uses the 2\-in\-1 model \(candidate 14 in Phase 1 of Figure[20](https://arxiv.org/html/2611.33314#S6.F20)\) paired with completion as its control\. We omit candidates 1, 7, 8, and 10 because we stop their experiments early, in most cases after interim results show clear regressions\. Section[7\.1](https://arxiv.org/html/2611.33314#S7.SS1)discusses how selecting candidates by their A/B results affects the reported estimates\. For the purpose of this analysis, we consider changes to be statistically significant ifp<0\.05p<0\.05\. We share this visual of our model development process to transparently communicate the learning process and dynamic nature of scientific inquiry alongside the end results and successful recipes\.

Phase 1: 2\-in\-1Phase 2: 3\-in\-1ShippedShippedAcceptedsuggestions↑\\uparrow\-40%0%20%DismissedSuggestions↓\\downarrow\-40%0%80%ARC at5 minutes↑\\uparrow\-40%0%20%Time todisplay↓\\downarrow\-30%0%10%Qualitativetesting0203040506091112131415161718192021222324Candidate IDFavorableAdverseNot significantPassFail↑\\uparrowhigher preferred↓\\downarrowlower preferred

Figure 20:Key online metric relative changes compared to the control \(expressed in % with 95% confidence intervals\) and qualitative assessments across model candidates\. ARC uses the 5\-minute retention window\. Controls are the three standalone models in Phase 1 and the 2\-in\-1\-plus\-completion model in Phase 2\. Multiple rounds of iteration on data, model training, offline and online evaluation methods, client implementation, and other factors in each phase produce the final shipped configurations that meet both quantitative and qualitative quality standards\.For model unification, our primary goal is to maintain performance relative to the control rather than to outperform it\. As described in Section[3\.2](https://arxiv.org/html/2611.33314#S3.SS2), a non\-significant result alone does not establish that a candidate is acceptable\. We also defer deployment when confidence intervals or qualitative testing suggest potential regressions\. Most Phase 1 candidates that do not meet the shipping bar exhibit qualitative regressions, including malformed patches, over\-eager edits, code duplication, or misplaced insertions\. Most Phase 2 candidates that do not meet the shipping bar exhibit statistically significant decreases in accepted suggestions or accepted and retained characters \(ARC\)\. These complementary signals guide five iterations of model development across the two unification phases\[[Gong et al\., 2026a](https://arxiv.org/html/2611.33314#bib.bib3);[Gong et al\., 2026b](https://arxiv.org/html/2611.33314#bib.bib4)\]\. While we do not elaborate on many of the 113 client\-side PRs that complement the model improvements in this work to improve the user experience, it is important to recognize that these changes are foundational to the improvements we make during the model iterations\.

We note that successive candidates test different, sometimes independent, changes rather than a single cumulative sequence\. Each selected configuration combines changes we retain from earlier experiments, so the figure does not isolate the effect of any individual training change\. Comparisons across experiments are descriptive because their exposure periods and audiences differ\.

##### Phase 1 Iteration\.

The first model iteration \(candidates 02 to 03 in Figure[20](https://arxiv.org/html/2611.33314#S6.F20)\) establishes the baseline performance of using only single\-edit data from the NES recipe, as we discuss in Section[4\.3\.1](https://arxiv.org/html/2611.33314#S4.SS3.SSS1), and identifies initial failure modes such as the code duplication we describe in Section[4\.2\.3](https://arxiv.org/html/2611.33314#S4.SS2.SSS3)\. A subsequent iteration \(candidates 04 to 06\) introduces multi\-edit supervision through the pseudolabeling and edit history playback pipelines in Section[4\.2\.2](https://arxiv.org/html/2611.33314#S4.SS2.SSS2), along with the rules\-based multi\-edit RL grader bonus we discuss in Section[4\.3\.4](https://arxiv.org/html/2611.33314#S4.SS3.SSS4.Px1)\. Online results improve, but elevated dismissals and qualitative failures motivate the POE offline benchmark we introduce in Section[3\.1](https://arxiv.org/html/2611.33314#S3.SS1), grader calibration as we describe in Section[4\.3\.3](https://arxiv.org/html/2611.33314#S4.SS3.SSS3.Px2), and targeted patch\-validity repairs using the filtering and repair process in Section[4\.2\.3](https://arxiv.org/html/2611.33314#S4.SS2.SSS3)\. The next iteration of model refinement \(candidates 09 to 14\), which produces the final Phase 1 candidate, addresses the remaining insertion placement failures through the targeted\-example pipeline in Section[4\.2\.3](https://arxiv.org/html/2611.33314#S4.SS2.SSS3.Px3), hard\-example upweighting in Section[4\.3\.1](https://arxiv.org/html/2611.33314#S4.SS3.SSS1), and RL grader boosting in Section[4\.3\.3](https://arxiv.org/html/2611.33314#S4.SS3.SSS3)\. These failures also motivate the QMH canary benchmark we introduce in Section[3\.1](https://arxiv.org/html/2611.33314#S3.SS1), which supports the checkpoint selection process in Section[3\.4](https://arxiv.org/html/2611.33314#S3.SS4)by screening for behaviors that aggregate online A/B experiment metrics miss\.

##### Phase 2 Iteration\.

In Phase 2, where the focus shifts to integrating completion data and refining client\-side behavior, candidates 15 to 24 use the completion data we describe in Section[5\.1\.1](https://arxiv.org/html/2611.33314#S5.SS1.SSS1)\. All of these candidates also use the upweighted longer\-output examples in Section[5\.1\.1](https://arxiv.org/html/2611.33314#S5.SS1.SSS1.Px3)and the ghost text completeness auxiliary grader in Section[5\.1\.2](https://arxiv.org/html/2611.33314#S5.SS1.SSS2)to target incomplete ghost text\. After we add the completion length examples and the completeness grader, the mean number of inserted characters per patch increases from 38\.04 to 58\.56 on Output View Kind v2 \(Section[3\.1](https://arxiv.org/html/2611.33314#S3.SS1.SSS0.Px3)\)\. An online experiment with candidate 15 against the 2\-in\-1 model paired with the completion model reports a non\-significant relative change in 30\-second ARC of−7\.94%\-7\.94\\%\. Figure[20](https://arxiv.org/html/2611.33314#S6.F20)shows the same candidate’s 5\-minute ARC result\. From candidate 16 onward, we also increase upsampling of the patch validity and insertion pattern propagation repair examples to maintain coverage of these failure modes as the mixture expands \(Table[11](https://arxiv.org/html/2611.33314#S5.T11)\)\. Candidates 17, 19, and 21 to 23 still show statistically significant regressions in 5\-minute ARC \(Figure[20](https://arxiv.org/html/2611.33314#S6.F20)\) despite the data and grader interventions, suggesting that these interventions do not consistently eliminate ARC regressions\. Candidate 24 also adds the cursor\-first multi\-edit examples we describe in Section[5\.1\.1](https://arxiv.org/html/2611.33314#S5.SS1.SSS1)to encourage completion at the cursor before related follow\-up edits\. In the model\-only experiment, candidate 24 increases dismissed suggestions per user by 12\.24% and reduces ARC relative to control\. With all four client adaptations, candidate 24 instead reduces dismissed suggestions per user by 10\.06%\. Though these candidate comparisons do not isolate the contributions of individual training changes to ARC, the final configuration combines these data, grader, and client changes and shows no statistically significant ARC regression relative to the paired control \(Table[17](https://arxiv.org/html/2611.33314#S5.T17)\)\.

### 6\.3RL Checkpoint Stability

Figure[21](https://arxiv.org/html/2611.33314#S6.F21)shows QMH pass counts across checkpoints for the two RL runs that produce the shipped 2\-in\-1 and 3\-in\-1 models\. Scores in these runs remain relatively stable compared with other experimental runs, which show greater variability and lower averages\. Although all scores are at least14/1914/19, they still span a wide range\. Each run contains a contiguous sequence of checkpoints with scores of at least18/1918/19\. Both shipped models attain the maximum score in their respective runs\. Our checkpoint expansion technique evaluates these models at a higher granularity in order to capture the best checkpoints in each run, as described in Section[3\.4](https://arxiv.org/html/2611.33314#S3.SS4)\. This checkpoint\-level variation underscores the need for a lightweight canary benchmark that efficiently identifies local performance optima during checkpoint expansion\.

14151617181910030050070090011001300Training stepQMH passes \(out of 19\)2\-in\-1 model3\-in\-1 modelShipped

Figure 21:QMH pass counts across training checkpoints for the 2\-in\-1 and 3\-in\-1 models\. Stars mark the shipped checkpoints at steps 690 and 590, respectively\. Scores fluctuate between nearby checkpoints, motivating the use of a lightweight canary benchmark \(QMH\) for fast, finer\-grained checkpoint evaluation\.

### 6\.4Offline\-Online Evaluation Metric Correlation

Figure[22](https://arxiv.org/html/2611.33314#S6.F22)compares representative metrics from each of the five offline benchmarks with online metrics \(quantified as relative changes from each A/B experiment’s control\), using all 20 candidates across Phase 1 and Phase 2 for which we perform a full A/B experiment\. Each scatterplot reports Pearson’s linear correlationrrand Spearman’s rank correlationρ\\rho\. We compute both separately for the 2\-in\-1 and 3\-in\-1 candidates and plot a phase\-specific least\-squares line\. Figure[22](https://arxiv.org/html/2611.33314#S6.F22)shows one representative pairing per benchmark\. Appendix[E](https://arxiv.org/html/2611.33314#A5)contains 18 selected offline\-online metric pairings, shown separately by phase\. Note that these are descriptive associations among selected A/B experiments, not estimates of the effect of changing an offline score or evidence of prospective predictiveness\.

Figure 22:Representative offline\-online associations for Simulation Tests, Augmented HumanEval, and Output View Kind, separated by phase\. Online changes are relative to each experiment’s control\. Associations vary by benchmark and phase; none meets the adjusted significance threshold\. Appendix[E](https://arxiv.org/html/2611.33314#A5)shows all pairings\.Figure 23:Representative offline\-online associations for POE and QMH \(continued\), with online changes relative to each experiment’s control\. Higher POE acceptance\-to\-rejection ratios accompany fewer dismissals in both phases, while QMH has little association with ARC in Phase 2\. The single Phase 1 QMH observation does not support a correlation estimate; none of the displayed associations meets the adjusted significance threshold\.##### Note on Scope of Inference\.

Each observation is an A/B experiment where the treatment is the candidate model setup and the control is the corresponding baseline model \(the then\-production setup\)\. We use pairwise complete cases: the displayed correlations use 8 to 10 experiments per phase, apart from the 2\-in\-1 QMH cases with only one observation\. We retain all reported treatment\-control changes regardless of their statistical significance since filtering would select observations using the outcomes being correlated\. Separating phases avoids conflating between\-phase shifts with within\-phase associations, but does not control for differences in client settings, controls, or checkpoint ancestry within a phase\. We adjust two\-sided Spearman permutation\-testpp\-values jointly across all tested offline\-online metric pairs in both phases using the Benjamini\-Hochberg procedure\. None of the displayed phase\-level associations passes the adjusted 0\.05 threshold; agreement in direction is descriptive rather than evidence of a statistically established or causal effect\. Paired percentile bootstrap intervals from 5,000 resamples also show substantial uncertainty: for instance, the association between POE A/R and dismissed suggestions has a 95% rank\-correlation interval of approximately\[−0\.95,−0\.09\]\[\-0\.95,\-0\.09\]for 2\-in\-1 and\[−0\.92,\+0\.34\]\[\-0\.92,\+0\.34\]for 3\-in\-1\. We report pointwise intervals without selection or multiplicity adjustment, and permutation and bootstrap inference assume exchangeable, independent A/B experiments\. The fitted lines do not represent a held\-out candidate test, and we do not formally test whether the phase\-specific coefficients differ\. The results support outcome\-specific hypotheses rather than a validated offline ranking of online performance\.

##### Simulation Tests\.

The Total score correlates positively with shown and accepted suggestions in the 2\-in\-1 group \(ρ=0\.52\\rho=0\.52and0\.250\.25\) and the 3\-in\-1 group \(ρ=0\.65\\rho=0\.65and0\.050\.05\), but also with dismissed and ignored suggestions \(2\-in\-1:ρ=0\.84\\rho=0\.84and0\.450\.45; 3\-in\-1:ρ=0\.60\\rho=0\.60and0\.600\.60\)\. The positive shown and dismissed suggestion associations also occur within each model phase\. This pattern is consistent with the benchmark capturing variation in suggestion frequency, but does not establish how well the benchmark distinguishes wanted from unwanted suggestions\.

##### Augmented HumanEval\.

Multi\-Line accuracy has weak positive correlations with accepted and retained characters \(ARC\) at 30 seconds and 5 minutes in the 2\-in\-1 group \(ρ=0\.07\\rho=0\.07and0\.220\.22\) and the 3\-in\-1 group \(ρ=0\.30\\rho=0\.30and0\.360\.36\)\. These weak associations do not establish a predictive relationship\.

##### Output View Kind\.

The number of no\-edit responses has weak positive correlations with both ARC outcomes in the 2\-in\-1 group \(ρ=0\.24\\rho=0\.24and0\.280\.28\), but negative correlations in the 3\-in\-1 group \(ρ=−0\.31\\rho=\-0\.31and−0\.19\-0\.19\)\. The association changes sign between phases, providing no consistent within\-phase relationship between no\-edit counts and ARC\. ARC measures retained\-character volume rather than a conditional persistence rate\.

##### Pseudo\-Online Evaluation\.

POE rejection correlates positively with online A/B experiment dismissals in the 2\-in\-1 and 3\-in\-1 groups \(ρ=0\.38\\rho=0\.38and0\.620\.62\), and its acceptance\-to\-rejection rate ratio correlates negatively with online A/B experiment dismissals \(ρ=−0\.71\\rho=\-0\.71and−0\.45\-0\.45\)\. These associations suggest POE’s assessment of undesirable suggestions corresponds to the changes in dismissed suggestions in online A/B experiments\.

The acceptance\-to\-rejection rate ratio has little rank association with the two ARC outcomes in the 2\-in\-1 group \(ρ=0\.06\\rho=0\.06and0\.100\.10\), and negative associations in the 3\-in\-1 group \(ρ=−0\.55\\rho=\-0\.55and−0\.24\-0\.24\)\. The counts of previously accepted suggestions converted to no edit correlate positively with ARC in the 2\-in\-1 group \(ρ=0\.35\\rho=0\.35and0\.410\.41\), but negatively in the 3\-in\-1 group \(ρ=−0\.26\\rho=\-0\.26and−0\.10\-0\.10\)\. Together with the Output View Kind analysis, these results support examining restraint alongside suggestion quality, but do not establish a consistent restraint\-to\-ARC relationship across phases\.

##### Qualitative Must\-Haves\.

Only ten of the twenty A/B experiments have QMH scores available for this analysis, and only one comes from a Phase 1 model\. We introduce the 19\-case QMH set late in Phase 1 RL stage 1 \(Section[3\.4](https://arxiv.org/html/2611.33314#S3.SS4)\)\. The single Phase 1 observation does not support a correlation estimate, so we omit it from the analysis but show the data point for reference\. Within the 3\-in\-1 group, QMH scores have weak associations with ARC \(r=0\.11r=0\.11and0\.120\.12, withρ=0\.13\\rho=0\.13and0\.060\.06\), and with shown and accepted suggestions \(ρ=0\.11\\rho=0\.11and0\.070\.07\)\. These correlations do not establish QMH as a strong predictor of aggregate online outcomes; we find it useful for screening candidates for known failure modes\.

##### Discussion\.

We observe exploratory offline\-online associations in this analysis, but do not establish prospective predictive validity\. POE associations have consistent directions across phases: higher rejection rates and lower acceptance\-to\-rejection ratios accompany more dismissed suggestions\. These patterns suggest that POE captures aspects of suggestion undesirability, although we need further validation to establish its predictive value\.

These results also motivate further refining offline evaluation around the online outcome each benchmark is intended to anticipate\. For instance, we may want to improve Simulation Tests to better capture the decision boundary between desirable and undesirable edits, and investigate whether POE’s assessment of desirable edits can better anticipate acceptance and retained character outcomes\. We aim to continuously refine benchmarks and evaluation metrics to lessen the gap between offline assessment and the online developer experience\.

## 7Conclusion, Limitations, and Future Directions

In this work, we introduce the techniques and approaches we use to train the unified inline suggestions model for GitHub Copilot, including data pipelines, model training, offline evaluation, and online A/B experimentation\. We share lessons from creating the model development flywheel and plan to apply them to future extensions of our models\. The final Phase 1 model\-client configuration reduces time to display by 6\.77% and output tokens by 58\.93%, with no statistically significant changes in quality and engagement metrics relative to the three\-model control\. The Phase 2 configuration with all four client adaptations also reduces dismissals by 10\.06% relative to the 2\-in\-1 model paired with the completion model, although this result is not statistically significant under a Bonferroni correction\. These results show that the model\-client configuration in each phase of unification achieves its intended effect on online metrics relative to its corresponding control\.

### 7\.1Limitations

##### Online Effect Estimates\.

Each A/B experiment directly compares one candidate with the then\-production configuration over the same period\. Because experiments for different candidates run at different times, their results do not directly compare candidates with each other\. The results we report for the shipped models \(Tables[8](https://arxiv.org/html/2611.33314#S4.T8)and[17](https://arxiv.org/html/2611.33314#S5.T17)\) come from the same experiments we use to select them, and we do not adjustpp\-values for the 12 metrics reported per experiment or the 24 candidates across both phases \(Table[19](https://arxiv.org/html/2611.33314#S6.T19)\)\. This candidate selection process can inflate reported effect sizes, and unadjusted testing increases the risk of false positives across comparisons\. Under Bonferroni correction across the 12 reported metrics \(p<0\.05/12p<0\.05/12\), the decreases in time to display and time to produce remain statistically significant, but the Phase 2 decrease in dismissed suggestions \(p=0\.045p=0\.045\) and increase in recurring engagement \(p=0\.022p=0\.022\) do not\. In addition, this correction does not account for the comparisons across different candidates and phases\.

##### Sources of Supervision\.

We use a general\-purpose frontier reasoning model as the LLM judge\. The judge contributes to binary rewards in RL \(Section[4\.3\.3](https://arxiv.org/html/2611.33314#S4.SS3.SSS3)\) and provides pass or fail decisions in both data filtering \(Section[4\.2\.3](https://arxiv.org/html/2611.33314#S4.SS2.SSS3)\) and edit history playback \(Section[4\.2\.2](https://arxiv.org/html/2611.33314#S4.SS2.SSS2)\)\. Because we use this frontier reasoning model as the LLM judge, part of the improvement could reflect the judge model’s capabilities rather than the training recipe\. In addition, we use the same POE samples for grader calibration and the reported offline evaluations, so POE evaluation results may not be independent of LLM judge development\.

Training labels come from existing NES and completion training data that we convert to the patch format, recorded edit histories, and our own models, including pseudolabels from our strongest model checkpoint \(Section[4\.2\.2](https://arxiv.org/html/2611.33314#S4.SS2.SSS2)\)\. A general\-purpose frontier reasoning model writes ground truth labels only in three targeted behavior curation datasets: rewritten invalid patches, rewritten insertion pattern propagation examples, and completion length examples\. Rewritten invalid patches make up about 3% of the SFT data, and together with rewritten insertion pattern propagation examples, they make up about 4% of the Phase 1 RL mixture after upsampling\. Completion length examples make up about 5% of the Phase 2 RL mixture after upsampling\. We do not ablate judge strength, so these results do not separate the judge’s contribution from that of the training recipe\. Several evaluation measures also do not use the judge to score predictions: for instance, Augmented HumanEval is used for evaluation, not SFT or RL training, and scores predictions using unit tests rather than the LLM judge\. Its scores improve from SFT to RL \(Table[7](https://arxiv.org/html/2611.33314#S4.T7)\)\. Likewise, the online metrics measure developer behavior directly without relying on an LLM judge\. When we hold the checkpoint fixed, a client change alone shifts dismissed suggestions \(Section[5\.3\.3](https://arxiv.org/html/2611.33314#S5.SS3.SSS3)\)\.

### 7\.2Future Directions

One direction for future work is personalized eagerness\. Our Phase 1 and Phase 2 ablations and qualitative testing, in addition to developer feedback, identify tradeoffs between follow\-up edit frequency, suggestion quality, and developer preferences, motivating the ability to personalize and adapt model behavior \(Section[4](https://arxiv.org/html/2611.33314#S4)\)\. As a starting point, we are adding the capability to condition the unified model on developer preferences for factors such as suggestion frequency and edit size\.

Looking forward, this work establishes a foundation for a unified model flywheel that we plan to continue to improve\. We will make continual updates to use developer feedback and build on components we introduce in this work, from the evaluation methods and checkpoint selection process \(Sections[3](https://arxiv.org/html/2611.33314#S3)and[3\.4](https://arxiv.org/html/2611.33314#S3.SS4)\) to targeted data curation and RL grader boosting \(Sections[4\.2\.3](https://arxiv.org/html/2611.33314#S4.SS2.SSS3.Px3)and[4\.3\.3](https://arxiv.org/html/2611.33314#S4.SS3.SSS3)\)\. Our current prompt’s recent edit history can be viewed as a short editing trajectory; we plan to extend training to longer trajectories to improve how the inline suggestions model works together with developers across successive interactions\. We plan to evaluate these advances against the existing quality guardrails, retaining useful suggestions while reducing unwanted interruptions\.

We see this model unification as just one step in our continued journey toward more intelligent and context\-aware AI\-assisted coding, and we look forward to sharing our learnings as we make further progress toward our vision of meeting every builder in their workflow with the right assistance at the right time\.

## Contributors and Acknowledgments

The unified inline suggestions model for GitHub Copilot is the result of a collaboration among many people at Microsoft\. Below, we list core contributors and contributors, followed by acknowledgments\.

### Core Contributors

#### Model Training, Data Curation, and Evaluation

Julia Gong,Benjamin Liggett,Shengjie Ma,Yu Hu,Elsie Nallipogu

#### Client Engineering

Ulugbek Abdullaev,Alexandru Dima

#### Science Product Management

Zhehui Liao,Luciana Abud,Nathan Halstead

### Contributors

Benjamin Steenhoek,Gaurav Mittal,Fuhui Fang,Satarupa Guha,Hang Zhao,Anand Mooga,Cheng Long,Benjamin Simmonds,Soojin Choi

### Acknowledgments

We thank the following collaborators whose insights and support made this work possible\.

#### Science Tooling and Data Pipelines

Kevin Merchant,Sarah Widder,Abhijith Chatra,Suman Bhagavathula,Maoliang Huang,KwangJe Cho,Carl Brochu,Baoping Zhang,Shubhangi Thakur,Martin Valle,Farzad Eskafi

#### Experimentation, Product, and Review

Cindy Chiu,Amy Hartwig,Nick Trogh,Brigit Murtaugh,John Mogensen,Rahul Pandita,Mario Rodriguez,Kai Maetzel

#### Platform and Infrastructure

Jesten Herrild,Joel Dunham,Joseph Leinsdorf,Alejandro Oviedo Cruz,Boshi Lian,Shuhan Yan,Shiven Raina,Vidur Vatsalya,Vijetha Vijayendran,Meng Lan,Eddie Ailijiang,Ming Liu,Dharmesh Guna,Mostafa Elzoghbi

We thank the VS Code and GitHub Copilot developer community for the ongoing feedback that informs and improves our work\.

## References

- Aggarwalet al\.\(2025\)T\. Aggarwal, S\. Singh, A\. Awasthi, A\. Kanade, and N\. NatarajanNextCoder: robust adaptation of code LMs to diverse code edits\.InProceedings of the 42nd International Conference on Machine Learning,Proceedings of Machine Learning Research, Vol\.267,pp\. 616–638\.External Links:[Link](https://proceedings.mlr.press/v267/aggarwal25b.html)Cited by:[§1](https://arxiv.org/html/2611.33314#S1.p1.1)\.
- Ahmadianet al\.\(2024\)A\. Ahmadian, C\. Cremer, M\. Gallé, M\. Fadaee, J\. Kreutzer, O\. Pietquin, A\. Üstün, and S\. HookerBack to basics: revisiting REINFORCE style optimization for learning from human feedback in LLMs\.arXiv preprint arXiv:2402\.14740\.External Links:[Link](https://arxiv.org/abs/2402.14740)Cited by:[§4\.3\.2](https://arxiv.org/html/2611.33314#S4.SS3.SSS2.p3.2)\.
- Amershiet al\.\(2019\)S\. Amershi, D\. Weld, M\. Vorvoreanu, A\. Fourney, B\. Nushi, P\. Collisson, J\. Suh, S\. Iqbal, P\. Bennett, K\. Inkpen, J\. Teevan, R\. Kikin\-Gil, and E\. HorvitzGuidelines for human\-AI interaction\.InProceedings of the 2019 CHI Conference on Human Factors in Computing Systems,External Links:[Document](https://dx.doi.org/10.1145/3290605.3300233),[Link](https://www.microsoft.com/en-us/research/publication/guidelines-for-human-ai-interaction/)Cited by:[§1](https://arxiv.org/html/2611.33314#S1.p4.1)\.
- Amodeiet al\.\(2016\)D\. Amodei, C\. Olah, J\. Steinhardt, P\. Christiano, J\. Schulman, and D\. ManéConcrete problems in AI safety\.arXiv preprint arXiv:1606\.06565\.External Links:[Link](https://arxiv.org/abs/1606.06565)Cited by:[§4\.3\.4](https://arxiv.org/html/2611.33314#S4.SS3.SSS4.Px1.p3.1)\.
- Anilet al\.\(2023\)R\. Anilet al\.PaLM 2 technical report\.arXiv preprint arXiv:2305\.10403\.External Links:[Link](https://arxiv.org/abs/2305.10403)Cited by:[§4\.1](https://arxiv.org/html/2611.33314#S4.SS1.p1.1)\.
- Baeet al\.\(2026\)S\. Bae, J\. Hong, M\. Y\. Lee, H\. Kim, J\. Nam, and D\. KwakOnline difficulty filtering for reasoning oriented reinforcement learning\.InProceedings of the 19th Conference of the European Chapter of the Association for Computational Linguistics \(Volume 1: Long Papers\),pp\. 700–719\.External Links:[Document](https://dx.doi.org/10.18653/v1/2026.eacl-long.30),[Link](https://aclanthology.org/2026.eacl-long.30/)Cited by:[§4\.3\.2](https://arxiv.org/html/2611.33314#S4.SS3.SSS2.p2.1)\.
- Bavarianet al\.\(2022\)M\. Bavarian, H\. Jun, N\. Tezak, J\. Schulman, C\. McLeavey, J\. Tworek, and M\. ChenEfficient training of language models to fill in the middle\.arXiv preprint arXiv:2207\.14255\.External Links:[Link](https://arxiv.org/abs/2207.14255)Cited by:[§1](https://arxiv.org/html/2611.33314#S1.p1.1)\.
- Bengioet al\.\(2009\)Y\. Bengio, J\. Louradour, R\. Collobert, and J\. WestonCurriculum learning\.InProceedings of the 26th Annual International Conference on Machine Learning,pp\. 41–48\.External Links:[Document](https://dx.doi.org/10.1145/1553374.1553380),[Link](https://dl.acm.org/doi/10.1145/1553374.1553380)Cited by:[§4\.3\.2](https://arxiv.org/html/2611.33314#S4.SS3.SSS2.p2.1)\.
- Bhoopchandet al\.\(2016\)A\. Bhoopchand, T\. Rocktäschel, E\. Barr, and S\. RiedelLearning python code suggestion with a sparse pointer network\.arXiv preprint arXiv:1611\.08307\.External Links:[Link](https://arxiv.org/abs/1611.08307)Cited by:[§1](https://arxiv.org/html/2611.33314#S1.p1.1)\.
- Brodyet al\.\(2020\)S\. Brody, U\. Alon, and E\. YahavA structural model for contextual code changes\.Proceedings of the ACM on Programming Languages4\(OOPSLA\)\.External Links:[Document](https://dx.doi.org/10.1145/3428283),[Link](https://arxiv.org/abs/2005.13209)Cited by:[§1](https://arxiv.org/html/2611.33314#S1.p1.1)\.
- Brownet al\.\(2020\)T\. B\. Brownet al\.Language models are few\-shot learners\.arXiv preprint arXiv:2005\.14165\.External Links:[Link](https://arxiv.org/abs/2005.14165)Cited by:[§4\.1](https://arxiv.org/html/2611.33314#S4.SS1.p1.1)\.
- Chakrabortyet al\.\(2022\)S\. Chakraborty, Y\. Ding, M\. Allamanis, and B\. RayCODIT: code editing with tree\-based neural models\.IEEE Transactions on Software Engineering48\(4\)\.External Links:[Document](https://dx.doi.org/10.1109/TSE.2020.3020502),[Link](https://arxiv.org/abs/1810.00314)Cited by:[§1](https://arxiv.org/html/2611.33314#S1.p1.1)\.
- Chenet al\.\(2023\)C\. Chen, S\. Borgeaud, G\. Irving, J\. Lespiau, L\. Sifre, and J\. JumperAccelerating large language model decoding with speculative sampling\.arXiv preprint arXiv:2302\.01318\.External Links:[Link](https://arxiv.org/abs/2302.01318)Cited by:[§5\.2](https://arxiv.org/html/2611.33314#S5.SS2.SSS0.Px1.p1.1)\.
- Chenet al\.\(2021a\)M\. Chen, J\. Tworek, H\. Jun, Q\. Yuan, H\. P\. d\. O\. Pinto, J\. Kaplan, H\. Edwards, Y\. Burda, N\. Joseph, G\. Brockman,et al\.Evaluating large language models trained on code\.arXiv preprint arXiv:2107\.03374\.Cited by:[§1](https://arxiv.org/html/2611.33314#S1.p1.1),[§3\.1](https://arxiv.org/html/2611.33314#S3.SS1.SSS0.Px2.p1.1)\.
- Chenet al\.\(2021b\)Z\. Chen, S\. J\. Kommrusch, M\. Tufano, L\. Pouchet, D\. Poshyvanyk, and M\. MonperrusSequenceR: sequence\-to\-sequence learning for end\-to\-end program repair\.IEEE Transactions on Software Engineering\.Note:First published online in 2019External Links:[Document](https://dx.doi.org/10.1109/TSE.2019.2940179),[Link](https://arxiv.org/abs/1901.01808)Cited by:[§1](https://arxiv.org/html/2611.33314#S1.p1.1)\.
- Chowdheryet al\.\(2022\)A\. Chowdheryet al\.PaLM: scaling language modeling with pathways\.arXiv preprint arXiv:2204\.02311\.External Links:[Link](https://arxiv.org/abs/2204.02311)Cited by:[§4\.1](https://arxiv.org/html/2611.33314#S4.SS1.p1.1)\.
- Duvvuret al\.\(2026\)V\. Duvvur, G\. Mittal, and B\. SimmondsBuilding long\-distance next edit suggestions\.Note:Visual Studio Code BlogExternal Links:[Link](https://code.visualstudio.com/blogs/2026/02/26/long-distance-nes)Cited by:[§1](https://arxiv.org/html/2611.33314#S1.p7.1)\.
- Florensaet al\.\(2018\)C\. Florensa, D\. Held, X\. Geng, and P\. AbbeelAutomatic goal generation for reinforcement learning agents\.InProceedings of the 35th International Conference on Machine Learning,Proceedings of Machine Learning Research, Vol\.80,pp\. 1515–1528\.External Links:[Link](https://proceedings.mlr.press/v80/florensa18a.html)Cited by:[§4\.3\.2](https://arxiv.org/html/2611.33314#S4.SS3.SSS2.p2.1)\.
- Florensaet al\.\(2017\)C\. Florensa, D\. Held, M\. Wulfmeier, M\. R\. Zhang, and P\. AbbeelReverse curriculum generation for reinforcement learning\.InProceedings of the 1st Annual Conference on Robot Learning,Proceedings of Machine Learning Research, Vol\.78,pp\. 482–495\.External Links:[Link](https://proceedings.mlr.press/v78/florensa17a.html)Cited by:[§4\.3\.2](https://arxiv.org/html/2611.33314#S4.SS3.SSS2.p2.1)\.
- Friedet al\.\(2023\)D\. Fried, A\. Aghajanyan, J\. Lin, S\. Wang, E\. Wallace, F\. Shi, R\. Zhong, W\. Yih, L\. Zettlemoyer, and M\. LewisInCoder: a generative model for code infilling and synthesis\.InInternational Conference on Learning Representations,External Links:[Link](https://arxiv.org/abs/2204.05999)Cited by:[§1](https://arxiv.org/html/2611.33314#S1.p1.1)\.
- Friedman \(2001\)J\. H\. FriedmanGreedy function approximation: a gradient boosting machine\.The Annals of Statistics29\(5\),pp\. 1189–1232\.External Links:[Document](https://dx.doi.org/10.1214/aos/1013203451),[Link](https://www.jstor.org/stable/2699986)Cited by:[§4\.3\.3](https://arxiv.org/html/2611.33314#S4.SS3.SSS3.Px1.p1.1)\.
- Fu and Mogensen \(2025\)S\. Fu and J\. MogensenThe road to better completions: building a faster, smarter GitHub Copilot with a new custom model\.Note:The GitHub BlogExternal Links:[Link](https://github.blog/ai-and-ml/github-copilot/the-road-to-better-completions-building-a-faster-smarter-github-copilot-with-a-new-custom-model/)Cited by:[§1](https://arxiv.org/html/2611.33314#S1.p7.1)\.
- Gonget al\.\(2026a\)J\. Gong, B\. Liggett, and U\. AbdullaevBuilding the new GitHub Copilot inline suggestions model: part one\.Note:Visual Studio Code BlogExternal Links:[Link](https://code.visualstudio.com/blogs/2026/09/16/building-the-github-copilot-inline-suggestions-model-part-one)Cited by:[§6\.2](https://arxiv.org/html/2611.33314#S6.SS2.p2.1)\.
- Gonget al\.\(2026b\)J\. Gong, S\. Ma, B\. Liggett, and U\. AbdullaevBuilding the new GitHub Copilot inline suggestions model: part two\.Note:Visual Studio Code BlogExternal Links:[Link](https://code.visualstudio.com/blogs/2026/09/23/building-the-github-copilot-inline-suggestions-model-part-two)Cited by:[§6\.2](https://arxiv.org/html/2611.33314#S6.SS2.p2.1)\.
- Guptaet al\.\(2023\)P\. Gupta, A\. Khare, Y\. Bajpai, S\. Chakraborty, S\. Gulwani, A\. Kanade, A\. Radhakrishna, G\. Soares, and A\. TiwariGrace: language models meet code edits\.InProceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering,External Links:[Document](https://dx.doi.org/10.1145/3611643.3616253),[Link](https://www.microsoft.com/en-us/research/publication/grace/)Cited by:[§1](https://arxiv.org/html/2611.33314#S1.p1.1)\.
- Guptaet al\.\(2017\)R\. Gupta, S\. Pal, A\. Kanade, and S\. ShevadeDeepFix: fixing common C language errors by deep learning\.InProceedings of the AAAI Conference on Artificial Intelligence,Vol\.31\.External Links:[Document](https://dx.doi.org/10.1609/aaai.v31i1.10742),[Link](https://ojs.aaai.org/index.php/AAAI/article/view/10742)Cited by:[§1](https://arxiv.org/html/2611.33314#S1.p1.1)\.
- Heymanet al\.\(n\.d\.\)J\. Heyman, L\. Holmberg, and A\. BaldwinLocust documentation\.Note:Software documentationAccessed October 30, 2026External Links:[Link](https://docs.locust.io/en/stable/)Cited by:[Appendix B](https://arxiv.org/html/2611.33314#A2.SS0.SSS0.Px1.p1.1)\.
- Hindleet al\.\(2012\)A\. Hindle, E\. T\. Barr, Z\. Su, M\. Gabel, and P\. DevanbuOn the naturalness of software\.InProceedings of the 34th International Conference on Software Engineering,External Links:[Link](https://web.cs.ucdavis.edu/~devanbu/natural.pdf)Cited by:[§1](https://arxiv.org/html/2611.33314#S1.p1.1)\.
- Jianget al\.\(2023\)A\. Q\. Jianget al\.Mistral 7b\.arXiv preprint arXiv:2310\.06825\.External Links:[Link](https://arxiv.org/abs/2310.06825)Cited by:[§4\.1](https://arxiv.org/html/2611.33314#S4.SS1.p1.1)\.
- Jianget al\.\(2021\)M\. Jiang, E\. Grefenstette, and T\. RocktäschelPrioritized level replay\.arXiv preprint arXiv:2010\.03934\.External Links:[Link](https://arxiv.org/abs/2010.03934)Cited by:[§4\.3\.2](https://arxiv.org/html/2611.33314#S4.SS3.SSS2.p2.1)\.
- Kumaret al\.\(2010\)M\. P\. Kumar, B\. Packer, and D\. KollerSelf\-paced learning for latent variable models\.InAdvances in Neural Information Processing Systems,Vol\.23,pp\. 1189–1197\.External Links:[Link](https://proceedings.neurips.cc/paper_files/paper/2010/hash/e57c6b956a6521b28495f2886ca0977a-Abstract.html)Cited by:[§4\.3\.2](https://arxiv.org/html/2611.33314#S4.SS3.SSS2.p2.1)\.
- Leviathanet al\.\(2023\)Y\. Leviathan, M\. Kalman, and Y\. MatiasFast inference from transformers via speculative decoding\.InProceedings of the 40th International Conference on Machine Learning,Proceedings of Machine Learning Research, Vol\.202,pp\. 19274–19286\.External Links:[Link](https://proceedings.mlr.press/v202/leviathan23a.html)Cited by:[§5\.2](https://arxiv.org/html/2611.33314#S5.SS2.SSS0.Px1.p1.1)\.
- Liet al\.\(2024\)K\. Li, Q\. Hu, J\. Zhao, H\. Chen, Y\. Xie, T\. Liu, M\. Shieh, and J\. HeInstructCoder: instruction tuning large language models for code editing\.InProceedings of the 62nd Annual Meeting of the Association for Computational Linguistics \(Volume 4: Student Research Workshop\),pp\. 50–70\.External Links:[Link](https://arxiv.org/abs/2310.20329)Cited by:[§1](https://arxiv.org/html/2611.33314#S1.p1.1)\.
- Lightmanet al\.\(2023\)H\. Lightman, V\. Kosaraju, Y\. Burda, H\. Edwards, B\. Baker, T\. Lee, J\. Leike, J\. Schulman, I\. Sutskever, and K\. CobbeLet’s verify step by step\.arXiv preprint arXiv:2305\.20050\.External Links:[Link](https://arxiv.org/abs/2305.20050)Cited by:[§4\.3\.2](https://arxiv.org/html/2611.33314#S4.SS3.SSS2.p2.1)\.
- Liuet al\.\(2024\)C\. Liu, Y\. Cai, Y\. Lin, Y\. Huang, Y\. Pei, B\. Jiang, P\. Yang, J\. S\. Dong, and H\. MeiCoEdPilot: recommending code edits with learned prior edit relevance, project\-wise awareness, and interactive nature\.InProceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis,External Links:[Document](https://dx.doi.org/10.1145/3650212.3652142),[Link](https://arxiv.org/abs/2408.01733)Cited by:[§1](https://arxiv.org/html/2611.33314#S1.p1.1)\.
- Luet al\.\(2025\)R\. Lu, Y\. Huo, M\. Zhang, Y\. Li, and M\. R\. LyuNext edit prediction: learning to predict code edits from context and interaction history\.arXiv preprint arXiv:2508\.10074\.External Links:[Link](https://arxiv.org/abs/2508.10074)Cited by:[§1](https://arxiv.org/html/2611.33314#S1.p1.1)\.
- Matiisenet al\.\(2017\)T\. Matiisen, A\. Oliver, T\. Cohen, and J\. SchulmanTeacher\-student curriculum learning\.arXiv preprint arXiv:1707\.00183\.External Links:[Link](https://arxiv.org/abs/1707.00183)Cited by:[§4\.3\.2](https://arxiv.org/html/2611.33314#S4.SS3.SSS2.p2.1)\.
- Merchant and Hu \(2025\)K\. Merchant and Y\. HuEvolving GitHub Copilot’s next edit suggestions through custom model training\.Note:The GitHub BlogExternal Links:[Link](https://github.blog/ai-and-ml/github-copilot/evolving-github-copilots-next-edit-suggestions-through-custom-model-training/)Cited by:[§1](https://arxiv.org/html/2611.33314#S1.p7.1)\.
- OpenAI \(2024\)OpenAIo200k\_base tokenizer\.Note:Tokenizer vocabularyExternal Links:[Link](https://openaipublic.blob.core.windows.net/encodings/o200k_base.tiktoken)Cited by:[§4\.1](https://arxiv.org/html/2611.33314#S4.SS1.p1.1)\.
- Ouyanget al\.\(2022\)L\. Ouyanget al\.Training language models to follow instructions with human feedback\.InAdvances in Neural Information Processing Systems,Vol\.35\.External Links:[Document](https://dx.doi.org/10.52202/068431-2011),[Link](https://arxiv.org/abs/2203.02155)Cited by:[§1](https://arxiv.org/html/2611.33314#S1.p2.1)\.
- Raychevet al\.\(2014\)V\. Raychev, M\. Vechev, and E\. YahavCode completion with statistical language models\.InProceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation,External Links:[Link](https://www.sri.inf.ethz.ch/publications/raychev2014code)Cited by:[§1](https://arxiv.org/html/2611.33314#S1.p1.1)\.
- Reid and Neubig \(2022\)M\. Reid and G\. NeubigLearning to model editing processes\.arXiv preprint arXiv:2205\.12374\.External Links:[Link](https://arxiv.org/abs/2205.12374)Cited by:[§1](https://arxiv.org/html/2611.33314#S1.p1.1)\.
- Sternet al\.\(2018\)M\. Stern, N\. Shazeer, and J\. UszkoreitBlockwise parallel decoding for deep autoregressive models\.InAdvances in Neural Information Processing Systems,Vol\.31\.External Links:[Link](https://arxiv.org/abs/1811.03115)Cited by:[§5\.2](https://arxiv.org/html/2611.33314#S5.SS2.SSS0.Px1.p1.1)\.
- Suttonet al\.\(1999\)R\. S\. Sutton, D\. McAllester, S\. Singh, and Y\. MansourPolicy gradient methods for reinforcement learning with function approximation\.InAdvances in Neural Information Processing Systems,Vol\.12\.External Links:[Link](https://proceedings.neurips.cc/paper_files/paper/1999/hash/464d828b85b0bed98e80ade0a5c43b0f-Abstract.html)Cited by:[§4\.3\.2](https://arxiv.org/html/2611.33314#S4.SS3.SSS2.p3.1)\.
- Touvronet al\.\(2023a\)H\. Touvronet al\.Llama 2: open foundation and fine\-tuned chat models\.arXiv preprint arXiv:2307\.09288\.External Links:[Link](https://arxiv.org/abs/2307.09288)Cited by:[§4\.1](https://arxiv.org/html/2611.33314#S4.SS1.p1.1)\.
- Touvronet al\.\(2023b\)H\. Touvronet al\.LLaMA: open and efficient foundation language models\.arXiv preprint arXiv:2302\.13971\.External Links:[Link](https://arxiv.org/abs/2302.13971)Cited by:[§4\.1](https://arxiv.org/html/2611.33314#S4.SS1.p1.1)\.
- Tufanoet al\.\(2019\)M\. Tufano, C\. Watson, G\. Bavota, M\. Di Penta, M\. White, and D\. PoshyvanykAn empirical study on learning bug\-fixing patches in the wild via neural machine translation\.ACM Transactions on Software Engineering and Methodology\.External Links:[Link](https://arxiv.org/abs/1812.08693)Cited by:[§1](https://arxiv.org/html/2611.33314#S1.p1.1)\.
- Vaswaniet al\.\(2017\)A\. Vaswani, N\. Shazeer, N\. Parmar, J\. Uszkoreit, L\. Jones, A\. N\. Gomez, Ł\. Kaiser, and I\. PolosukhinAttention is all you need\.Advances in neural information processing systems30\.Cited by:[§4\.1](https://arxiv.org/html/2611.33314#S4.SS1.p1.1)\.
- Weiet al\.\(2022\)J\. Wei, M\. Bosma, V\. Y\. Zhao, K\. Guu, A\. W\. Yu, B\. Lester, N\. Du, A\. M\. Dai, Q\. V\. Le, and D\. ZhouFinetuned language models are zero\-shot learners\.InInternational Conference on Learning Representations,External Links:[Link](https://arxiv.org/abs/2109.01652)Cited by:[§1](https://arxiv.org/html/2611.33314#S1.p2.1)\.
- Weiet al\.\(2024\)J\. Wei, G\. Durrett, and I\. DilligCoeditor: leveraging repo\-level diffs for code auto\-editing\.InInternational Conference on Learning Representations,External Links:[Link](https://arxiv.org/abs/2305.18584)Cited by:[§1](https://arxiv.org/html/2611.33314#S1.p1.1)\.
- Williams \(1992\)R\. J\. WilliamsSimple statistical gradient\-following algorithms for connectionist reinforcement learning\.Machine Learning8,pp\. 229–256\.External Links:[Document](https://dx.doi.org/10.1007/BF00992696),[Link](https://doi.org/10.1007/BF00992696)Cited by:[§4\.3\.2](https://arxiv.org/html/2611.33314#S4.SS3.SSS2.p3.1)\.
- Xiaet al\.\(2023\)H\. Xia, T\. Ge, P\. Wang, S\. Chen, F\. Wei, and Z\. SuiSpeculative decoding: exploiting speculative execution for accelerating seq2seq generation\.InFindings of the Association for Computational Linguistics: EMNLP 2023,pp\. 3909–3925\.External Links:[Document](https://dx.doi.org/10.18653/v1/2023.findings-emnlp.257),[Link](https://aclanthology.org/2023.findings-emnlp.257/)Cited by:[§5\.2](https://arxiv.org/html/2611.33314#S5.SS2.SSS0.Px1.p1.1)\.
- Yinet al\.\(2019\)P\. Yin, G\. Neubig, M\. Allamanis, M\. Brockschmidt, and A\. L\. GauntLearning to represent edits\.InInternational Conference on Learning Representations,External Links:[Link](https://arxiv.org/abs/1810.13337)Cited by:[§1](https://arxiv.org/html/2611.33314#S1.p1.1)\.
- Yuet al\.\(2025\)Q\. Yuet al\.DAPO: an open\-source LLM reinforcement learning system at scale\.arXiv preprint arXiv:2503\.14476\.External Links:[Link](https://arxiv.org/abs/2503.14476)Cited by:[§4\.3\.2](https://arxiv.org/html/2611.33314#S4.SS3.SSS2.p2.1)\.
- Zelikmanet al\.\(2022\)E\. Zelikman, Y\. Wu, J\. Mu, and N\. D\. GoodmanSTaR: bootstrapping reasoning with reasoning\.InAdvances in Neural Information Processing Systems,Vol\.35,pp\. 15476–15488\.External Links:[Link](https://arxiv.org/abs/2203.14465)Cited by:[§4\.3\.2](https://arxiv.org/html/2611.33314#S4.SS3.SSS2.p2.1)\.
- Zhanget al\.\(2022a\)J\. Zhang, S\. Panthaplackel, P\. Nie, J\. J\. Li, and M\. GligoricCoditT5: pretraining for source code and natural language editing\.InProceedings of the 37th IEEE/ACM International Conference on Automated Software Engineering,External Links:[Link](https://arxiv.org/abs/2208.05446)Cited by:[§1](https://arxiv.org/html/2611.33314#S1.p1.1)\.
- Zhanget al\.\(2022b\)Y\. Zhang, Y\. Bajpai, P\. Gupta, A\. Ketkar, M\. Allamanis, T\. Barik, S\. Gulwani, A\. Radhakrishna, M\. Raza, G\. Soares, and A\. TiwariOverwatch: learning patterns in code edit sequences\.Proceedings of the ACM on Programming Languages6\(OOPSLA2\)\.External Links:[Document](https://dx.doi.org/10.1145/3563302),[Link](https://arxiv.org/abs/2207.12456)Cited by:[§1](https://arxiv.org/html/2611.33314#S1.p1.1)\.
- Zhaoet al\.\(2019\)R\. Zhao, D\. Bieber, K\. Swersky, and D\. TarlowNeural networks for modeling source code edits\.arXiv preprint arXiv:1904\.02818\.External Links:[Link](https://arxiv.org/abs/1904.02818)Cited by:[§1](https://arxiv.org/html/2611.33314#S1.p1.1)\.
- Zhenget al\.\(2023\)L\. Zheng, W\. Chiang, Y\. Sheng, S\. Zhuang, Z\. Wu, Y\. Zhuang, Z\. Lin, Z\. Li, D\. Li, E\. P\. Xing, H\. Zhang, J\. E\. Gonzalez, and I\. StoicaJudging LLM\-as\-a\-judge with MT\-Bench and Chatbot Arena\.InAdvances in Neural Information Processing Systems,Vol\.36\.External Links:[Link](https://arxiv.org/abs/2306.05685)Cited by:[§3\.1](https://arxiv.org/html/2611.33314#S3.SS1.SSS0.Px1.p1.1),[§4\.2\.3](https://arxiv.org/html/2611.33314#S4.SS2.SSS3.Px1.p1.1)\.
- Ziegleret al\.\(2019\)D\. M\. Ziegler, N\. Stiennon, J\. Wu, T\. B\. Brown, A\. Radford, D\. Amodei, P\. Christiano, and G\. IrvingFine\-tuning language models from human preferences\.arXiv preprint arXiv:1909\.08593\.External Links:[Link](https://arxiv.org/abs/1909.08593)Cited by:[§1](https://arxiv.org/html/2611.33314#S1.p2.1)\.

## Appendix ACitation Reference

Please use this BIBTEX entry when citing this report:

@techreport\{unified\_inline\_code\_editing\_model,

title=\{BuildingaUnifiedInlineCodeEditingModelfor\{GitHubCopilot\}\},

author=\{\{MicrosoftCodeAITeam\}and\{MicrosoftVSCodeTeam\}\},

institution=\{Microsoft\},

year=\{2026\},

\}

## Appendix BSpeculative Decoding Draft Comparison

We compare five speculative decoding draft formats while holding the 2\-in\-1 model fixed\. This comparison evaluates how the draft prefix affects request latency, rather than comparing the 2\-in\-1 and 3\-in\-1 models\. Figure[24](https://arxiv.org/html/2611.33314#A2.F24)illustrates all five formats using the same function body completion as Figure[15](https://arxiv.org/html/2611.33314#S5.F15)\. The no\-draft baseline supplies no speculative decoding draft\. The file path draft, used by the 2\-in\-1 client, contains the file path and a trailing colon\. The current line draft adds the cursor line number and the current line as a deletion\. The current line replaced draft additionally supplies a newline and the addition marker, leaving the replacement text for the model to generate\. The current line completed draft, which we select for the 3\-in\-1 client, instead repeats the current line after the addition marker, anticipating an insertion that preserves the existing line\.

File content:/path/to/util\.py, cursor at the end of the signature\.

def count\_words\(text: str\) \-\> int: return len\(text\.split\(\)\)

\(a\)No draft/path/to/util\.py:0\-def count\_words\(text: str\) \-\> int:\+def count\_words\(text: str\) \-\> int:\+ return len\(text\.split\(\)\)
\(b\)File path \(2\-in\-1 draft\)/path/to/util\.py:0\-def count\_words\(text: str\) \-\> int:\+def count\_words\(text: str\) \-\> int:\+ return len\(text\.split\(\)\)
\(c\)Current line/path/to/util\.py:0\-def count\_words\(text: str\) \-\> int:\+def count\_words\(text: str\) \-\> int:\+ return len\(text\.split\(\)\)
\(d\)Current line replaced/path/to/util\.py:0\-def count\_words\(text: str\) \-\> int:\+def count\_words\(text: str\) \-\> int:\+ return len\(text\.split\(\)\)
\(e\)Current line completed \(selected 3\-in\-1 draft\)/path/to/util\.py:0\-def count\_words\(text: str\) \-\> int:\+def count\_words\(text: str\) \-\> int:\+ return len\(text\.split\(\)\)
Legend

Inserted text

Speculative decoding draft

Figure 24:The five draft formats in the comparison\. Each panel shows the same illustrative diff patch response; purple highlighting marks the supplied draft prefix, and green marks the suggested insertion in the file content\. No draft prefix is supplied in panel \(a\)\.##### Experimental Setup\.

All formats use the same ordered set of 4,792 recorded editing contexts and identical prompts; only the speculative decoding draft changes\. We set the sampling temperature to 0\. We test each format in a separate session of the Locust load\-testing tool\[[Heyman et al\., n\.d\.](https://arxiv.org/html/2611.33314#bib.bib16)\], with successive concurrency levels of 1, 4, 8, 12, and 16 clients\. Each client sends its next request immediately after the previous request completes\. Each level has a 120\-second measurement window following an unmeasured warmup of 30 to 60 seconds, with a request\-rate stability check\. We reuse contexts cyclically when we exhaust the input set\. We assign requests to a measurement window by their start time, including those that complete after the window ends; we exclude warmup and cooldown requests\. We compute achieved requests per second \(RPS\) by dividing the number of requests that start in the measurement window by 120 seconds\. We measure latency at the load generator from request construction through receipt and parsing of the full response, not time to first token or client display time\. We report the arithmetic mean, median \(p50\), and 95th percentile \(p95\), computing percentiles by linear interpolation between ordered observations\. The current line series uses the rerun included in the comparison report\.

##### Latency Results\.

Figure[25](https://arxiv.org/html/2611.33314#A2.F25)plots latency against achieved RPS\. At each tested concurrency level, all three current line drafts have lower mean latency than the file path draft\. At 16 concurrent clients, the current line completed draft has a mean latency of 576\.8 ms, compared with 693\.0 ms for the file path draft and 723\.7 ms for the no\-draft baseline\. These measurements favor the current line completed draft among the five formats tested on the 2\-in\-1 model\. The 3\-in\-1 model’s completion\-focused training motivates our expectation that the current line completed draft matches its response prefixes more often than those of the 2\-in\-1 model\. We therefore select the current line completed draft for the 3\-in\-1 model\.

\(a\) Average5005506006507007500102030Achieved RPS \(requests/s\)Request latency \(ms\)\(b\) p504004505005506006500102030Achieved RPS \(requests/s\)\(c\) p9510001200140016000102030Achieved RPS \(requests/s\)No draftFile pathCurrent lineCurrent line replacedCurrent line completed

Figure 25:Request latency versus achieved RPS for five draft formats on the fixed 2\-in\-1 model: average, p50, and p95\. From left to right, the five points on each curve correspond to 1, 4, 8, 12, and 16 concurrent clients\. Lines connect measured points and do not represent additional experiments\. Statistics retain failed requests, matching the source comparison report\.

## Appendix CPatch Validity Taxonomy

Tables[20](https://arxiv.org/html/2611.33314#A3.T20)and[21](https://arxiv.org/html/2611.33314#A3.T21)show the patch validity taxonomy and corresponding examples for critical and suboptimal cases, respectively\.

Table 20:Critical patch validity taxonomy\. These responses either cannot be correctly parsed and applied to the file or produce a visible defect\. Each minimal example uses the reference file shown at the top, with line numbers as they appear in the prompt\.Reference filetest\.py, as it appears in the prompt1\|def hello\(\):2\| print\("hello"\)3\| x = 14\| return True5\|6\|def goodbye\(\):7\| print\("goodbye"\)8\| return FalseCheckScopeExampleAny line starts with a spaceResponsetest\.py:2Patch contains empty linesPatchtest\.py:2\- print\("hello"\)\+ print\("world"\)Response does not contain:Responseprint\("hello"\)Patch header does not contain:Patchtest\.py\-2Patch header content after:is not a digit sequencePatchtest\.py:line2File named in the patch header is absent from the promptPatchmain\.py:2Line number in the patch header is absent from the promptPatchtest\.py:17All patches in the response are no\-opsResponsetest\.py:2\- print\("hello"\)\+ print\("hello"\)First line of a patch is not a deletionPatchtest\.py:2\+ print\("world"\)First deletion line does not match the prompt line it namesPatchtest\.py:2\- print\("hello\!"\)\+ print\("world"\)Patch interleaves deletions and additionsPatchtest\.py:2\- print\("hello"\)\+ print\("world"\)\- x = 1\+ x = 2Added lines duplicate the code following the insertion pointPatchtest\.py:2\- print\("hello"\)\+ print\("world"\)\+ x = 1Added lines duplicate the code preceding the insertion pointPatchtest\.py:3\- x = 1\+ print\("hello"\)\+ x = 2Table 21:Suboptimal patch validity taxonomy\. These responses are applicable and correct, but inefficient\. Each minimal example uses the reference file of Table[20](https://arxiv.org/html/2611.33314#A3.T20)\.CheckScopeExampleA no\-op patch appears among non\-no\-op patchesResponsetest\.py:2\- print\("hello"\)\+ print\("hello"\)test\.py:7\- print\("goodbye"\)\+ print\("bye"\)Patch deletes and re\-adds lines it does not changePatchtest\.py:2\- print\("hello"\)\- x = 1\+ print\("hello"\)\+ x = 2Too many unchanged lines separate the modified linesPatchtest\.py:2\- print\("hello"\)\- x = 1\- return True\+ print\("world"\)\+ x = 1\+ return FalsePure deletion carries unneeded additions and deletionsPatchtest\.py:2\- print\("hello"\)\- x = 1\+ print\("hello"\)
## Appendix DInput Context Example

Figure[26](https://arxiv.org/html/2611.33314#A4.F26)illustrates the key components of the unified model input context: recently viewed code snippets, current file content, edit diff history, cursor position, and instructions\.

<\|recently\_viewed\_code\_snippets\|\>

<\|recently\_viewed\_code\_snippet\|\>

code\_snippet\_file\_path:/path/to/antarctica\.py

40\|penguin2=Penguin\("adelie"\)

41\|penguin2\.swim\(\)

42\|feed\_penguin\(penguin2,fish="krill"\)

<\|/recently\_viewed\_code\_snippet\|\>

<\|/recently\_viewed\_code\_snippets\|\>

<\|current\_file\_content\|\>

current\_file\_path:/path/to/penguins\.py

0\|deffeed\_penguin\(penguin,fo\):

1\|penguin\.meals\+=1

2\|penguin\.hungry=False

3\|penguin\.last\_ate\_time=datetime\.now\(\)

4\|

5\|print\(f"\{penguin\.name\}ate\{fish\.type\}"\)

6\|

7\|penguin=Penguin\("emperor"\)

8\|feed\_penguin\(penguin,fish="silverfish"\)

<\|/current\_file\_content\|\>

<\|edit\_diff\_history\|\>

\-\-\-/path/to/penguins\.py

\+\+\+/path/to/penguins\.py

@@\-0,1\+0,1@@

\-deffeed\_penguin\(penguin,fish\):

\+deffeed\_penguin\(penguin,fo\):

<\|/edit\_diff\_history\|\>

<\|cursor\_position\|\>

0\|deffeed\_penguin\(penguin,fo<\|cursor\|\>\):

<\|/cursor\_position\|\>

Thedeveloperwasworkingonasectionofcodewithinthe‘current\_file\_content‘\-

carefullynotetheir‘cursor\_location‘markedwith‘<\|cursor\|\>‘\.Usingthegiven

‘recently\_viewed\_code\_snippets‘,‘current\_file\_content‘,‘edit\_diff\_history‘,and

‘cursor\_location‘,pleasecontinuethedeveloper’swork\.Outputamodifieddiff

formatwithasequenceofintuitivenextchanges,whereeachpatchmuststartwith

‘<filename\>:<linenumber\>‘\.Orderchangesbypriorityandflow;forinstance,edits

adjacenttotheuser’scursorshouldalwaysbeprioritized,followedbylinesnear

thecursor,followedbylinesfartheraway\.Iftherearenogoodeditcandidates,

outputtheemptystring""\.Avoidundoingorrevertingthedeveloper’slast

changeunlessthereareobvioustyposorerrors\.Adheremeticulouslytothediff

format\.

Figure 26:The unified prompt corresponding to the editing context in Figure[6](https://arxiv.org/html/2611.33314#S2.F6)\. Recently viewed code, the current file, recent edit history, cursor position, and additional instructions guide the model to output a sequence of edit patches that best fit the editing context\.
## Appendix EAdditional Offline\-Online Evaluation Metric Correlation Analysis

This appendix contains the 18 selected offline\-online metric pairings we discuss in Section[6\.4](https://arxiv.org/html/2611.33314#S6.SS4), which we show separately for the 2\-in\-1 and 3\-in\-1 candidates in 36 phase\-specific panels\. We show the single 2\-in\-1 QMH observation descriptively, but it does not support a correlation analysis\. Figures[27](https://arxiv.org/html/2611.33314#A5.F27),[28](https://arxiv.org/html/2611.33314#A5.F28),[29](https://arxiv.org/html/2611.33314#A5.F29),[30](https://arxiv.org/html/2611.33314#A5.F30),[31](https://arxiv.org/html/2611.33314#A5.F31), and[32](https://arxiv.org/html/2611.33314#A5.F32)report phase\-specific Pearsonrr, Spearmanρ\\rho, sample sizes, and least\-squares fits\. We use shared axes across the two phases for each pairing, but fit lines only over each phase’s observed offline range\. All online values are relative changes from controls specific to each A/B experiment\. No\-edit and conversion counts are not normalized abstention rates\. Repeated coordinates can overlap, particularly among the nine 3\-in\-1 QMH candidates in a narrow score range\. The uncertainty, selection, and dependence limitations we discuss in the main text apply to each of these analyses\. None of the displayed phase\-specific associations meets the adjusted 0\.05 significance threshold\.

Figure 27:Augmented HumanEval Multi\-Line accuracy versus ARC at 30 seconds and 5 minutes, relative to each experiment’s control\. Accuracy has only weak positive associations with retained characters in both phases\.Figure 28:Simulation Tests Total versus online suggestion changes, relative to each experiment’s control\. Higher scores accompany more shown and dismissed suggestions in both phases, a pattern consistent with the benchmark capturing variation in suggestion frequency\.Figure 29:Output View Kind no\-edit counts versus ARC at 30 seconds and 5 minutes, relative to each experiment’s control\. Rank correlations are weakly positive in Phase 1 and negative in Phase 2, providing no consistent association between abstention and retained characters\.Figure 30:POE rejection rate and acceptance\-to\-rejection ratio versus dismissals and ARC, relative to each experiment’s control\. Higher rejection rates and lower acceptance\-to\-rejection ratios accompany more dismissals in both phases; associations with ARC are less consistent\.Figure 31:POE counts of previously accepted suggestions converted to no edit versus ARC at 30 seconds and 5 minutes, relative to each experiment’s control\. Rank correlations change sign between phases, providing no consistent association between these conversions and retained characters\.Figure 32:QMH passes versus ARC, shown, and accepted suggestions, relative to each experiment’s control\. Associations are weak among the nine 3\-in\-1 candidates; the single 2\-in\-1 observation cannot support a correlation estimate\. These results do not establish QMH as a predictor of online performance\.

相似文章

GitHub Copilot App

Hacker News Top

GitHub Copilot 是一款 AI 驱动的代码补全工具,通过实时建议代码片段和函数来帮助开发者。

提升VS Code中GitHub Copilot的令牌效率

Lobsters Hottest

VS Code团队详细介绍了最近对GitHub Copilot代理功能的优化,例如提示缓存和工具搜索,以提高令牌效率并在基于用量的计费模式下降低成本。