arXiv:2611.07634cs.SENov 2026

Manuscript Offprint

arXiv:2611.07634

AiXapply: Fast and Reliable Full-File Code Integration with Specialized Small Models for IDE Workflows

Siyuan Jiang, Xiang Cai, Peixu Wang, Yu Han, Yihong Dong, Wei Ning, Xuyuan Guo, Jincheng Wen, Dexin Liu, Wei Zhao, Ge Li

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Siyuan Jiang*‡, Xiang Cai*‡, Peixu Wang†, Yu Han*, Yihong Dong†, Wei Ning*, Xuyuan Guo†, Jincheng Wen†, Dexin Liu*, Wei Zhao†, Ge Li†§

*aiXcoder †Peking University

{jiangsiyuan,caixiang,hangyu,ningwei}@aixcoder.com, ldx@aixcoder.com

peixu.wang@u.nus.edu, dongyh@stu.pku.edu.cn, xyguo25@stu.pku.edu.cn

3116127286@qq.com, {zhaowei,lige}@pku.edu.cn

Abstract—Large language models increasingly assist developers by proposing small code edits, yet reliably integrating a partial update snippet into an existing file while preserving unrelated content remains poorly supported by current code-generation workflows. We formalize the Code Integration (Apply) task as follows: given an original file and an update snippet, the system must produce the complete merged file while preserving all content outside the requested edit. We construct a high-quality multi-language dataset from real commits via a structured pipeline that converts code changes into update snippets paired with full-file ground truth and enforces consistency through verification and filtering. We then train a specialized 4B model, aiXapply, using supervised fine-tuning and reinforcement learning (GRPO). The supervised variant achieves 94.4% accuracy under our language-aware comparison, surpassing a strong large-model (Deepseek-V3.2) baseline (91.6%). Speculative decoding enables aiXapply-RL to reach ~2700 tokens/s on a single A100 in a decoding subset; on the full benchmark, it achieves roughly 75× lower latency than the API-served Deepseek-V3.2 baseline. We further conduct an industrial deployment of aiXapply-RL in the aiXcoder IDE plugin as a dedicated Apply service, reducing mean Apply latency from 50 seconds to 1.89 seconds by offloading full-file generation from the upstream large model. Under time-based capacity planning, replacing one of five upstream serving instances would save 20% of upstream machine cost before the additional shared A100 service cost. Overall, our results demonstrate that treating code integration as a standalone task enables small models to achieve high accuracy, practical efficiency, and concrete industrial benefits in real-world IDE workflows where latency, cost and privacy are critical.

Index Terms—Code Integration, Large Language Model, Reinforcement Learning

I. INTRODUCTION

AI-assisted IDE workflows often generate localized update snippets that must be merged into a source file while preserving unrelated content. In aiXcoder, using the upstream model for full-file Apply took 50 seconds on average within an approximately 240-second editing workflow. We isolate

Grouped bars (score) with line overlay (latency)

Figure

Fig. 1. Accuracy–latency comparison across three code integration paradigms. Bars show equivalence accuracy for different models, while the line indicates average latency (seconds). For DeepSeek-V3.2, moving from unified diff to search-and-replace and then to full-file Apply consistently improves accuracy (0.560 → 0.749 → 0.916), but also increases latency (14.22s → 28.48s → 108.96s). Across models, full-file Apply achieves the highest accuracy, with Qwen3.5-397B reaching 0.948. Our aiXapply-RL maintains comparable accuracy (0.938) while reducing latency to 1.45s, demonstrating a significantly better accuracy–latency trade-off for one-shot code integration.

this integration stage as the Apply task and offload it to a specialized small model.

Unified diff represents edits through hunk headers, line-level changes, and surrounding context. Small errors in headers or context alignment can make a generated patch non-applicable.

Search-and-replace avoids diff syntax but requires the intended source fragment to be identified. Unmatched or ambiguous fragments can cause failure, so it is commonly used with iterative retries rather than for one-shot integration.

Full-file Apply generates the complete updated file directly, avoiding intermediate representations. However, regenerating unchanged content with a large model incurs substantial latency and token cost.

This gap motivates a different perspective. Rather than treating editing as a byproduct of general code generation, we formulate snippet integration as a dedicated software

Project repository: https://github.com/aixcoder-plugin/aiXapply-4B.

‡^{\ddagger}These authors contributed equally to this work. §^{\S}Ge Li is the corresponding author.

Figure

Fig. 2. Workflow of aiXapply in VS Code. A user submits an editing request through Continue, the LLM then generates an update snippet, which aiXapply applies to the source file to produce a candidate updated file. VS Code displays the resulting diff for user inspection, after which the user decides whether to accept or reject the proposed edit.

engineering task: given a source file and an update snippet, produce the merged file with zero unintended changes outside the target region. This formulation is precise, verifiable, and directly aligned with IDE requirements.

In this workflow, the upstream model specifies the intended change as a snippet, while a dedicated Apply model handles full-file reproduction. This offloads the copying of unchanged content from the large model to a smaller model, whose copy-dominant workload can be accelerated with speculative decoding.

Our goal is to retain the accuracy of full-file Apply while making it efficient enough for deployment. We study this problem through four research questions.

RQ1: What are the advantages and limitations of full-file Apply compared to unified diff and search-and-replace?

RQ2: Can a small model achieve high accuracy and robustness on the Apply task across diverse languages and out-of-distribution scenarios?

RQ3: Can full-file Apply be made efficient for realistic IDE scenarios?

RQ4: What training strategies are effective for the Apply task?

We compare the three integration paradigms, train 4B SFT and RL variants on commit-derived data, and evaluate accuracy, robustness, and decoding efficiency across 20 languages. We also report the aiXcoder deployment and its manual Apply assessment on real development tasks. Figure 1 summarizes the accuracy-latency trade-off. Our contributions are:

  • Industrial deployment and practical evidence: We integrate a dedicated Apply service into aiXcoder, report its latency reduction, and evaluate first-output Apply acceptability on 100 real development tasks (91 acceptable with aiXapply-RL versus 88 with GLM-5).

  • A systematic evaluation of code integration paradigms: We compare full-file Apply with search-and-replace and unified diff across accuracy, efficiency,

and generalization benchmarks, and analyze SFT/RL trade-offs across languages and challenging settings.

  • An accurate and efficient small model: We provide aiXapply, a specialized 4B model trained with supervised fine-tuning and reinforcement learning, achieving high equivalence accuracy while enabling fast inference with speculative decoding.

  • A high-quality dataset for code Apply: We provide a multi-language dataset from real-world commits via a structured pipeline that converts code changes into update snippets paired with full-file ground truth, with strict verification to ensure correctness and reproducibility.

References (25)