From Completion to Editing: Unlocking Context-Aware Code Infilling via Search-and-Replace Instruction Tuning

Jiajun Zhang, Zeyu Cui, Jiaxi Yang, Lei Zhang, Yuheng Jing, Zeyao Ma, Tianyi Bai, Binyuan Hui, Qiang Liu, Zilei Wang, Liang Wang, Junyang Lin · 2026

Read From Completion to Editing: Unlocking Context-Aware Code Infilling via Search-and-Replace Instruction Tuning by Jiajun Zhang, Zeyu Cui, Jiaxi Yang, Lei Zhang, Yuheng Jing, Zeyao Ma, Tianyi Bai, Binyuan Hui, Qiang Liu, Zilei Wang, Liang Wang, Junyang Lin (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2601-13384.txt.

Description

Jiajun Zhang and a large team teach code models to edit in place, not just fill gaps. The stock fill in the middle form asks a model to write the span left blank in a code file. That form is stiff. It cannot fix flaws in the code that is left in place. It also leans on base models that lack safety tune.

Chat models are safe but slow at edits. Agent chains are flex but lag more. The team's swap is search and replace teach. The model learns to state an edit as a find and swap pair, in chat form. That gives in context edits with chat grade safety and less lag.

Catalog record

CREATORJiajun Zhang, Zeyu Cui, Jiaxi Yang, Lei Zhang, Yuheng Jing, Zeyao Ma, Tianyi Bai, Binyuan Hui, Qiang Liu, Zilei Wang, Liang Wang, Junyang Lin
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE97 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2601-13384

Browse the full library · About the Tower of Babel