A specialized 4B model can integrate code snippets accurately
AiXapply: Fast and Reliable Full-File Code Integration with Specialized Small Models for IDE Workflows · arXiv:2611.07634

In plain words
aiXapply is a specialized small model for applying an update snippet to an existing code file. Instead of writing a patch or searching for text to replace, it writes the whole updated file, aiming to leave everything else untouched.
The authors trained it on examples made from real code commits and checked its outputs against reference files. On their multi-language test set, a trained 4B version matched the reference nearly as often as a much larger model. That result is limited to this task and test set.
The research
For a code edit to be useful, applying the requested change must leave unrelated file content intact. The integration format affects both reliability and waiting time: full-file output avoids diff-format and matching failures, but takes longer to generate.
This work tests whether a specialized small model can make that trade-off practical in the code-integration task.
aiXapply treats snippet integration as a dedicated task, training a 4B model to generate the complete edited file while aiming to preserve code outside the requested change.
The authors trained aiXapply on commit-derived examples pairing an original file and snippet with a complete target file. On the main test set of 1,637 examples across 20 languages and file types, the untrained Qwen3-4B baseline matched the reference in 65.1% of examples; trained aiXapply-RL and aiXapply-SFT matched it in 93.8% and 94.4%.
The SFT score was close to 94.8% for the much larger Qwen3.5-397B-A17B. These results show higher reference agreement for the trained 4B models on this test set, while the comparison with the larger model cannot isolate the effect of task-specific training because scale and training differ.
The accuracy results measure agreement with reference files on the tested examples, not whether edits preserve behavior in every codebase. Training used one model backbone, the test split was by commit rather than repository, and the task covered single files.
What the evidence shows
- Make integration its own task
aiXapply is a specialized 4B system for a specific IDE task: turning an original file and a supplied update snippet into the complete edited file. It aims to preserve content outside the requested change.
This makes integration a distinct step after an edit has been specified, rather than asking a model to devise and apply an edit at once.
- Representation changes the result
The paper compares three ways to carry out that step: unified diff, search-and-replace, and full-file Apply. For DeepSeek-v3.2 on the same multi-language test set, the shares of correct files were 56.0% with diff and 91.6% with full-file Apply; search-and-replace scored 74.9%.
Correctness meant matching a reference under token-based rules for code and format-aware rules for other files. In observed failures, malformed diff headers or incorrect hunk line numbers or counts could invalidate a patch, while unmatched or ambiguous source fragments could defeat search-and-replace.
The result favors full-file output in this comparison, though it requires generating unchanged content too.
- A small model approaches a larger one
The untrained Qwen3-4B baseline scored 65.1% on the main test set across 20 languages and file types; the trained aiXapply-RL and aiXapply-SFT versions scored 93.8% and 94.4%. These percentages are shares of examples whose generated files matched the reference.
This comparison shows higher reference agreement for the trained 4B models on this test set. The SFT score was also close to 94.8% for the much larger Qwen3.5-397B-A17B, though that comparison cannot isolate the effect of training because the models differ in scale and training.
- Long files separate training versions
The comparison suggests that training procedure affected file integrity in this long-input setting: supervised training performed better than reinforcement learning. Because the versions used different training procedures and the set was small, the size of this gap should be interpreted cautiously.
- Deployment shortened the Apply stage
The deployment comparison measured Apply-stage latency in one enterprise IDE workflow. Mean latency fell from 50 seconds, when an upstream model generated the full file, to 1.89 seconds after aiXapply-RL handled that stage.
The timing came from a one-week before-and-after measurement that excluded queuing and included multiple tool-call rounds. It is evidence about that deployment’s Apply stage, not a measured end-to-end improvement under identical conditions.
- First outputs passed task checks
Assessors judged the first Apply outputs from aiXapply-RL and upstream GLM-5 acceptable at similar rates on these selected internal tasks. This assessment covered Apply quality, not whether either system completed the development task.
Deep
- Original paper authors
- Siyuan Jiang, Xiang Cai, Peixu Wang, Yu Han, Yihong Dong
- Submitted to arXiv
- License
- CC BY 4.0