# Function-Aware Fill-in-the-Middle as Mid-Training for Coding Agent Foundation Models
> Ficha editorial pública de Research IA. Estado: Lectura primaria completa. La interpretación editorial no sustituye la fuente primaria.

- Página canónica: https://luiseduardodemiguel.com/research-ia/papers/function-aware-fill-in-the-middle-as-mid-training-for-coding-agent-found
- Fuente primaria: https://arxiv.org/html/2607.12463v1
- Versión leída: v3
- Fuente comprobada: 2026-08-19 · lectura primaria completa; extracción editorial automatizada, revisión humana pendiente
- Autores: Yubo Wang, Jiarong Liang, Yuxuan Zhang, Xuye Liu, Cong Wei, Yuyu Zhang, Ping Nie, Wenhu Chen
- Fecha del corte: 14 JULIO 2026.
- Área: AGENTES · CODING

## Tesis y contexto

Observa que el ciclo agentic acción → resultado de herramienta → continuación se parece estructuralmente a una llamada a función: algo externo produce un resultado que después debe incorporarse. Usa código existente a escala internet para crear un objetivo FIM que entrena precisamente esa capacidad.

- Problema: Los modelos de código aprenden principalmente generación izquierda-a-derecha, pero un coding agent debe integrar continuamente observaciones producidas externamente.
- Por qué importa: En vez de enseñar tool-use solo con costosas trayectorias agentic, propone aprovechar la estructura natural del código como señal de pre/mid-training.

## Evidencia reportada

- **reported-result**: Consistent gains on the Qwen2.5-Coder-Instruct series. [localizador](https://arxiv.org/html/2607.12463#S3)
- **reported-result**: Holding the post-training pipeline fixed at R2E-Gym, FIM mid-training improves SWE-Bench-Verified by +2.80 on 7B-Instruct and +3.00 on 14B-Instruct, with matching directional gains on SWE-Bench-Lite ( +3.67/+4.00 ). [localizador](https://arxiv.org/html/2607.12463#S3)
- **reported-result**: Replacing R2E-Gym with SWE-Smith on the same 7B base yields +5.30 points on Verified, larger than the +2.80 under R2E-Gym; on Lite the SWE-Smith pairing gains only +0.50 , smaller than +3.67 for the R2E-Gym pairing. [localizador](https://arxiv.org/html/2607.12463#S3)
- **reported-result**: Switching to Qwen3-8B paired with SWE-Lego, mid-training improves Verified by +3.20 and Lite by +5.40 , comparable to the Qwen2.5-Coder-Instruct gains. [localizador](https://arxiv.org/html/2607.12463#S3)

## Lectura y límite

- Método: La lectura de 2 Method describe la intervención y su construcción: A coding agent at step t samples a_{t}\sim\pi(a_{t}\mid h_{t}) , observes o_{t+1}\sim p(o_{t+1}\mid h_{t},a_{t}) , and continues. Function calls mirror this loop (Figure 1 , left): pre-call context, call, return, and downstream usage align with history, action, observation, and continuation. This isomorphism motivates a fill-in-the-middle (FIM) objective drawn from code. Random-span FIM ( 20 ; 14 ; 24 ) captures it only incidentally; our function-aware variant selects masking targets by program structure and contextual predictability. We curate a corpus of 968 Python repositories from GitHub. Starting from…
- Límite: La lectura primaria permite comprobar método y resultados en el HTML, pero no convierte sus conclusiones en validación independiente. La ficha no demuestra transferencia fuera de los datasets, modelos, herramientas y condiciones descritos en 3 Experiments.
- Confianza editorial: Media
- Limitación: El cierre de la fuente señala: We close by stating four limitations that scope our claims. (i) Python-only corpus and evaluation. The mid-training corpus and the in-domain agent benchmarks are exclusively Python; cross-language evidence comes only indirectly through FullStackBench-EN (Section 3.3 ), and transfer to Java, C++, or Rust is left to future work. (ii) Teacher dependency for CoT. The default recipe relies on Gemini-3-Flash; the CoT-source ablation (Section 3.4 ) shows…
- Limitación: La ficha no demuestra transferencia fuera de los datasets, modelos, herramientas y condiciones descritos en 3 Experiments.

## Localizadores de evidencia
- [Fuente primaria · canonical](https://arxiv.org/html/2607.12463v1): tipo abstract
- [HTML · lectura completa](https://arxiv.org/html/2607.12463): tipo abstract
- [Método · 2 Method](https://arxiv.org/html/2607.12463#S2): tipo section
- [Evaluación · 3 Experiments](https://arxiv.org/html/2607.12463#S3): tipo section
- [Cierre · 6 Limitations and Discussion](https://arxiv.org/html/2607.12463#S6): tipo section
- [HTML · fuente navegable](https://arxiv.org/abs/2607.12463v1): tipo abstract

## Próxima prueba

- ¿La propuesta mejora coding agents frente a la línea base actual?
- Métrica: Comparar la métrica principal de la fuente junto con calidad, coste, latencia y tasa de errores.
- Regla de parada: Parar si no aparece una mejora reproducible o si aumenta el riesgo, la complejidad o el coste sin compensación.

## Recursos reproducibles
- [https://github.com/TIGER-AI-Lab/FIM-Midtraining](https://github.com/TIGER-AI-Lab/FIM-Midtraining)
- [the following issues](https://github.com/arXiv/html_feedback/issues)
- [list of packages that need conversion](https://github.com/brucemiller/LaTeXML/wiki/Porting-LaTeX-packages-for-LaTeXML)
- [developer contributions](https://github.com/brucemiller/LaTeXML/issues)

## Enlaces relacionados

- [VAKRA](https://luiseduardodemiguel.com/research-ia/markdown/papers/vakra)
- [The Devil Is in the Interface](https://luiseduardodemiguel.com/research-ia/markdown/papers/devil-interface)
- [SkillSentry](https://luiseduardodemiguel.com/research-ia/markdown/papers/skillsentry)