InCoder is a code generation model described in “InCoder: A Generative Model for Code Infilling and Synthesis” (arXiv, April 2022, by Daniel Fried and colleagues from Meta AI and academic partners). It unifies two tasks in one model: ordinary left-to-right program synthesis, and code infilling, where a gap in the middle of a file is completed using the surrounding context on both sides.
The training trick that enables this is causal masking: random spans of code are masked out and moved to the end of the file, so the model learns to generate the missing span conditioned on both what comes before and after. The authors describe InCoder as the first generative model able to directly perform zero-shot code infilling, and they show it helps on tasks such as type inference, comment generation, and variable renaming, where bidirectional context is valuable, while staying competitive on standard left-to-right benchmarks.
InCoder helped establish infilling, often called fill-in-the-middle, as a standard capability that later code models adopted. For businesses, infilling is what makes an AI assistant useful for editing existing code in place, not just writing new code at the end, which is closer to how real software maintenance actually works.