Fill-in-the-Middle: The Magic Behind Smart Code Completion
vnavarro.dev · 1,678 words · saved by 1 readers
How your favorite code editor suggests exactly what you were thinking of
Fill-in-the-Middle (FIM) is a technique in code completion that allows language models to generate code based on context from both before and after the cursor. Unlike traditional left-to-right autocompletion, which only sees past code, FIM provides a "peek into the future," enabling significantly more accurate and contextually aware suggestions. The technique was popularized by OpenAI's 2022 paper, "Efficient Training of Language Models to Fill in the Middle", which detailed an effective method for training models on this task. This approach has since become a cornerstone for many…
saved by
related reading
- Character Prefix Conditioningcursor.com
- Best practices for Claude Code - Claude Code Docsanthropic.com
- copilot-explorer | Hacky repo to see what the Copilot extension sends to the serverthakkarparth007.github.io
- A Guide to Claude Code 2.0 and getting better at using coding agents – sankalp's blogsankalp.bearblog.dev
- GitHub - x1xhlol/system-prompts-and-models-of-ai-tools: FULL Augment Code, Claude Code, Cluely, CodeBuddy, Comet, Cursor, Devin AI, Junie, Kiro, Leap.new, Lovable, Manus, NotionAI, Orchids.app, Perplexity, Poke, Qoder, Replit, Same.dev, Trae, Traycer AI, VSCode Agent, Warp.dev, Windsurf, Xcode, Z.ai Code, Dia & v0. (And other Open Sourced) System Prompts, Internal Tools & AI Modelsgithub.com
- More problemscursor.com
- Coding Models Are Doing Too Much | whnrehiew.github.io
- Cursor: AI coding agentcursor.com
- Shipping at Inference-Speed | Peter Steinbergersteipete.me
- Here’s how I use LLMs to help me write codesimonwillison.net
- The open source AI coding agentopencode.ai
- GitHub - brexhq/prompt-engineering: Tips and tricks for working with Large Language Models like OpenAI's GPT-4.github.com