mlsanityData to 7 Oct 2026

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

arXiv 2607.12463 ↗First posted 14 Jul 2026cs.AI cs.CLcited by 2

On the map: LLM agents and tool use → Software engineering coding agents

Abstract (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-continuation loop of a coding agent is structurally isomorphic to a function call site, where a caller binds arguments, a callee returns a value computed elsewhere, and downstream code consumes that value. This conditioning structure exists at internet scale in ordinary code. We exploit it through function-aware fill-in-the-middle (FIM) mid-training: a self-supervised objective that masks functions selected via program dependency graph analysis and a complexity-inferability double criterion. We mid-train Qwen2.5-Coder-Instruct (7B/14B) and Qwen3-8B on a 2.6B-token decontaminated corpus drawn from 968 GitHub repositories, then apply existing agentic post-training pipelines. Mid-training improves SWE-Bench-Verified by +2.8/+3.0 at 7B/14B and by +3.2 on Qwen3-8B; SWE-Bench-Lite gains are +3.7/+4.0/+5.4 on the same models. The improvement holds across two post-training pipelines (R2E-Gym, SWE-Smith) and on a non-Qwen2.5 base (Qwen3-8B with SWE-Lego). Beyond in-domain gains, mid-training also mitigates the capability erosion that agentic post-training otherwise inflicts on non-agent coding (e.g., LiveCodeBench) and non-coding tool-use benchmarks (tau-bench, BFCL): although the mid-training corpus contains Python code only, the function-call inductive bias survives post-training and yields consistent gains.

Key facts. Cited by 2 papers in the map (data through 7 Oct 2026). Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use. Builds on 30 of its 40 references that are in the map. First posted on arXiv 14 Jul 2026.

Builds on

30 of 40 references.

Closest ancestors · 4

Same direction, newest first

  1. 2025Toward Training Superintelligent Software Agents through Self-Play SWE-RL21 Dec
  2. 2025R2E-Gym: Procedural Environments and Hybrid Verifiers for Scaling Open-Weights SWE Agents9 Apr
  3. 2024OpenHands: An Open Platform for AI Software Developers as Generalist Agents23 Jul
  4. 2024Agentless: Demystifying LLM-based Software Engineering Agents1 Jul

Other references · 26

  1. 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,193
  2. 2020Don't Stop Pretraining: Adapt Language Models to Domains and Taskscited by 1,548
  3. 2024τ-bench: A Benchmark for Tool-Agent-User Interaction in Real-World Domainscited by 1,280
  4. 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
  5. 2023Distilling Step-by-Step! Outperforming Larger Language Models with Less Training Data and Smaller Model Sizescited by 710
  6. 2024MiniCPM: Unveiling the Potential of Small Language Models with Scalable Training Strategiescited by 694
  7. 2024OLMo: Accelerating the Science of Language Modelscited by 599
  8. 2026Terminal-Bench: Benchmarking Agents on Hard, Realistic Tasks in Command Line Interfacescited by 515
  9. 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 492
  10. 2024StarCoder 2 and The Stack v2: The Next Generationcited by 484
  11. 2022Large Language Models Are Reasoning Teacherscited by 318
  12. 2025SWE-Bench Pro: Can AI Agents Solve Long-Horizon Software Engineering Tasks?cited by 254
14 more
  1. 2023Magicoder: Empowering Code Generation with OSS-Instructcited by 251
  2. 2022Efficient Training of Language Models to Fill in the Middlecited by 248
  3. 2025Multi-SWE-bench: A Multilingual Benchmark for Issue Resolvingcited by 165
  4. 2023Distil-Whisper: Robust Knowledge Distillation via Large-Scale Pseudo Labellingcited by 87
  5. 2024Dataflow-Guided Retrieval Augmentation for Repository-Level Code Completioncited by 40
  6. 2024GraphCoder: Enhancing Repository-Level Code Completion via Code Context Graph-based Retrieval and Language Modelcited by 40
  7. 2025Unveiling the Key Factors for Distilling Chain-of-Thought Reasoningcited by 40
  8. 2025Training Long-Context, Multi-Turn Software Engineering Agents with Reinforcement Learningcited by 34
  9. 2024AST-T5: Structure-Aware Pretraining for Code Generation and Understandingcited by 32
  10. 2025Front-Loading Reasoning: The Synergy between Pretraining and Post-Training Datacited by 26
  11. 2025A Survey on LLM Mid-Trainingcited by 18
  12. 2026ReMiT: RL-Guided Mid-Training for Iterative LLM Evolutioncited by 4
  13. 2025Structure-Aware Fill-in-the-Middle Pretraining for Codecited by 3
  14. 2025Extending Fill-In-the-Middle with Instructions for Steerable Code Completioncited by 2

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 2.

2 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2026Latent Programming Horizons in Coding Agents
  2. 2026Yet Even Less Is Even Better For Agentic, Reasoning, and Coding LLMs
  3. 2026Before They Can Solve: Predicting Post-Training Coding-Agent Performance from Base Models
  4. 2026OctoBench: Benchmarking Scaffold-Aware Instruction Following in Repository-Grounded Agentic Coding
  5. 2026Small Reasoning Models are Instruction Followers in Function Calling
  6. 2026From Completion to Editing: Unlocking Context-Aware Code Infilling via Search-and-Replace Instruction Tuning
  7. 2026CodeMidas: Scaling Agentic Coding RL Environments from Code Itself
  8. 2025CodeARC: Benchmarking Reasoning Capabilities of LLM Agents for Inductive Program Synthesis