Blog

AI Coding Tools Glossary

Fill-in-the-middle (FIM)

A training and prompting format that lets a code model complete text given both what comes before and after the cursor.

Ordinary language models predict left to right. Code editing needs insertion into the middle of a file, so code models are trained with the file split into prefix, suffix and middle, and asked to produce the middle. FIM is what makes inline completion inside an existing function work rather than only appending at the end.

Source: Efficient Training of Language Models to Fill in the Middle — OpenAI (arXiv:2207.14255)

See the numbers behind this term: AI Coding Tools Statistics 2026.