Infill text
Generating text that fits into a missing section or gap within existing text.
Infill text is when an AI model generates words to complete a sentence, paragraph, or document where something is missing. Think of it like a fill-in-the-blanks exercise for the AI.
For example, if you have the sentence "The cat sat on the ___" and ask an AI to infill, it might generate "mat" to complete the thought.
Infill text generation involves producing content that logically and contextually fits into a predefined gap within existing text. This differs from standard autoregressive generation, which extends text from a given prompt. Models trained for infilling can handle tasks like sentence completion, paragraph expansion, or even filling larger structural gaps, often by conditioning on both the preceding and succeeding context.
OpenAI's research highlights the potential of infill text generation to enhance language model versatility. This capability is crucial for developing more robust AI assistants that can understand and manipulate text in more complex ways than simple continuation.
- Efficient training of language models to fill in the middleOpenAI · OpenAI News ·
- OpenAI ChatGPT
- OpenAI has researched methods for training language models specifically to perform infill text generation, improving their ability to handle missing content.
- Text completion
- Text completion typically extends text from a given prompt, whe
- Summarization
- Summarization condenses existing text into a shorter version, whi
The concept of infill text generation has been explored in various research papers as a way to enhance the capabilities of large language models beyond simple sequential generation.
In ChatGPT, try typing a sentence with a blank, like 'The best way to learn AI is to ___, and then ask it to complete the sentence. You can also try giving it a paragraph with a missing sentence in the middle and ask it to fill in the gap.
The Playbook: reusable how-tos, prompts, configs and tips pulled out of the news.
- PromptRole-play a student struggling with math for AI tutor simulationSimulate a student's math struggles and uncertainty for AI tutor evaluation. · 5 min
- TemplateReusable workflow templates for healthcare teamsTeams can create and share templates for common workflows like documentation or prior authorizations. · 15 min
- TemplateTemplate for building an AI tool tailored to your workA structured approach to defining and building a custom AI tool for specific business needs. · 15 min
- TemplateEvals CSV prompt list for agent skillsA CSV file template for listing prompts used in evaluating agent skills. · 20 min
- HeuristicDouble coding agent task completion with docs linksProviding coding agents with a documentation link significantly increases their task completion rate. · 2 min
Questions people ask
- How is infill different from normal text generation?
- Normal text generation continues from a prompt. Infill generation inserts text into a gap, using context from both before and after the gap.
- What are the benefits of infill generation?
- It makes models more versatile, allowing them to edit, complete, or expand text in a more controlled way, rather than just continuing it.
First seen on Subvolts Jul 28, 2022. Updated Sep 15, 2026. Written by an AI model from the items above and reviewed against them weekly; report an error.

