paper-with-me

홈 › Papers

Structure-Aware Fill-in-the-Middle Pretraining for Code

2025-05-30 · Linyuan Gong, Alvin Cheung, Mostafa Elhoushi, Sida Wang

Fill-in-the-Middle (FIM) is a common pretraining method for code LLMs, where models complete code segments given surrounding context. However, existing LLMs treat code as plain text and mask random character spans. We propose and evaluate AST-FIM, a pretraining strategy that leverages Abstract Syntax Trees (ASTs) to mask complete syntactic structures at scale, ensuring coherent training examples better aligned with universal code structures and common code editing patterns such as blocks, expressions, or functions. To evaluate real-world fill-in-the-middle (FIM) programming tasks, we introduce Real-FIM-Eval, a benchmark derived from 30,000+ GitHub commits across 12 languages. On infilling tasks, experiments on 1B and 8B parameter models show that AST-FIM is particularly beneficial for real-world code editing as it outperforms standard random-character FIM by up to 5 pts on standard FIM benchmarks. Our code is publicly available at https://github.com/gonglinyuan/ast_fim.

📄 PDF Abstract BibTeX arXiv:2506.00204

Code (0)

등록된 구현이 없습니다.

Similar Papers 제목 키워드 기반

Evaluation of LLMs on Syntax-Aware Code Fill-in-the-Middle Tasks

2024-03-07 · Linyuan Gong, Sida Wang, Mostafa Elhoushi, Alvin Cheung

We introduce Syntax-Aware Fill-In-the-Middle (SAFIM), a new benchmark for evaluating Large Language Models (LLMs) on the code Fill-in-the-Middle (FIM) task. This benchmark focuses on syntax-aware completions of program s…

Code Completion

Function-Aware Fill-in-the-Middle as Mid-Training for Coding Agent Foundation Models

2026-07-14 · Yubo Wang, Jiarong Liang, Yuxuan Zhang, Xuye Liu 외 arxiv

Coding agents must integrate external tool returns into ongoing reasoning - a capability that standard left-to-right pretraining on code exposes only in its forward direction. We observe that the action-observation-conti…

Memorization Dynamics of Fill-in-the-Middle Pretraining

2026-05-21 · Tobias von Arx, Tanguy Dieudonné arxiv

Fill-in-the-middle (FIM) is a pretraining objective widely used to equip causal language models with infilling ability, yet its effect on verbatim memorization remains underexplored. We study the memorization dynamics of…

From Output to Evaluation: Does Raw Instruction-Tuned Code LLMs Output Suffice for Fill-in-the-Middle Code Generation?

2025-05-24 · Wasi Uddin Ahmad, Somshubra Majumdar, Boris Ginsburg

Post-processing is crucial for the automatic evaluation of LLMs in fill-in-the-middle (FIM) code generation due to the frequent presence of extraneous code in raw outputs. This extraneous generation suggests a lack of aw…

Code GenerationHumanEval

Structure-Aware Language Model Pretraining Improves Dense Retrieval on Structured Data

2023-05-31 · Xinze Li, Zhenghao Liu, Chenyan Xiong, Shi Yu 외

This paper presents Structure Aware Dense Retrieval (SANTA) model, which encodes user queries and structured data in one universal embedding space for retrieving structured data. SANTA proposes two pretraining methods to…

Code SearchLanguage ModelingLanguage ModellingRetrieval