코딩 에이전트 파운데이션 모델을 위한 중간 훈련으로서의 함수 인식 중간 채우기
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
초록
코딩 에이전트는 외부 도구의 반환값을 진행 중인 추론 과정에 통합해야 하는데, 이는 코드에 대한 표준 좌측-우측 사전 훈련이 순방향으로만 노출하는 능력이다. 우리는 코딩 에이전트의 행동-관찰-계속 루프가 구조적으로 함수 호출 지점과 동형(isomorphic)임을 관찰한다. 함수 호출 지점에서는 호출자가 인수를 바인딩하고, 피호출자가 다른 곳에서 계산된 값을 반환하며, 이후 코드가 그 값을 소비한다. 이러한 조건화 구조는 일반 코드에서 인터넷 규모로 존재한다. 우리는 이를 함수 인식 중간 채우기(FIM) 중간 훈련을 통해 활용한다. 이는 프로그램 종속성 그래프 분석과 복잡성-추론 가능성 이중 기준을 통해 선택된 함수를 마스킹하는 자기 지도 학습 목적 함수이다. 우리는 968개의 GitHub 저장소에서 추출한 2.6B-토큰(26억 토큰) 규모의 오염 제거 말뭉치에 대해 Qwen2.5-Coder-Instruct (7B/14B) 및 Qwen3-8B를 중간 훈련한 후, 기존의 에이전틱 사후 훈련 파이프라인을 적용했다. 중간 훈련은 SWE-Bench-Verified에서 7B/14B에 대해 각각 +2.8/+3.0, Qwen3-8B에서 +3.2의 성능 향상을 보였으며, SWE-Bench-Lite에서는 동일 모델에 대해 각각 +3.7/+4.0/+5.4의 향상을 보였다. 이러한 성능 향상은 두 가지 사후 훈련 파이프라인(R2E-Gym, SWE-Smith)과 Qwen2.5가 아닌 기본 모델(Qwen3-8B with SWE-Lego)에서도 유지되었다. 도메인 내 성능 향상 외에도, 중간 훈련은 에이전틱 사후 훈련이 그렇지 않으면 비에이전트 코딩(예: 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.