ChatPaper.aiChatPaper

コーディングエージェント基盤モデルの中間学習としての関数認識型Fill-in-the-Middle

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

July 14, 2026
著者: Yubo Wang, Jiarong Liang, Yuxuan Zhang, Xuye Liu, Cong Wei, Yuyu Zhang, Ping Nie, Wenhu Chen
cs.AI

要旨

コーディングエージェントは、外部ツールの戻り値を進行中の推論に統合しなければならない——この能力は、コードに対する標準的な左から右への事前学習では、その前方方向にしか露出されない。我々は、コーディングエージェントの行動-観察-継続ループが、関数呼び出しサイトと構造的に同型であることを観察する。そこでは、呼び出し元が引数を束縛し、呼び出し先が別の場所で計算された値を返し、後続のコードがその値を消費する。この条件付け構造は、通常のコード中にインターネット規模で存在する。我々はこれを、関数認識型Fill-in-the-Middle(FIM)ミドルトレーニングを通じて活用する。これは、プログラム依存グラフ解析と複雑性・推論可能性の二重基準によって選択された関数をマスクする自己教師あり目的関数である。我々は、Qwen2.5-Coder-Instruct(7B/14B)およびQwen3-8Bを、968のGitHubリポジトリから抽出された26億トークンの汚染除去コーパス上でミドルトレーニングし、その後既存のエージェンティックポストトレーニングパイプラインを適用する。ミドルトレーニングにより、SWE-Bench-Verifiedのスコアは7Bで+2.8、14Bで+3.0、Qwen3-8Bで+3.2向上し、SWE-Bench-Liteでは同一モデルでそれぞれ+3.7、+4.0、+5.4の改善を達成した。この改善は、二つのポストトレーニングパイプライン(R2E-Gym、SWE-Smith)および非Qwen2.5ベース(SWE-Legoを用いたQwen3-8B)でも維持される。ドメイン内での向上に加え、ミドルトレーニングは、エージェンティックポストトレーニングが他のコーディングタスク(例:LiveCodeBench)や非コーディングのツール使用ベンチマーク(tau-bench、BFCL)に本来与える能力低下を緩和する。ミドルトレーニングコーパスにはPythonコードのみが含まれているにもかかわらず、関数呼び出しの帰納的バイアスはポストトレーニング後も生存し、一貫した改善をもたらす。
English
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.