Synthesizing Code Completion Trajectories for Mid-training in Software Engineering

Siwei Xu, Qiyuan Liu, Ruifan Li


Abstract
Large language models (LLMs) have shown remarkable capabilities in interactive real-world software engineering (SWE) scenarios. However, the execution-aware training data are hard to scale and are mostly used for post-training, leaving agentic mid-training underexplored. To this end, we propose COMP-SYNTH, a novel automated pipeline for synthesizing reflective code completion trajectories. Specifically, based on executable repository environments, COMP-SYNTH identifies test-covered target functions, masks their implementations, and prompts an LLM to complete them under execution feedback. Then, each generated completion is verified by running the associated tests. Furthermore, failed attempts are augmented with diagnostic signals to extract useful supervision. Thus, we construct COMP-TRAJ, a mid-training dataset that exposes models to repository context, execution feedback, and iterative code revision. Extensive experiments on repository-level SWE benchmarks show that mid-training on COMP-TRAJ effectively enhances capabilities in SWE. Our code and data are publicly available at https://github.com/uuam5/comp-traj.
Anthology ID:
2026.findings-aacl.234
Volume:
Findings of the Association for Computational Linguistics: IJCNLP-AACL 2026
Month:
November
Year:
2026
Address:
Hengqin, China
Editors:
Yue Zhang, Ruifeng Xu, Ayu Purwarianti, Tong Rong, Jun Suzuki
Venue:
Findings
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
4619–4630
Language:
URL:
https://aclanthology.org/2026.findings-aacl.234/
DOI:
Bibkey:
Cite (ACL):
Siwei Xu, Qiyuan Liu, and Ruifan Li. 2026. Synthesizing Code Completion Trajectories for Mid-training in Software Engineering. In Findings of the Association for Computational Linguistics: IJCNLP-AACL 2026, pages 4619–4630, Hengqin, China. Association for Computational Linguistics.
Cite (Informal):
Synthesizing Code Completion Trajectories for Mid-training in Software Engineering (Xu et al., Findings 2026)
Copy Citation:
PDF:
https://aclanthology.org/2026.findings-aacl.234.pdf