Function-Aware Fill-in-the-Middle as Mid-Training for Coding Agent Foundation Models
- URL: http://arxiv.org/abs/2607.12463v3
- Date: Sun, 19 Jul 2026 05:59:25 GMT
- Title: Function-Aware Fill-in-the-Middle as Mid-Training for Coding Agent Foundation Models
- Abstract summary: Coding agents must integrate external tool returns into ongoing reasoning.<n>We exploit it through function-aware fill-in-the-middle mid-training.
- Score: 49.259951930558
- License: http://creativecommons.org/licenses/by/4.0/
- Abstract: 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.
Related papers
- NeoHorse-1: Towards Recursive Self-Improvement via Agentic Post-Training with Routing Harness [76.6324710887112]
NeoHorse-1 is a family of agent-native models developed to explore this path through agentic post-training.<n>Our system combines a heterogeneous model pool with intelligent routing, recording the predicted capability demand, selected service tier, and subsequent interaction for each user turn.
arXiv Detail & Related papers (2026-09-08T03:14:54Z) - AgentBrew: Offline Tool-Use Agent Learning from Raw Real-World Trajectories [36.7302669545557]
Real-world applications provide no pre-defined tasks or verifiers, no faithful simulators, and limited budget for large-scale environment interaction.<n>We propose textbfAgentBrew, an offline training framework that learns effective tool-use policies from a single batch of raw interaction trajectories.<n>AgentBrew improves Qwen3-32B by +8.7 Acc / +9.7 Score on average, surpassing Qwen3-235B (+2.3 / +4.4) and outperforming rejection sampling.
arXiv Detail & Related papers (2026-09-05T03:04:23Z) - LEGO-RL: Harness-Native Reinforcement Learning for Coding Agents [56.902747731541695]
We present LEGO-RL, a framework that bridges native coding-agent harnesses with scalable policy-gradient optimization.<n>We evaluate LEGO-RL by training the sparse MoE model Qwen3.5-35B-A3B with GSPO across three native coding-agent harnesses.
arXiv Detail & Related papers (2026-08-18T05:34:35Z) - When Do Task Vectors Interfere? Mapping the Validity Boundaries of Weight-Space Composition [3.2114065314849323]
Task arithmetic treats fine-tuning displacements as composable directions in weight space.<n>We separate parameter geometry from functional geometry and measure pairwise functional non-additivity over a two-dimensional task-vector surface.
arXiv Detail & Related papers (2026-08-10T11:58:04Z) - KAT-Coder-V2.5 Technical Report [61.907486544595336]
KAT-Coder-V2.5 is a coding-focused agentic model trained to act autonomously inside real, executable repositories.<n>It reconstructs multilingual repositories into sandboxed environments with fail-to-pass and pass-to-pass verification at scale.<n>We further scale reinforcement learning with harness randomization, a reliability-hardened sandbox, an asymmetric actor--critic PPO with hindsight-augmented value estimation, and a harness-oriented reward framework.
arXiv Detail & Related papers (2026-07-06T08:14:02Z) - ExecuGraph: A Multi-Agent, Execution-Grounded Framework for Reliable Backend Code Synthesis with Large Language Models [2.3004655342211078]
Large Language Models generate plausible backend code, but a single-pass paradigm provides no guarantee of correctness or runtime reliability.<n>We present ExecuGraph, a multi-agent framework that places execution-based validation at the center of backend code.<n>A per-agent ablation, retry-budget sweep, error-class taxonomy, and test-source audit are reported.
arXiv Detail & Related papers (2026-06-18T05:58:17Z) - Skill Is Not Document: A Query-Conditional Benchmark and Two-Stage Retriever for LLM Agent Skill Routing [40.648572239231804]
R3-Skill is a benchmark for realistic agent skill routing.<n>We build a two-stage retrieval system with skill compatibility as an explicit training signal.<n>The dataset, training code and model weights are released as open source for agent skill routing.
arXiv Detail & Related papers (2026-06-02T12:30:46Z) - Mellum2 Technical Report [1.1239988514721222]
Mellum 2 is a general-purpose language model specialized in software engineering.<n>It is the successor to the completion-focused 4B dense Mellum model.<n>Mellum 2 is competitive with open-weight baselines in the 4B-14B range while running at the per-token compute of a 2.5B dense model.
arXiv Detail & Related papers (2026-05-29T13:01:11Z) - Agent Explorative Policy Optimization for Multimodal Agentic Reasoning [97.64835302176056]
Agentic reasoning interleaves two behaviors with a structural asymmetry: thinking and tool use.<n>Under standard RL recipes like GRPO, the gap manifests as two diagnostic symptoms during training.<n>We propose AXPO (Agent eXplorative Policy Optimization) for each all-wrong tool-using subgroup.
arXiv Detail & Related papers (2026-05-27T17:36:39Z) - ChipMATE: Multi-Agent Training via Reinforcement Learning for Enhanced RTL Generation [55.947962672433675]
ChipMATE is the first self-trained multi-agent framework for RTL generation.<n>Inspired by industrial practice, ChipMATE pairs a Verilog agent with a Python reference-model agent that mutually verify each other's outputs.<n>ChipMATE achieves 75.0% and 80.1% pass@1 on VerilogEval V2 with 4B and 9B base models.
arXiv Detail & Related papers (2026-05-13T01:04:21Z) - SWE-QA-Pro: A Representative Benchmark and Scalable Training Recipe for Repository-Level Code Understanding [41.98672557723593]
We introduce SWEQA-Pro, a benchmark constructed from diverse, long-tail repositories with executable environments.<n>We also propose a scalable synthetic data pipeline that powers a two-stage training recipe: Supervised Fine-Tuning (SFT) followed by Reinforcement Learning from AI Feedback (RLAIF)<n> Empirically, a Qwen3-8B model trained with our recipe surpasses GPT-4o by 2.3 points on SWE-QA-Pro and substantially narrows the gap to state-of-the-art models.
arXiv Detail & Related papers (2026-03-17T05:12:48Z) - TeaRAG: A Token-Efficient Agentic Retrieval-Augmented Generation Framework [62.66056331998838]
TeaRAG is a token-efficient agentic RAG framework capable of compressing both retrieval content and reasoning steps.<n>Our reward function evaluates the knowledge sufficiency by a knowledge matching mechanism, while penalizing excessive reasoning steps.
arXiv Detail & Related papers (2025-11-07T16:08:34Z) - Chain of Execution Supervision Promotes General Reasoning in Large Language Models [48.100128916029064]
We introduce TracePile, a large-scale corpus of 2.6 million samples that transforms code execution into explicit, step-by-step chain-of-thought-style rationales.<n>We evaluate TracePile using three training setups: continue-pretraining, instruction tuning after pretraining, and two-stage finetuning.<n> Notably, TracePile boosts LLaMA3.1-8B by 7.1% on average across nine math datasets and delivers clear gains on LiveCodeBench, CRUX, and MMLU.
arXiv Detail & Related papers (2025-10-24T02:21:11Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.