As a leading application of large language models (LLMs) in software engineering, Fill-in-the-Middle (FIM) mode code completion has drawn wide attention. Training such models requires masking code corpora, yet common strategies tend to be problematic: character-delimited random masking may yield many unrealistic cases (e.g., cutting keywords or identifiers), while purely AST-based masking cannot mask concurrent elements that span across multiple subtrees. These limitations easily create anti-patterns that rarely occur in real-world code completion, diminishing FIM performance. We introduce SynthCoder, which adopts optimized masking strategies better aligned with developers' expectations in FIM. Specifically, we first refine AST-level node masking and add heuristics that better mimic developers' expectations to construct the training corpora. Subsequently, SynthCoder-Seed and SynthCoder-Qwen, built upon Seed-Coder-8B-Base and Qwen2.5-Coder-7B respectively, employ a two-stage training pipeline, i.e., a curriculum-based fine-tuning stage followed by a Direct Preference Optimization (DPO) alignment stage with rejected code sampled preference data. Besides, to suppress erroneous context repetition, we include negative samples that duplicate existing code during DPO, mitigating such failures when the model fails in producing valid completions. Extensive experiments on Santacoder-fim-task, aiXcoder-FIM-Evaluation and CrossCodeEval benchmarks show that the models trained with our mitigation strategies improve over mainstream baselines on Exact Match (EM) and Edit Similarity (ES) for text-based FIM benchmarks, and on Pass@1 for Santacoder-fim-task which has test cases. SynthCoder also yields less code-echo and consumes fewer tokens at inference, yielding higher practical efficiency. Ablation studies further support the contribution of our optimized masking and repetition-suppression mechanisms.


翻译:暂无翻译

0
下载
关闭预览

相关内容

【ETZH博士论文】语言模型编程
专知会员服务
25+阅读 · 2025年6月14日
【CIKM2024教程】大语言模型在表格任务中的应用
专知会员服务
24+阅读 · 2024年10月30日
《大型语言模型代码生成》综述
专知会员服务
70+阅读 · 2024年6月4日
meta learning 17年:MAML SNAIL
CreateAMind
11+阅读 · 2019年1月2日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
18+阅读 · 2018年12月24日
超全总结:神经网络加速之量化模型 | 附带代码
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
相关主题
最新内容
综述|谁来改进机器人?迈向物理递归自我改进
专知会员服务
3+阅读 · 10月14日
软件定义无人机蜂群给防空带来全新压力
专知会员服务
9+阅读 · 10月13日
《半自主无人地面战车的互操作性》66页
专知会员服务
11+阅读 · 10月13日
迈向更智慧的军事情报
专知会员服务
9+阅读 · 10月12日
《美国陆军2026年野战手册 2-0 情报》
专知会员服务
8+阅读 · 10月12日
《基于启发式算法求解武器-目标分配问题》
专知会员服务
9+阅读 · 10月12日
相关基金
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员