arXiv:2607.12463: function-aware FIM mid-training boosts coding agents up to +5.4 on SWE-Bench
Yubo Wang et al. (8 authors) introduce mid-training with function-aware FIM using program dependency graph analysis. On SWE-Bench-Lite it achieves improvements of +3.7 to +5.4 points on Qwen2.5-Coder and Qwen3-8B models, with a training corpus of 2.6 billion tokens from 968 GitHub repositories.
This article was generated using artificial intelligence from primary sources.
What are FIM and mid-training?
FIM (Fill-in-the-Middle) is a training technique where the model fills in a code snippet between a given prefix and suffix — rather than just generating a continuation, it must understand the context that comes after. Mid-training is the phase between pre-training (on large corpora) and fine-tuning (on specific tasks): its goal is to shape the model’s foundations for a particular domain without destroying general capability. Yubo Wang and seven co-authors on arXiv combine these two techniques into a new method specifically for coding agents.
Function-aware FIM: the role of the dependency graph
Standard FIM masks random code snippets. The novelty of this research is the function-aware approach: masked regions are selected deliberately according to the program dependency graph that models dependencies between functions in the code. This means the model learns to fill in precisely those locations where understanding inter-function dependencies is critical — which corresponds to real-world agentic programming tasks. The training corpus spans 2.6 billion tokens from 968 GitHub repositories, providing a statistically representative sample of real codebases.
Results on SWE-Bench: concrete jumps
The method was validated on two standard benchmarks for agentic programming:
- SWE-Bench-Verified: improvement of +2.8 to +3.2 points on Qwen2.5-Coder (7B and 14B variants) and Qwen3-8B
- SWE-Bench-Lite: improvement of +3.7 to +5.4 points
Compare with typical fine-tuning improvements on specific tasks, which rarely exceed 2-3 points without regression on general abilities. Here the key point is that the method preserves non-agentic coding capabilities even alongside agentic post-training — the improvement is not bought at the expense of overall model quality.
Why this matters for small models
Results on 7B and 8B parameter models are particularly significant: they show that mid-training can compensate for reduced model capacity on agentic tasks that require understanding complex code dependencies. For organizations that cannot afford to run models with tens of billions of parameters, function-aware FIM offers a practical path to stronger coding agents while keeping inference costs in check.
Frequently Asked Questions
- What is FIM mid-training and how does it differ from standard fine-tuning?
- FIM (Fill-in-the-Middle) mid-training is a phase between pre-training and fine-tuning that shapes model foundations for a specific domain. Unlike standard fine-tuning on task-specific data, function-aware FIM uses a program dependency graph to select which code regions to mask, teaching the model to understand inter-function dependencies.
- How much does the SWE-Bench score improve with function-aware FIM?
- On SWE-Bench-Lite, improvements range from +3.7 to +5.4 points on Qwen2.5-Coder and Qwen3-8B models. On SWE-Bench-Verified the gains are +2.8 to +3.2 points.
📬 AI news in your inbox
A daily digest built your way — pick topics, sources and cadence. One-click unsubscribe.
Related news
arXiv:2607.13034: E3 framework — agents estimate task complexity and use 91% fewer tokens
arXiv:2607.12385: PM-Bench measures 'prospective memory' in agents — best GPT-5.4 scores only 65.1% F1
arXiv:2607.11185: SCALECUA scales computer-use agents with RL — 68.7% on OSWorld